mosMainFrame Class Reference

List of all members.

Public Member Functions

 __call ($method, $args)
 initSession ()
 getTemplate ()
 ImageCheck ($file, $directory='/images/M_images/', $param=NULL, $param_directory='/images/M_images/', $alt=NULL, $name='image', $type=1, $align='middle')
 tryFiles ($first_choice, $second_choice=null, $third_choice=null)
 getPath ($varname, $option='')

Static Public Member Functions

static getInstance ()

Private Member Functions

 __construct ()
 __clone ()

Private Attributes

 $request = null

Static Private Attributes

static $instance = __CLASS__


Detailed Description

Definition at line 42 of file mosMainFrame.php.


Constructor & Destructor Documentation

mosMainFrame::__construct (  )  [private]

Definition at line 46 of file mosMainFrame.php.

References aliroRequest::getInstance().

00046                                     {
00047         $this->request = aliroRequest::getInstance();
00048     }


Member Function Documentation

mosMainFrame::__clone (  )  [private]

Definition at line 50 of file mosMainFrame.php.

00050                                 {
00051         // Enforces singleton
00052     }

static mosMainFrame::getInstance (  )  [static]

mosMainFrame::__call ( method,
args 
)

Definition at line 58 of file mosMainFrame.php.

00058                                             {
00059         return call_user_func_array(array($this->request, $method), $args);
00060     }

mosMainFrame::initSession (  ) 

Definition at line 62 of file mosMainFrame.php.

References aliroSessionFactory::getSession().

00062                            {
00063         $session = aliroSessionFactory::getSession();
00064         return $session;
00065     }

mosMainFrame::getTemplate (  ) 

Definition at line 67 of file mosMainFrame.php.

00067                             {
00068         return $this->request->getTemplate();
00069     }

mosMainFrame::ImageCheck ( file,
directory = '/images/M_images/',
param = NULL,
param_directory = '/images/M_images/',
alt = NULL,
name = 'image',
type = 1,
align = 'middle' 
)

Checks to see if an image exists in the current templates image directory if it does it loads this image. Otherwise the default image is loaded. Also can be used in conjunction with the menulist param to create the chosen image load the default or use no image

Definition at line 77 of file mosMainFrame.php.

References aliroCore::get().

00077                                                                                                                                                                         {
00078         $basepath = aliroCore::get('mosConfig_live_site');
00079         if ($param) $image = $basepath.$param_directory.$param;
00080         else {
00081             $endpath = '/templates/'.$this->request->getTemplate().'/images/'.$file;
00082             if (file_exists(aliroCore::get('mosConfig_absolute_path').$endpath)) $image = $basepath.$endpath;
00083             else $image = $basepath.$directory.$file;  // outputs only path to image
00084         }
00085         // outputs actual html <img> tag
00086         //if ($type) $image = '<img src="'. $image .'" alt="'. $alt .'" align="'. $align .'" name="'. $name .'" border="0" />';
00087         if ($type) $image = '<img src="'. $image .'" alt="'. $alt .'" />';
00088         return $image;
00089     }

mosMainFrame::tryFiles ( first_choice,
second_choice = null,
third_choice = null 
)

Returns the first to be found of one or more files, or null

Definition at line 95 of file mosMainFrame.php.

Referenced by getPath().

00095                                                                                {
00096         if (file_exists($first_choice)) return $first_choice;
00097         elseif ($second_choice AND file_exists($second_choice)) return $second_choice;
00098         elseif ($third_choice AND file_exists($third_choice)) return $third_choice;
00099         else return null;
00100     }

mosMainFrame::getPath ( varname,
option = '' 
)

Returns a standard path variable

Definition at line 106 of file mosMainFrame.php.

References $_REQUEST, and tryFiles().

00106                                              {
00107         $base = $this->request->absolute_path;
00108         $origoption = $option;
00109         if (!$option) $option = $this->request->getParam($_REQUEST, 'option');
00110         $name = substr($option,4);
00111         $bac_admin = "$base/administrator/components/com_admin/";
00112         $baco = "$base/administrator/components/$option/";
00113         $bacc = "$base/administrator/core/$option/";
00114         $bttc = "$base/templates/".$this->request->getTemplate()."/components/";
00115         $bco = "$base/components/$option/";
00116         $bai = "$base/administrator/includes/";
00117         $bi = "$base/includes/";
00118         switch ($varname) {
00119             case 'front': return $this->tryFiles ($bco."$name.php");
00120             case 'front_html': return $this->tryFiles ($bttc."$name.html.php", $bco."$name.html.php");
00121             case 'admin': return $this->tryFiles ($baco."admin.$name.php", $bac_admin.'admin.admin.php');
00122             case 'core': return $this->tryFiles ($bacc."admin.$name.php");
00123             case 'admin_html': return $this->tryFiles ($baco."admin.$name.html.php", $bac_admin.'admin.admin.html.php');
00124             case 'toolbar': return $this->tryFiles ($baco."toolbar.$name.php", $bacc."toolbar.$name.php");
00125             case 'toolbar_html': return $this->tryFiles ($baco."toolbar.$name.html.php", $bacc."toolbar.$name.html.php");
00126             case 'toolbar_default': return $this->tryFiles ($bai.'toolbar.html.php');
00127             case 'class': return $this->tryFiles ($bco."$name.class.php", $baco."$name.class.php", $bi."$name.php");
00128             case 'com_xml': return $this->tryFiles ($baco."$name.xml", $bco."$name.xml");
00129             case 'mod0_xml':
00130             if ($origoption) $path = $base."/modules/$option.xml";
00131             else $path = $base.'/modules/custom.xml';
00132             return $this->tryFiles ($path);
00133             case 'mod1_xml':
00134             if ($origoption) $path = $base."/administrator/modules/$option.xml";
00135             else $path = $base.'/administrator/modules/custom.xml';
00136             return $this->tryFiles ($path);
00137             case 'bot_xml': return $this->tryFiles ($base."/mambots/$option.xml");
00138             case 'menu_xml': return $this->tryFiles ($base."/administrator/components/com_menus/$option/$option.xml");
00139             case 'installer_html': return $this->tryFiles($base."/administrator/components/com_installer/$option/$option.html.php");
00140             case 'installer_class': return $this->tryFiles($base."/administrator/components/com_installer/$option/$option.class.php");
00141         }
00142     }


Member Data Documentation

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

Definition at line 43 of file mosMainFrame.php.

mosMainFrame::$request = null [private]

Definition at line 44 of file mosMainFrame.php.


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

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