Joomla! Discussion Forums



It is currently Wed Nov 25, 2009 10:20 pm (All times are UTC )

 




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: RD Glossary
Posted: Mon Feb 06, 2006 10:15 am 
User avatar
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Thu Aug 18, 2005 6:50 am
Posts: 294
Location: Germany - Aachen
To share information’s about the necessary changes I aim to write down my experiences here. I hope this is ok and prevents other developers from some research work.


First install

I have installed my 1.0.7 version and the first impression was good. No errors!

Custom Toolbar Buttons (artf3368)

In the Backend my custom Toolbar-Button isn’t displayed. The cause is a bug in mosAdminMenus see artf3368 for more information’s.

Usage of mosConfig global variables

Example for a change:

form
Code:
global $mosConfig_live_site;
echo $mosConfig_live_site;


to
Code:
global $mainframe;
$live_site = $mainframe(‘live_site’);
echo $live_site;



Use an Editor in your extension.


The procedure has changed.

Old style (Backend and Frontend)
Code:
getEditorContents( 'editor1', 'text' ) ;


// parameters : areaname, content, hidden field, width, height, rows, cols
editorArea( 'editor1', $row->text , 'text', 400, 200, '50', '10' ) ;



New style (Backend and Frontend)
Code:
$editor =& JEditor::getInstance();
echo $editor->getEditorContents( 'editor1', 'text' ) ;

….

// parameters : areaname, content, hidden field, width, height, rows, cols
$editor =& JEditor::getInstance();
echo $editor->getEditor( 'editor1',  $row->definition , 'definition', '100%;', '200', '75', '20' ) ;



Language file


Language files are located in the language directory and there are subdirectories for specific languages eng_GB, ger_DE, ….. Your language file must stored in one subdirectory and named for example. eng_GB.com_rd_glossary.ini or {lang_tag}.com_{componentname}.ini

If you do it in that way, the language file is loaded automatic, if you component is loaded. You don’t must do something similar that.

Code:
// Get the right language if it exists
if (file_exists($mosConfig_absolute_path.'/administrator/components/'._COMP_NAME.'/languages/'.$mosConfig_lang.'_admin.php')) {
  include_once($mosConfig_absolute_path.'/administrator/components/'._COMP_NAME.'/languages/'.$mosConfig_lang.'_admin.php');
} else {
  include_once($mosConfig_absolute_path.'/administrator/components/'._COMP_NAME.'/languages/english_admin.php');
}


Many developers have stored strings as defines in {language}.php files and used this constants to create the output. Now you have to save your strings in ini-files.

Old style:
Code:
define('_RD_ERROR1','Term must be uniq');
define('_RD_GLOSSARY_ADDNEW','Add an new entry');



New style:
Code:
RD ERROR1=Term must be uniq
RD GLOSSARY ADDNEW=Add an new entry


The last step to make your application multi language ready, is to remove the constants from your files and replace them with the Jtext::_() function

You have to change this:
Code:
$addnew = "<a title=\""._RD_GLOSSARY_ADDNEW."\" href=\"". sefRelToAbs( "index.php?option=com_rd_glossary&task=new" . $Itemid ) . "\">". _RD_GLOSSARY_ADDNEW."</a>";



into this
Code:
$addnew = "<a title=\"". JText::_('RD GLOSSARY ADDNEW') ."\" href=\"" . sefRelToAbs( "index.php?option=com_rd_glossary&task=new" . $Itemid ) . "\">". JText::_('RD GLOSSARY ADDNEW') ."##</a>";


Keep in mind the installers language file copy function is broken so you have to copy the files by hand


no direct access

Code:
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );


change to

Code:
defined( '_JEXEC' ) or die( 'Restricted access' );


This isn't actual necessary but as we have opened a file we could do this now


Toolbar and admin screen

The new class for the toolbar is JMenuBar and there is a new function title.

Example:

Code:
JMenuBar::title( JText::_( 'RD GLOSSARY ITEMLISTTITLE' ), 'addedit.png' );


With this function you can move the title in the toolbar area.

I have changed.

this (old 1.0.x style)

Code:
echo "<table class=\"adminheading\">";
echo "<tr><th class=\"addedit\" rowspan=\"2\">"._RD_GLOSSARY_ITEMLISTTITLE."</th>";
echo "<td colspan=\"2\" align=\"right\">$lists</td></tr>";
echo "<tr><td>Filter:</td><td> <input type=\"text\" name=\"search\" value=\"" . $search . "\" class=\"text_area\" onChange=\"document.adminForm.submit();\" />";
echo "</td></tr></table>";


into this (new 1.1 style)

Code:
echo "<table class=\"adminform\">";
echo "<tr><td align=\"left\" width=\"100%\">Filter: <input type=\"text\" name=\"search\" value=\"" . $search . "\" class=\"text_area\" onChange=\"document.adminForm.submit();\" />";
echo "<input type=\"button\" value=\"".JText::_('RD GO')."\" class=\"button\" onclick=\"this.form.submit();\" />";
echo "<input type=\"button\" value=\"".JText::_('RD RESET')."\" class=\"button\" onclick=\"getElementById('search').value='';this.form.submit();\" />";
echo "</td><td nowrap=\"nowrap\">$lists</td></tr></table>";


