aliroAdminToolbar Class Reference

Inheritance diagram for aliroAdminToolbar:

aliroFriendlyBase

List of all members.

Public Member Functions

 show ()
 imageCheck ($file, $directory, $param=NULL, $param_directory=NULL, $alt=NULL, $name=NULL, $type=1, $align='middle')
 addToToolBar ($task, $alt, $name, $imagename, $extended=false, $listprompt='')
 custom ($task='', $icon='', $iconOver='', $alt='', $listSelect=true, $prefix='')
 customX ($task='', $icon='', $iconOver='', $alt='', $listSelect=true)
 addNew ($task='new', $alt=null)
 addNewX ($task='new', $alt=null)
 publish ($task='publish', $alt=null)
 publishList ($task='publish', $alt=null)
 makeDefault ($task='default', $alt=null)
 assign ($task='assign', $alt=null)
 unpublish ($task='unpublish', $alt=null)
 unpublishList ($task='unpublish', $alt=null)
 archiveList ($task='archive', $alt=null)
 unarchiveList ($task='unarchive', $alt=null)
 editList ($task='edit', $alt=null)
 editListX ($task='edit', $alt=null)
 editHtml ($task='edit_source', $alt=null)
 editHtmlX ($task='edit_source', $alt=null)
 editCss ($task='edit_css', $alt=null)
 editCssX ($task='edit_css', $alt=null)
 deleteList ($msg='', $task='remove', $alt=null)
 deleteListX ($msg='', $task='remove', $alt=null)
 trash ($task='remove', $alt=null)
 preview ($popup='', $updateEditors=false)
 help ($ref, $com=false)
 apply ($task='apply', $alt=null)
 save ($task='save', $alt=null)
 savenew ()
 saveedit ()
 cancel ($task='cancel', $alt=null)
 back ($alt=null, $href='')
 divider ()
 mediaManager ($directory= '', $alt=null)
 endTable ()

Static Public Member Functions

static getInstance ()

Protected Member Functions

 __construct ()

Private Member Functions

 __clone ()

Private Attributes

 $template = null

Static Private Attributes

static $instance = __CLASS__


Detailed Description

Aliro

Definition at line 6 of file aliroAdminToolbar.php.


Constructor & Destructor Documentation

aliroAdminToolbar::__construct (  )  [protected]

Definition at line 12 of file aliroAdminToolbar.php.

00012                                      {
00013         $this->template = $this->getTemplateObject();
00014     }


Member Function Documentation

aliroAdminToolbar::__clone (  )  [private]

Definition at line 16 of file aliroAdminToolbar.php.

00016                                 {
00017         // Enforce singleton
00018     }

static aliroAdminToolbar::getInstance (  )  [static]

Definition at line 20 of file aliroAdminToolbar.php.

Referenced by mosMenuBar::addToToolBar(), JToolBar::appendButton(), mosMenuBar::back(), mosMenuBar::custom(), mosMenuBar::divider(), mosMenuBar::help(), mosMenuBar::media_manager(), and aliroComponentAdminControllers::toolbar().

00020                                           {
00021         return is_object(self::$instance) ? self::$instance : (self::$instance = new self::$instance());
00022     }

aliroAdminToolbar::show (  ) 

Definition at line 24 of file aliroAdminToolbar.php.

References mosMainFrame::getInstance(), and version::getInstance().

00024                      {
00025         $version = version::getInstance();
00026         $aliroVersion = $version->RELEASE.'/'.$version->DEV_STATUS.'/'.$version->DEV_LEVEL;
00027         if ($component = $this->getComponentObject()) {
00028             if ($class = $component->adminclass) {
00029                 $controller = new $class($component, "Aliro", $aliroVersion);
00030                 $controller->toolbar();
00031             }
00032             else {
00033                 if ($path = mosMainFrame::getInstance()->getPath( 'toolbar', $this->getOption() ) AND file_exists($path)) {
00034                     $this->invokeRetroCode($path);
00035                 }
00036             }
00037         }
00038     }

