aliroSelectors Class Reference

List of all members.

Public Member Functions

 menuParent ($thismenu)
 menuLinks ($lookup, $all=NULL, $none=NULL)

Static Public Member Functions

static getInstance ()

Static Private Attributes

static $instance = __CLASS__


Detailed Description

Definition at line 3 of file aliroSelectors.php.


Member Function Documentation

static aliroSelectors::getInstance (  )  [static]

Definition at line 6 of file aliroSelectors.php.

00006                                           {
00007         return is_object(self::$instance) ? self::$instance : (self::$instance = new self::$instance());
00008     }

aliroSelectors::menuParent ( thismenu  ) 

build the select list for menu parent item

Definition at line 13 of file aliroSelectors.php.

References aliroMenuHandler::getInstance(), aliroHTML::getInstance(), menutype(), and T_().

00013                                            {
00014         $alirohtml = aliroHTML::getInstance();
00015         $mitems[] = $alirohtml->makeOption ('0', T_('Top'));
00016         $handler = aliroMenuHandler::getInstance();
00017         $menus = $handler->getByParentOrder($thismenu->menutype);
00018         foreach ($menus as $menu) {
00019             if ($menu->id == $thismenu->id) continue;
00020             $text = $menu->name;
00021             if ($menu->level) $text = '- '.$text;
00022             for ($i=0; $i<$menu->level; $i++) $text = '&nbsp;&nbsp;'.$text;
00023             $mitems[] = $alirohtml->makeOption($menu->id, $text);
00024         }
00025         return $alirohtml->selectList($mitems, 'parent', 'class="inputbox" size="1"', 'value', 'text', $thismenu->parent);
00026     }

aliroSelectors::menuLinks ( lookup,
all = NULL,
none = NULL 
)

build the multiple select list for Menu Links/Pages

Definition at line 31 of file aliroSelectors.php.

References aliroMenuHandler::getInstance(), aliroHTML::getInstance(), and T_().

00031                                                                {
00032         $alirohtml = aliroHTML::getInstance();
00033         if ( $all ) {
00034             // prepare an array with 'all' as the first item
00035             $mitems[] = $alirohtml->makeOption("0", T_('All'));
00036             // adds space, in select box which is not saved
00037             $mitems[] = $alirohtml->makeOption("-999", '----');
00038         }
00039         if ( $none ) {
00040             // prepare an array with 'none' as the first item
00041             $mitems[] = $alirohtml->makeOption("-999", T_('None'), (0 == count($lookup)));
00042             // adds space, in select box which is not saved
00043             $mitems[] = $alirohtml->makeOption( "-999", '----' );
00044         }
00045         $handler = aliroMenuHandler::getInstance();
00046         $types = $handler->getMenutypes();
00047         foreach ($types as $type) {
00048             $prefix = $type.' | ';
00049             $menus = $handler->getByParentOrder($type);
00050             foreach ($menus as $menu) {
00051                 $text = $menu->name;
00052                 if ($menu->level) $text = '- '.$text;
00053                 for ($i=0; $i<$menu->level; $i++) $text = '&nbsp;&nbsp;'.$text;
00054                 $mitems[] = $alirohtml->makeOption($menu->id, $prefix.$text);
00055             }
00056         // adds space, in select box which is not saved
00057         $mitems[] = $alirohtml->makeOption( "-999", '----' );
00058         }
00059         return $alirohtml->selectList( $mitems, 'selections[]', 'class="inputbox" size="26" multiple="multiple"', 'value', 'text', $lookup );
00060     }


Member Data Documentation

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

Definition at line 4 of file aliroSelectors.php.


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

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