Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Get module paremeters from elsewhere!!!

Received: by 10.58.212.198 with SMTP id nm6mr187041vec.35.1343969838487;
        Thu, 02 Aug 2012 21:57:18 -0700 (PDT)
X-BeenThere: joomla-dev-general@googlegroups.com
Received: by 10.220.230.4 with SMTP id jk4ls2828912vcb.4.gmail; Thu, 02 Aug
 2012 21:57:12 -0700 (PDT)
Received: by 10.59.5.166 with SMTP id cn6mr188808ved.3.1343969832468;
        Thu, 02 Aug 2012 21:57:12 -0700 (PDT)
Received: by 10.59.5.166 with SMTP id cn6mr188806ved.3.1343969832423;
        Thu, 02 Aug 2012 21:57:12 -0700 (PDT)
Return-Path: <allon.mor...@gmail.com>
Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170])
        by gmr-mx.google.com with ESMTPS id t4si782810vds.3.2012.08.02.21.57.12
        (version=TLSv1/SSLv3 cipher=OTHER);
        Thu, 02 Aug 2012 21:57:12 -0700 (PDT)
Received-SPF: pass (google.com: domain of allon.mor...@gmail.com designates 209.85.220.170 as permitted sender) client-ip=209.85.220.170;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of allon.mor...@gmail.com designates 209.85.220.170 as permitted sender) smtp.mail=allon.mor...@gmail.com; dkim=pass header...@gmail.com
Received: by mail-vc0-f170.google.com with SMTP id gb30so548813vcb.1
        for <joomla-dev-general@googlegroups.com>; Thu, 02 Aug 2012 21:57:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:in-reply-to:references:from:date:message-id:subject:to
         :content-type;
        bh=pziV1r8CiiqNItkaUfFNJJg1DKkSdRw2be2QgbARRvE=;
        b=ZxPm50cSnkew4IZdCzhYtQUB3L9WB+Cuwo0TDQ7H/CSGCb1NZMDoFaApnIXkMWGGCH
         oNTPnYut0BCtNJX5HBM9DpQT7IYgxGs3GphUloiDBlngWKSwhdLsINawJaFiMOSS9e7V
         Qwxh5a+0zBwXZbkFc+mQxyay882of6lIuUuzCEtl0yNLW6YcXB2UJ4ZXPoZK9xDwQS30
         TPnLuBwq9hZs3iXLrfUuUoNZ2vUjUNmPCs9x+/zCos7G73yq8uEOtZtmUVZ5qh0VCISX
         GL3+z1/Tz0kSXWE8rnpfFc5cJ6PFHCFGskAtGQjEHKIzdahiPOuSFuHYdI2nmYpEyPP9
         1swQ==
Received: by 10.52.174.52 with SMTP id bp20mr298644vdc.29.1343969832170; Thu,
 02 Aug 2012 21:57:12 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.220.35.10 with HTTP; Thu, 2 Aug 2012 21:56:51 -0700 (PDT)
In-Reply-To: <CACLdEOKZ53dwuPpKQ17EYjHuVL=OOpSXdbOzhW285UK2iN_...@mail.gmail.com>
References: <0a2be631-9acd-485f-8017-17d886ce2c3b@googlegroups.com> <CACLdEOKZ53dwuPpKQ17EYjHuVL=OOpSXdbOzhW285UK2iN_...@mail.gmail.com>
From: allon moritz <allon.mor...@gmail.com>
Date: Fri, 3 Aug 2012 06:56:51 +0200
Message-ID: <CAAbUApZaqfD06sKZegLYWpGHSQhZG38U766wW0o6gLftFOx...@mail.gmail.com>
Subject: Re: [jgen] Get module paremeters from elsewhere!!!
To: joomla-dev-general@googlegroups.com
Content-Type: multipart/alternative; boundary=bcaec51b18e36f739804c6555c64

--bcaec51b18e36f739804c6555c64
Content-Type: text/plain; charset=ISO-8859-1

Because joomla doesn't provide a way to get the params by module id (mostly
you don't have the module title!!) I get it from the table directly
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('m.*');
$query->from('#__modules AS m');
$query->where('id = '.JRequest::getInt('moduleid'));
$db->setQuery($query);
$module = $db->loadObject();
$params = new JRegistry($module->params);