aliroAdminToolbar::imageCheck ( file,
directory,
param = NULL,
param_directory = NULL,
alt = NULL,
name = NULL,
type = 1,
align = 'middle' 
)

Definition at line 40 of file aliroAdminToolbar.php.

References align, aliroFriendlyBase::getCfg(), and name.

Referenced by addToToolBar(), back(), custom(), divider(), and help().

00040                                                                                                                                           {
00041         if (is_null($param_directory)) $param_directory = $this->admin_dir.'/images/';
00042         if ($param) $image = $this->getCfg('live_site').$param_directory.$param;
00043         else {
00044             $morepath = '/templates/'.$this->getTemplate().'/images/'.$file;
00045             $image = file_exists($this->admin_absolute_path.$morepath) ? $this->getCfg('admin_site').$morepath : $this->getCfg('live_site').$directory.$file;
00046         }
00047         if ($type) $image = <<<IMAGE
00048         <img src="$image" align="$align" alt="$alt" name="$name" border="0" />
00049 IMAGE;
00050 
00051         return $image;
00052     }

aliroAdminToolbar::addToToolBar ( task,
alt,
name,
imagename,
extended = false,
listprompt = '' 
)

Definition at line 54 of file aliroAdminToolbar.php.

References imageCheck(), and NULL.

Referenced by addNew(), addNewX(), apply(), archiveList(), assign(), cancel(), deleteList(), deleteListX(), editCss(), editCssX(), editHtml(), editHtmlX(), editList(), editListX(), makeDefault(), publish(), publishList(), save(), saveedit(), savenew(), trash(), unarchiveList(), unpublish(), and unpublishList().

00054                                                                                                    {
00055         if (!$alt) $alt = $name;
00056         $image = $this->imageCheck ( $imagename.'.png', $this->admin_dir.'/images/', NULL, NULL, $alt, $task );
00057         $image2 = $this->imageCheck ( $imagename.'_f2.png', $this->admin_dir.'/images/', NULL, NULL, $alt, $task, 0 );
00058         $href = 'javascript:'.$this->template->makeJavaScript ($task, $extended, $listprompt);
00059         $this->template->toolBarItemHTML($task, $alt, $href, $image, $image2);
00060     }

aliroAdminToolbar::custom ( task = '',
icon = '',
iconOver = '',
alt = '',
listSelect = true,
prefix = '' 
)

Definition at line 62 of file aliroAdminToolbar.php.

References aliroFriendlyBase::getCfg(), imageCheck(), NULL, and T_().

Referenced by customX().

00062                                                                                                      {
00063         // if ($prefix) trigger_error(T_('Aliro does not support the prefix parameter for toolbar entries'));
00064         if ($listSelect) {
00065             $message = sprintf(T_('Please make a selection from the list to %s'),$alt);
00066             $href = <<<TOOL_SCRIPT
00067         javascript:if (document.adminForm.boxchecked.value == 0)
00068         { alert('$message'); }
00069         else{{$prefix}submitbutton('$task')}
00070 TOOL_SCRIPT;
00071             /*
00072             $href = <<<TOOL_HREF
00073 javascript:selectAlert('$message','$task')
00074 TOOL_HREF;
00075         */
00076         }
00077         else $href = "javascript:{$prefix}submitbutton('$task')";
00078         $icon = $this->imageCheck ($icon, '', $icon, NULL, $alt, $task);
00079         $this->template->toolBarItemHTML ($task, $alt, $href, $icon, $this->getCfg('admin_site').'/images/'.$iconOver);
00080     }

aliroAdminToolbar::customX ( task = '',
icon = '',
iconOver = '',
alt = '',
listSelect = true 
)

Definition at line 82 of file aliroAdminToolbar.php.

References custom().

00082                                                                                            {
00083         $this->custom ($task, $icon, $iconOver, $alt, $listSelect, 'hideMainMenu();');
00084     }

aliroAdminToolbar::addNew ( task = 'new',
alt = null 
)

Definition at line 86 of file aliroAdminToolbar.php.

References addToToolBar(), and T_().