The table for the items must embedded in a “div”:

Code:
echo "<div id=\"tablecell\">";

TABLE

echo “</div>”;



Some small changes

I have changed this it isn’t necessary at all but usefully.

Code:
$mosConfig_absolute_path -> JPATH_SITE

$mosConfig_absolute_path . ‘/administrator/components/’ -> JPATH_ADMINISTRATOR.'/components/'

_________________
Best regards, Robert
--
My Blog: http://www.robert-deutz.de


Last edited by Jinx on Wed Feb 22, 2006 3:16 pm, edited 1 time in total.

Top
  E-mail  
 
Posted: Tue Feb 21, 2006 10:04 am 
Joomla! Ace
Joomla! Ace
Offline

Joined: Wed Jan 25, 2006 8:46 am
Posts: 1071
Very usefull.

Thanx

_________________
http://www.provisionstudio.com - Professional webdesign and IT Services


Top
  E-mail  
 
Posted: Tue Feb 21, 2006 2:37 pm 
User avatar
Joomla! Champion
Joomla! Champion
Offline

Joined: Fri Aug 12, 2005 12:47 am
Posts: 6431
Hi Robert,

Could u pass this information on to the standards & guidelines working group. They will probably use it to improve the information on the wiki. Thanks.

_________________
Johan Janssens - Joomla Co-Founder, Lead Developer of Joomla 1.5

http://www.nooku.org - multi-lingual content manager and rapid extension development framework for Joomla 1.5
http://www.joomlatools.eu - training, consulting and extension development


Top
   
 
Posted: Wed Feb 22, 2006 3:25 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Thu Aug 18, 2005 8:53 am
Posts: 711
Location: Switzerland
Jinx wrote:
Hi Robert,

Could u pass this information on to the standards & guidelines working group. They will probably use it to improve the information on the wiki. Thanks.


Got it :)

I lost that post and kept looking for it to add to wiki !

Now that's a sticky, will be easier.

Will add the BC problems which are kept unsolved in 1.1 dev to wiki later this week.

Thanks for the clear feed-backs.

_________________
Beat 8)
www.joomlapolis.com <= Community Builder + CBSubs Joomla membership payment system - team
hosting.joomlapolis.com <= Joomla! Hosting, by the CB Team


Top
  E-mail  
 
 Post subject: Re: RD Glossary
Posted: Wed Feb 22, 2006 3:46 pm 
User avatar
Joomla! Champion
Joomla! Champion
Offline

Joined: Fri Aug 12, 2005 12:47 am
Posts: 6431
Thanks Beat, wiki is looking great so far. If u need any feedback u know where to find me ;)

_________________
Johan Janssens - Joomla Co-Founder, Lead Developer of Joomla 1.5

http://www.nooku.org - multi-lingual content manager and rapid extension development framework for Joomla 1.5
http://www.joomlatools.eu - training, consulting and extension development


Top
   
 
 Post subject: Re: RD Glossary
Posted: Thu May 04, 2006 8:43 am 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Thu Aug 18, 2005 5:54 pm
Posts: 503
Location: Sliedrecht, the Netherlands
just a small remark on the first entry of this thread, as i am working on a comp myself.

Usage of mosconfig global variables :

To obtain the live-site string,  I code it as follows :

global $mainframe
$live_site= $mainframe->getCfg( 'live_site' )
echo $live_site

which works for me.
JW

_________________
Looking for J! help ? Paste your (English preferred) errormessage in the searchbar !


Top
  E-mail  
 
 Post subject: Re: RD Glossary
Posted: Mon Nov 13, 2006 4:00 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sat Jul 15, 2006 2:17 pm
Posts: 8
I have made a change in rd_glossary.html.php to repeat index at bottom of the glossary page.

Find:

Code:
// Output definitionlist
      if (count($rows)) {
         $dl = HtmlRdGlossary::buildTermList($rows, $saveItemid,$params);
         echo $dl;
      } else {
         echo _RD_GLOSSARY_NO_ITEMS;   
      }      


Add below:

Code:
// Output index
      $HtmlIndex = HtmlRdGlossary::buildIndex($index, $saveItemid, $acat);
      if ($HtmlIndex) {
         echo $HtmlIndex;
      }


PS does anyone know if
RD Glossary can be made to see terms within itself?
i.e

Act Of Parliament
    Parliamentary legislation giving legal criteria, constraints and parameters.


Amendment
    A proposed change in a draft Bill or an Act of Parliament.  Sometimes legislation amends earlier Acts.


The above text "Act of Parliament" to cross reference to the term Act Of Parliament


Regards Dave


Top
  E-mail  
 
 Post subject: Re: RD Glossary
Posted: Wed Sep 26, 2007 11:50 am 
User avatar
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Thu Aug 18, 2005 6:50 am
Posts: 294
Location: Germany - Aachen
wilded1 wrote:

PS does anyone know if
RD Glossary can be made to see terms within itself?


Yes I know that ;), atm not possible but planned for the 1.5 version.

_________________
Best regards, Robert
--
My Blog: http://www.robert-deutz.de


Top
  E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

Quick reply

 



Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group