I also don't like to get it form the database rather than via API, but I
was searching up and down for a function to get the params by module id via
API.

On Fri, Aug 3, 2012 at 6:23 AM, fornandakishore
<fornandakish...@gmail.com>wrote:

> Hello Harmer,
>
> Try to use this code ...
>
> jimport('joomla.application.module.helper');
> $module = JModuleHelper::getModule('mod_login', 'YourModuleTitle');
> //echo JModuleHelper::renderModule($module);
>
> I hope this code will help you to give the specified module parameter in
> any component, module and plugin.
>
> Thanks & Regards
>
> Nanda Kishore. M
> Senior PHP Developer
>
> http://php-desk.blogspot.com
>
> Mobile: + 91 98499 71144
>
>
>
> On Fri, Aug 3, 2012 at 12:54 AM, KHarmer <kristianhar...@gmail.com> wrote:
>
>> Hi all,
>>
>> I have a custom module with custom paramaters which I'd like to be able
>> to get from either a plugin (non-related) or from the modules helper file.
>>
>> The reason being is that these paramaters can/will be used by other
>> extensions.
>>
>> I've googled and cannot find anything that works; I can only load the
>> modules parameters from the modules own tmpl file or the modules own
>> definition file!
>>
>> Any ideas would be gratefully received.
>>
>> Best regards,
>> K...
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Joomla! General Development" group.
>> To view this discussion on the web, visit
>> https://groups.google.com/d/msg/joomla-dev-general/-/wKBkfhpXT9cJ.
>> To post to this group, send an email to
>> joomla-dev-general@googlegroups.com.
>> To unsubscribe from this group, send email to
>> joomla-dev-general+unsubscribe@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/joomla-dev-general?hl=en-GB.
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Joomla! General Development" group.
> To post to this group, send an email to
> joomla-dev-general@googlegroups.com.
> To unsubscribe from this group, send email to
> joomla-dev-general+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/joomla-dev-general?hl=en-GB.
>

--bcaec51b18e36f739804c6555c64
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Because joomla doesn&#39;t provide a way to get the params by module id (mo=
stly you don&#39;t have the module title!!) I get it from the table directl=
y<div><div>$db =3D JFactory::getDbo();</div><div>$query =3D $db-&gt;getQuer=
y(true);</div>