00086                                                      {
00087         $this->addToToolBar ($task, $alt, T_('New'), 'new');
00088     }

aliroAdminToolbar::addNewX ( task = 'new',
alt = null 
)

Definition at line 90 of file aliroAdminToolbar.php.

References addToToolBar(), and T_().

00090                                                       {
00091         $this->addToToolBar ($task, $alt, T_('New'), 'new', true);
00092     }

aliroAdminToolbar::publish ( task = 'publish',
alt = null 
)

Definition at line 94 of file aliroAdminToolbar.php.

References addToToolBar(), and T_().

00094                                                           {
00095         $this->addToToolBar ($task, $alt, T_('Publish'), 'publish');
00096     }

aliroAdminToolbar::publishList ( task = 'publish',
alt = null 
)

Definition at line 98 of file aliroAdminToolbar.php.

References addToToolBar(), and T_().

00098                                                               {
00099         $listprompt = T_('Please make a selection from the list to publish');
00100         $this->addToToolBar ($task, $alt, T_('Publish'), 'publish', false, $listprompt);
00101     }

aliroAdminToolbar::makeDefault ( task = 'default',
alt = null 
)

Definition at line 103 of file aliroAdminToolbar.php.

References addToToolBar(), and T_().

00103                                                               {
00104         $listprompt = T_('Please select an item to make default');
00105         $this->addToToolBar ($task, $alt, T_('Default'), 'publish', false, $listprompt);
00106     }

aliroAdminToolbar::assign ( task = 'assign',
alt = null 
)

Definition at line 108 of file aliroAdminToolbar.php.

References addToToolBar(), and T_().

00108                                                         {
00109         $listprompt = T_('Please select an item to assign');
00110         $this->addToToolBar ($task, $alt, T_('Assign'), 'publish', false, $listprompt);
00111     }

aliroAdminToolbar::unpublish ( task = 'unpublish',
alt = null 
)

Definition at line 113 of file aliroAdminToolbar.php.

References addToToolBar(), and T_().

00113                                                               {
00114         $this->addToToolBar ($task, $alt, T_('Unpublish'), 'unpublish');
00115     }

aliroAdminToolbar::unpublishList ( task = 'unpublish',
alt = null 
)

Definition at line 117 of file aliroAdminToolbar.php.

References addToToolBar(), and T_().

00117                                                                   {
00118         $listprompt = T_('Please make a selection from the list to unpublish');
00119         $this->addToToolBar ($task, $alt, T_('Unpublish'), 'unpublish', false, $listprompt);
00120     }

aliroAdminToolbar::archiveList ( task = 'archive',
alt = null 
)

Definition at line 122 of file aliroAdminToolbar.php.

References addToToolBar(), and T_().

00122                                                        {
00123         $listprompt = T_('Please make a selection from the list to archive');
00124         $this->addToToolBar ($task, $alt, T_('Archive'), 'archive', false, $listprompt);
00125     }

aliroAdminToolbar::unarchiveList ( task = 'unarchive',
alt = null 
)

Definition at line 127 of file aliroAdminToolbar.php.

References addToToolBar(), and T_().

00127                                                                   {
00128         $listprompt = T_('Please select a news story to unarchive');
00129         $this->addToToolBar ($task, $alt, T_('Unarchive'), 'unarchive', false, $listprompt);
00130     }

aliroAdminToolbar::editList ( task = 'edit',
alt = null 
)

Definition at line 132 of file aliroAdminToolbar.php.

References addToToolBar(), and T_().

00132                                                         {
00133         $listprompt = T_('Please select an item from the list to edit');
00134         $this->addToToolBar ($task, $alt, T_('Edit'), 'edit', false, $listprompt);
00135     }

aliroAdminToolbar::editListX ( task = 'edit',
alt = null 
)

Definition at line 137 of file aliroAdminToolbar.php.

References addToToolBar(), and T_().

00137                                                          {
00138         $listprompt = T_('Please select an item from the list to edit');
00139         $this->addToToolBar ($task, $alt, T_('Edit'), 'edit', true, $listprompt);
00140     }

