aliroPathway Class Reference

Inheritance diagram for aliroPathway:

mosPathway

List of all members.

Public Member Functions

 getPathway ()
 setPathway ($data)
 addItem ($name, $givenurl='')
 reduceToOne ()
 reduceByOne ()
 getCustomPathWay ()
 appendPathWay ($html)
 makePathway ()

Static Public Member Functions

static getInstance ()

Private Member Functions

 __construct ()
 __clone ()

Private Attributes

 $_names = array()
 $_urls = array()
 $sef = null
 $custom_pathway = array()

Static Private Attributes

static $instance = __CLASS__


Detailed Description

Definition at line 44 of file aliroPathway.php.


Constructor & Destructor Documentation

aliroPathway::__construct (  )  [private]

Definition at line 51 of file aliroPathway.php.

References aliroMenuHandler::getInstance(), aliroSEF::getInstance(), and sef().

00051                                     {
00052         $this->sef = aliroSEF::getInstance();
00053         if ($home = aliroMenuHandler::getInstance()->getHome()) {
00054             $this->_names[] = $home->name;
00055             $this->_urls[] = $this->sef->sefRelToAbs($home->link);
00056         }
00057     }


Member Function Documentation

aliroPathway::__clone (  )  [private]

Definition at line 59 of file aliroPathway.php.

00059                                 {
00060         // Declared to enforce singleton
00061     }

static aliroPathway::getInstance (  )  [static]

Definition at line 63 of file aliroPathway.php.

Referenced by aliroUserRequest::__construct(), aliroUserTemplateBase::__get(), aliroCache::call(), aliroFolderHandler::setFolderPathway(), and aliroMenuHandler::setPathway().

00063                                           {
00064         return is_object(self::$instance) ? self::$instance : (self::$instance = new self::$instance());
00065     }

aliroPathway::getPathway (  ) 

Definition at line 67 of file aliroPathway.php.

00067                                   {
00068         $data = new stdClass();
00069         $data->names = $this->_names;
00070         $data->urls = $this->_urls;
00071         $data->custom = $this->custom_pathway;
00072         return $data;
00073     }

aliroPathway::setPathway ( data  ) 

Definition at line 75 of file aliroPathway.php.

00075                                        {
00076         $this->_names = $data->names;
00077         $this->_urls = $data->urls;
00078         $this->_custom_pathway = $data->custom;
00079     }

aliroPathway::addItem ( name,
givenurl = '' 
)

Definition at line 81 of file aliroPathway.php.

References sef().

00081                                                   {
00082         if (!$name) return;
00083         $next = count($this->_names);
00084         $url = $this->sef->sefRelToAbs($givenurl);
00085         if ($next > 0 AND $url AND $url == $this->_urls[$next-1]) return;
00086         $this->_names[$next] = $name;
00087         $this->_urls[$next] = $url;
00088     }

aliroPathway::reduceToOne (  ) 

Definition at line 90 of file aliroPathway.php.

00090                             {
00091         for ($i = count($this->_names) - 1; $i > 0; $i--) {
00092             unset($this->_names[$i]);
00093             unset($this->_urls[$i]);
00094         }
00095     }

aliroPathway::reduceByOne (  ) 

Definition at line 97 of file aliroPathway.php.

00097                             {
00098         array_pop($this->_names);
00099         array_pop($this->_urls);
00100     }

aliroPathway::getCustomPathWay (  ) 

Definition at line 103 of file aliroPathway.php.

Referenced by makePathway().

00103                                 {
00104         return $this->custom_pathway;
00105     }

aliroPathway::appendPathWay ( html  ) 

Definition at line 107 of file aliroPathway.php.

00107                                   {
00108         $this->custom_pathway[] = $html;
00109     }

aliroPathway::makePathway (  ) 

Definition at line 111 of file aliroPathway.php.

References $mainframe, getCustomPathWay(), mosMainFrame::getInstance(), criticalInfo::getInstance(), aliroCore::getInstance(), and sef().

00111                             {
00112         $customs = $this->getCustomPathWay();
00113         $last = count($this->_names) - 1;
00114         if (0 == $last AND 0 == count($customs)) return '';
00115         $starthtml = $result = "<span class='pathway'>";
00116         $config = aliroCore::getInstance();
00117         $rootpath = criticalInfo::getInstance()->absolute_path;
00118         $mainframe = mosMainFrame::getInstance();
00119         $imgPath =  'templates/'.$mainframe->getTemplate().'/images/arrow.png';
00120         if (file_exists( "$rootpath/$imgPath" )) $img = "<img src='{$config->getCfg('live_site')}/$imgPath' border='0' alt='arrow' />";
00121         else {
00122             $imgPath = '/images/M_images/arrow.png';
00123             if (file_exists( "$rootpath/$imgPath" )) $img = "<img src='{$config->getCfg('live_site')}/images/M_images/arrow.png' alt='arrow' />";
00124             else $img = '&gt;';
00125         }
00126         foreach ($this->_names as $i=>$name) {
00127             if ($i === $last AND count($customs) == 0) $result .= "$name</span>";
00128            else {
00129                 $sefurl = $this->sef->sefRelToAbs($this->_urls[$i]);
00130                 $result .= "<a href='$sefurl' class='pathway'>$name</a>";
00131                 $result .= "&nbsp;$img&nbsp;";
00132             }
00133         }
00134         $last = count($customs) - 1;
00135         foreach ($customs as $i=>$custom) $result .= ($i == $last ? strip_tags($custom).'</span>' : $custom."&nbsp;$img&nbsp;");
00136         //return ($starthtml == $result) ? '' : $result;
00137         // This is a temporary fix for Jim Galley
00138         return ($starthtml == $result) ? '<span class="pathway">Home</span>' : $result;
00139     }


Member Data Documentation

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

Definition at line 45 of file aliroPathway.php.

aliroPathway::$_names = array() [private]

Definition at line 46 of file aliroPathway.php.

aliroPathway::$_urls = array() [private]

Definition at line 47 of file aliroPathway.php.

aliroPathway::$sef = null [private]

Definition at line 48 of file aliroPathway.php.

aliroPathway::$custom_pathway = array() [private]

Definition at line 49 of file aliroPathway.php.


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

Generated on Wed May 14 13:01:59 2008 for ALIRO by  doxygen 1.5.5