<div>$query-&gt;select(&#39;m.*&#39;);</div><div>$query-&gt;from(&#39;#__mo=
dules AS m&#39;);</div><div>$query-&gt;where(&#39;id =3D &#39;.JRequest::ge=
tInt(&#39;moduleid&#39;));</div><div>$db-&gt;setQuery($query);</div><div>

$module =3D $db-&gt;loadObject();</div><div>$params =3D new JRegistry($modu=
le-&gt;params);</div><div><br></div><div>I also don&#39;t like to get it fo=
rm the database rather than via API, but I was searching up and down for a =
function to get the params by module id via API.</div>

<br><div class=3D"gmail_quote">On Fri, Aug 3, 2012 at 6:23 AM, fornandakish=
ore <span dir=3D"ltr">&lt;<a href=3D"mailto:fornandakish...@gmail.com" targ=
et=3D"_blank">fornandakish...@gmail.com</a>&gt;</span> wrote:<br><blockquot=
e class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc sol=
id;padding-left:1ex">

<font><font face=3D"tahoma,sans-serif">Hello Harmer,<br><br>Try to use this=
 code ...<br><br>jimport(&#39;joomla.application.module.helper&#39;);<br>$m=
odule =3D JModuleHelper::getModule(&#39;mod_login&#39;, &#39;YourModuleTitl=
e&#39;); <br>



//echo JModuleHelper::renderModule($module);<br><br>I hope this code will h=
elp you to give the specified module parameter in any component, module and=
 plugin.<br clear=3D"all"></font></font><div style=3D"font-family:tahoma,sa=
ns-serif">



<font style=3D"font-family:tahoma,sans-serif" size=3D"2"><span style=3D"bor=
der-collapse:separate"></span></font>=A0</div>
<div style=3D"font-family:tahoma,sans-serif"><font style=3D"font-family:tah=
oma,sans-serif" size=3D"2"><span style=3D"border-collapse:separate">Thanks =
&amp; Regards</span></font><font><span style=3D"line-height:normal;border-c=
ollapse:separate;text-indent:0px;letter-spacing:normal;font-variant:normal;=
text-transform:none;font-style:normal;white-space:normal;font-weight:normal=
;word-spacing:0px"><span><span></span><span style=3D"border-collapse:collap=
se"></span></span></span></font></div>




<p style=3D"margin:0px;font-family:tahoma,sans-serif"><span style=3D"border=
-collapse:separate"></span>Nanda Kishore. M</p><span style=3D"font-family:t=
ahoma,sans-serif"><font size=3D"1">Senior PHP Developer</font></span>
<p style=3D"margin:0px;font-family:tahoma,sans-serif"><span><font size=3D"1=
"><a href=3D"http://php-desk.blogspot.com/" target=3D"_blank">http://php-de=
sk.blogspot.com</a><br></font></span></p>
<p style=3D"margin:0px;font-family:tahoma,sans-serif"><span><font size=3D"1=
">Mobile: <a href=3D"tel:%2B%2091%2098499%2071144" value=3D"+919849971144" =
target=3D"_blank">+ 91 98499 71144</a>=A0</font></span></p><div class=3D"HO=
EnZb"><div class=3D"h5">

<br>
<br><br><div class=3D"gmail_quote">On Fri, Aug 3, 2012 at 12:54 AM, KHarmer=
 <span dir=3D"ltr">&lt;<a href=3D"mailto:kristianhar...@gmail.com" target=
=3D"_blank">kristianhar...@gmail.com</a>&gt;</span> wrote:<br><blockquote c=
lass=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;=
padding-left:1ex">



Hi all,<br>
<br>
I have a custom module with custom paramaters which I&#39;d like to be able=
 to get from either a plugin (non-related) or from the modules helper file.=
<br>
<br>
The reason being is that these paramaters can/will be used by other extensi=
ons.<br>
<br>
I&#39;ve googled and cannot find anything that works; I can only load the m=
odules parameters from the modules own tmpl file or the modules own definit=
ion file!<br>
<br>
Any ideas would be gratefully received.<br>
<br>
Best regards,<br>
K...<br>
<span><font color=3D"#888888"><br>
--<br>
You received this message because you are subscribed to the Google Groups &=
quot;Joomla! General Development&quot; group.<br>
To view this discussion on the web, visit <a href=3D"https://groups.google.=
com/d/msg/joomla-dev-general/-/wKBkfhpXT9cJ" target=3D"_blank">https://grou=
ps.google.com/d/msg/joomla-dev-general/-/wKBkfhpXT9cJ</a>.<br>
To post to this group, send an email to <a href=3D"mailto:joomla-dev-genera=
l@googlegroups.com" target=3D"_blank">joomla-dev-general@googlegroups.com</=
a>.<br>
To unsubscribe from this group, send email to <a href=3D"mailto:joomla-dev-=
general%2Bunsubscribe@googlegroups.com" target=3D"_blank">joomla-dev-genera=
l+unsubscribe@googlegroups.com</a>.<br>
For more options, visit this group at <a href=3D"http://groups.google.com/g=
roup/joomla-dev-general?hl=3Den-GB" target=3D"_blank">http://groups.google.=
com/group/joomla-dev-general?hl=3Den-GB</a>.<br>
<br>
</font></span></blockquote></div><br>

<p></p>

-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;Joomla! General Development&quot; group.<br>
To post to this group, send an email to <a href=3D"mailto:joomla-dev-genera=
l@googlegroups.com" target=3D"_blank">joomla-dev-general@googlegroups.com</=
a>.<br>
To unsubscribe from this group, send email to <a href=3D"mailto:joomla-dev-=
general%2Bunsubscribe@googlegroups.com" target=3D"_blank">joomla-dev-genera=
l+unsubscribe@googlegroups.com</a>.<br>

For more options, visit this group at <a href=3D"http://groups.google.com/g=
roup/joomla-dev-general?hl=3Den-GB" target=3D"_blank">http://groups.google.=
com/group/joomla-dev-general?hl=3Den-GB</a>.<br>


</div></div></blockquote></div><br></div>

--bcaec51b18e36f739804c6555c64--