aliroAdminToolbar::editHtml ( task = 'edit_source',
alt = null 
)

Definition at line 142 of file aliroAdminToolbar.php.

References addToToolBar(), and T_().

00142                                                                {
00143         $listprompt = T_('Please select an item from the list to edit');
00144         $this->addToToolBar ($task, $alt, T_('Edit HTML'), 'html', false, $listprompt);
00145     }

aliroAdminToolbar::editHtmlX ( task = 'edit_source',
alt = null 
)

Definition at line 147 of file aliroAdminToolbar.php.

References addToToolBar(), and T_().

00147                                                                 {
00148         $listprompt = T_('Please select an item from the list to edit');
00149         $this->addToToolBar ($task, $alt, T_('Edit HTML'), 'html', true, $listprompt);
00150     }

aliroAdminToolbar::editCss ( task = 'edit_css',
alt = null 
)

Definition at line 152 of file aliroAdminToolbar.php.

References addToToolBar(), and T_().

00152                                                            {
00153         $listprompt = T_('Please select an item from the list to edit');
00154         $this->addToToolBar ($task, $alt, T_('Edit CSS'), 'css', false, $listprompt);
00155     }

aliroAdminToolbar::editCssX ( task = 'edit_css',
alt = null 
)

Definition at line 157 of file aliroAdminToolbar.php.

References addToToolBar(), and T_().

00157                                                             {
00158         $listprompt = T_('Please select an item from the list to edit');
00159         $this->addToToolBar ($task, $alt, T_('Edit CSS'), 'css', true, $listprompt);
00160     }

aliroAdminToolbar::deleteList ( msg = '',
task = 'remove',
alt = null 
)

Definition at line 162 of file aliroAdminToolbar.php.

References addToToolBar(), and T_().

00162                                                                      {
00163         $listprompt = T_('Please make a selection from the list to delete');
00164         $this->addToToolBar ($task, $alt, T_('Delete'), 'delete', false, $listprompt);
00165     }

aliroAdminToolbar::deleteListX ( msg = '',
task = 'remove',
alt = null 
)

Definition at line 167 of file aliroAdminToolbar.php.

References addToToolBar(), and T_().

00167                                                                       {
00168         $listprompt = T_('Please make a selection from the list to delete');
00169         $this->addToToolBar ($task, $alt, T_('Delete'), 'delete', true, $listprompt);
00170     }

aliroAdminToolbar::trash ( task = 'remove',
alt = null 
)

Definition at line 172 of file aliroAdminToolbar.php.

References addToToolBar(), and T_().

00172                                                        {
00173         $this->addToToolBar ($task, $alt, T_('Trash'), 'delete');
00174     }

aliroAdminToolbar::preview ( popup = '',
updateEditors = false 
)

Definition at line 178 of file aliroAdminToolbar.php.

00178                                                                {
00179     }

aliroAdminToolbar::help ( ref,
com = false 
)

Definition at line 181 of file aliroAdminToolbar.php.

References aliroFriendlyBase::getCfg(), imageCheck(), NULL, and T_().

00181                                              {
00182         $image = $this->imageCheck ( 'help.png', $this->admin_dir.'/images/', NULL, NULL, T_('Help'), 'help' );
00183         $image2 = $this->imageCheck ( 'help_f2.png', $this->admin_dir.'/images/', NULL, NULL, T_('Help'), 'help', 0 );
00184         $url = $this->getCfg('live_site').'/help/';
00185         $option = $this->getOption();
00186         if ($com) $url = $this->getCfg('admin_site').'/components/'.$option.'/help/';
00187         $url .= substr($option, 4).'.'.$ref . '.html';
00188         $this->template->toolBarItemHTML ('help', T_('Help'), $url, $image, $image2, false);
00189     }

aliroAdminToolbar::apply ( task = 'apply',
alt = null 
)

Definition at line 191 of file aliroAdminToolbar.php.

References addToToolBar(), and T_().

00191                                                       {
00192         $this->addToToolBar ($task, $alt, T_('Apply'), 'apply');
00193     }

aliroAdminToolbar::save ( task = 'save',
alt = null 
)

Definition at line 195 of file aliroAdminToolbar.php.

References addToToolBar(), and T_().

00195                                                     {
00196         $this->addToToolBar ($task, $alt, T_('Save'), 'save');
00197     }

aliroAdminToolbar::savenew (  ) 

Writes a save button for a given option (NOTE this is being deprecated)

Definition at line 202 of file aliroAdminToolbar.php.

References addToToolBar(), and T_().

00202                               {
00203         $this->addToToolBar ('savenew', null, T_('Save'), 'save');
00204     }

aliroAdminToolbar::saveedit (  ) 

Writes a save button for a given option (NOTE this is being deprecated)

Definition at line 209 of file aliroAdminToolbar.php.

References addToToolBar(), and T_().

00209                                {
00210         $this->addToToolBar ('saveedit', null, T_('Save'), 'save');
00211     }

aliroAdminToolbar::cancel ( task = 'cancel',
alt = null 
)

Definition at line 213 of file aliroAdminToolbar.php.

References addToToolBar(), and T_().

00213                                                         {
00214         $this->addToToolBar ($task, $alt, T_('Cancel'), 'cancel');
00215     }

aliroAdminToolbar::back ( alt = null,
href = '' 
)

Writes a cancel button that will go back to the previous page without doing any other operation

Definition at line 222 of file aliroAdminToolbar.php.

References imageCheck(), NULL, and T_().

00222                                                 {
00223         if (is_null($alt)) $alt = T_('Back');
00224         $image = $this->imageCheck ( 'back.png', $this->admin_dir.'/images/', NULL, NULL, 'back', 'cancel' );
00225         $image2 = $this->imageCheck ( 'back_f2.png', $this->admin_dir.'/images/', NULL, NULL, 'back', 'cancel', 0 );
00226         if ($href OR $this->getStickyAliroParam($_POST, 'alironoscript')) $link = $href;
00227         else $link = 'javascript:window.history.back();';
00228         if ($link) $this->template->toolBarItemHTML ('back', $alt, $link, $image, $image2, (strpos($href, 'javascript:') === false));
00229     }

aliroAdminToolbar::divider (  ) 

Write a divider between menu buttons

Definition at line 234 of file aliroAdminToolbar.php.

References imageCheck().

00234                               {
00235         $image = $this->imageCheck ('menu_divider.png', $this->admin_dir.'/images/');
00236         $this->template->divider($image);
00237     }

aliroAdminToolbar::mediaManager ( directory = '',
alt = null 
)

Writes a media_manager button

Parameters:
string The sub-drectory to upload the media to

Definition at line 243 of file aliroAdminToolbar.php.

References aliroFriendlyBase::getCfg(), mosAdminMenus::ImageCheckAdmin(), NULL, and T_().

00243                                                                {
00244         if (is_null($alt)) $alt = T_('Upload');
00245         $image = mosAdminMenus::ImageCheckAdmin( 'upload.png', $this->admin_dir.'/images/', NULL, NULL, T_('Upload Image'), 'uploadPic' );
00246         $image2 = mosAdminMenus::ImageCheckAdmin( 'upload_f2.png', $this->admin_dir.'/images/', NULL, NULL, T_('Upload Image'), 'uploadPic', 0 );
00247         $href = $this->getCfg('admin_site').'/index.php?option=com_media';
00248         $this->template->toolBarItemHTML ('uploadPic', $alt, $href, $image, $image2, false);
00249     }

aliroAdminToolbar::endTable (  ) 

Writes the end of the menu bar table

Definition at line 254 of file aliroAdminToolbar.php.

00254                                {
00255     }


Member Data Documentation

aliroAdminToolbar::$instance = __CLASS__ [static, private]

Definition at line 8 of file aliroAdminToolbar.php.

aliroAdminToolbar::$template = null [private]

Definition at line 10 of file aliroAdminToolbar.php.


The documentation for this class was generated from the following file:

Generated on Thu Apr 17 13:03:29 2008 for ALIRO by  doxygen 1.5.5