<?php
/**
* Helper class for getting the all site related url
*
* @uses
* @copyright
* @license
* @version
* @author Rathinasamy
* @created Aug 3, 2011
*/
class Test_View_Helper_Urls extends Zend_View_Helper_Abstract{
protected $_layoutName;
protected $_skinName;
protected $_publicPath;
protected $_layoutPath;
protected $_skinPath;
protected $_skinCssPath;
protected $_skinImagesPath;
protected $_jsPath;
protected $_moduleName;
protected $_localeName;
protected $_manHost;
protected $_manRoot;
protected $_manScheme;
protected $_manPath;
protected $_manPotovolPath;
protected $_manMediaPath;
protected $_libraryPath;
protected $_toolsPath;
protected $_httpWebPath;
protected $_webRoot;
protected $_debugPath;
protected $_reportPath;
protected $_debugLogFlag;
protected $_reportLogFlag;
/**
* Initializes the member variables
*
* Created: Aug 3, 2010
*/
public function __construct(){
//-- fetch the module name from the request
$frontController = Zend_Controller_Front::getInstance();
$moduleName = $frontController->getRequest()->getModuleName();
//-- fetch the layout name from the config
$config = Zend_Registry::get('config');
$layoutName = (isset($config['system'][$moduleName]['layout']['name']) && $config['system'][$moduleName]['layout']['name'] != "") ? $config['system'][$moduleName]['layout']['name'] : false;
$skinName = (isset($config['system'][$moduleName]['layout']['skin']) && $config['system'][$moduleName]['layout']['skin'] != "") ? $config['system'][$moduleName]['layout']['skin'] : false;
$this->_layoutName = $layoutName;
$this->_skinName = $skinName;
$this->_moduleName = $moduleName;
//-- set the locale name
$locale = Zend_Registry::get('locale');
$language = $locale->getLanguage();
$region = $locale->getRegion();
$this->_localeName = $language."_".$region;
//-- set the manipulation server informations
$this->_manScheme = (isset($config['system']['imageserver']['scheme']) && $config['system']['imageserver']['scheme'] != "") ? $config['system']['imageserver']['scheme'] : false;
$this->_manHost = (isset($config['system']['imageserver']['host']) && $config['system']['imageserver']['host'] != "") ? $config['system']['imageserver']['host'] : false;
$this->_manRoot = (isset($config['system']['imageserver']['root']) && $config['system']['imageserver']['root'] != "") ? $config['system']['imageserver']['root'] : false;
$this->_webRoot = (isset($config['system']['webserver']['root']) && $config['system']['webserver']['root'] != "") ? $config['system']['webserver']['root'] : false;
$this->_debugPath = (isset($config['system']['paths']['debug']) && $config['system']['paths']['debug'] != "") ? $config['system']['paths']['debug'] : false;
$this->_reportPath = (isset($config['system']['paths']['report']) && $config['system']['paths']['report'] != "") ? $config['system']['paths']['report'] : false;
$this->_debugLogFlag= (isset($config['system']['cus']['debug']['enable']) && $config['system']['cus']['debug']['enable'] != "") ? $config['system']['cus']['debug']['enable'] : false;
$this->_reportLogFlag= (isset($config['system']['cus']['report']['enable']) && $config['system']['cus']['report']['enable'] != "") ? $config['system']['cus']['report']['enable'] : false;
}
/**
* Helper function called from the view file
*
* Created: Aug 3, 2010
*/
public function urls(){
//-- assign the layout path
$this->_publicPath = $this->view->baseUrl()."/public/";
$this->_layoutPath = $this->_publicPath."layout/{$this->_moduleName}/{$this->_layoutName}/";
$this->_skinPath = $this->layout()."{$this->_localeName}/{$this->_skinName}/";
$this->_skinCssPath = $this->skin()."css";
$this->_skinImagesPath = $this->skin()."images/";
$this->_jsPath = $this->_publicPath."js/";
$this->_manPath = $this->_manScheme.'://'.$this->_manHost."/".$this->_manRoot ."/";
$this->_manPath = $this->_manScheme.'://'.$this->_manHost."/".$this->_manRoot ."/";
$this->_manPotovolPath = $this->_manPath.'photovol/';
$this->_manMediaPath = $this->_manPotovolPath.'media/';
$this->_libraryPath = $this->view->baseUrl()."/library/";
$this->_toolsPath = $this->_libraryPath.'tools/';
$this->_httpWebPath = $this->_manScheme.'://'.$_SERVER['HTTP_HOST']."/".$this->_webRoot ."/";
return $this;
}
/**
* Returns the current layout / skin css path
*
* Created: Aug 3, 2010
*/
public function css(){
return $this->_skinCssPath;
}
/**
* Returns the current images url
* Created: Aug 3, 2010
*/
public function images(){
//return $this->skin()."/images";
return $this->_skinImagesPath;
}
/**
* Returns the java script url
*
* Created: Aug 3, 2010
*/
public function js(){
//return $this->_publicPath."/js";
return $this->_jsPath;
}
/**
* Returns the current layout url
*
* Created: Aug 3, 2010
*/
public function layout(){
//return $this->_publicPath."/layout/{$this->_moduleName}/{$this->_layoutName}";
return $this->_layoutPath;
}
/**
* Returns the current skin url
*
* Created: Aug 3, 2010
*/
public function skin(){
//return $this->layout()."/{$this->_localeName}/{$this->_skinName}";
return $this->_skinPath;
}
public function man(){
return $this->_manPath;
}
public function manPotovol(){
return $this->_manPotovolPath;
}
public function manMedia(){
return $this->_manMediaPath;
}
public function libraryPath(){
return $this->_libraryPath;
}
public function toolsPath(){
return $this->_toolsPath;
}
public function httpWebPath(){
return $this->_httpWebPath;
}
/**
* Returns the debug log path
*
* Created: Aug 3, 2010
*/
public function debugPath(){
return $this->_debugPath;
}
/**
* Returns the report log path
*
* Created: Aug 3, 2010
*/
public function reportPath() {
return $this->_reportPath;
}
/**
* Returns the debug log flag
*
* Created: Aug 3, 2010
*/
public function debugLogFlag() {
return $this->_debugLogFlag;
}
/**
* Returns the error log flag
*
* Created: Aug 3, 2010
*/
public function reportLogFlag() {
return $this->_reportLogFlag;
}
}
/**
* Helper class for getting the all site related url
*
* @uses
* @copyright
* @license
* @version
* @author Rathinasamy
* @created Aug 3, 2011
*/
class Test_View_Helper_Urls extends Zend_View_Helper_Abstract{
protected $_layoutName;
protected $_skinName;
protected $_publicPath;
protected $_layoutPath;
protected $_skinPath;
protected $_skinCssPath;
protected $_skinImagesPath;
protected $_jsPath;
protected $_moduleName;
protected $_localeName;
protected $_manHost;
protected $_manRoot;
protected $_manScheme;
protected $_manPath;
protected $_manPotovolPath;
protected $_manMediaPath;
protected $_libraryPath;
protected $_toolsPath;
protected $_httpWebPath;
protected $_webRoot;
protected $_debugPath;
protected $_reportPath;
protected $_debugLogFlag;
protected $_reportLogFlag;
/**
* Initializes the member variables
*
* Created: Aug 3, 2010
*/
public function __construct(){
//-- fetch the module name from the request
$frontController = Zend_Controller_Front::getInstance();
$moduleName = $frontController->getRequest()->getModuleName();
//-- fetch the layout name from the config
$config = Zend_Registry::get('config');
$layoutName = (isset($config['system'][$moduleName]['layout']['name']) && $config['system'][$moduleName]['layout']['name'] != "") ? $config['system'][$moduleName]['layout']['name'] : false;
$skinName = (isset($config['system'][$moduleName]['layout']['skin']) && $config['system'][$moduleName]['layout']['skin'] != "") ? $config['system'][$moduleName]['layout']['skin'] : false;
$this->_layoutName = $layoutName;
$this->_skinName = $skinName;
$this->_moduleName = $moduleName;
//-- set the locale name
$locale = Zend_Registry::get('locale');
$language = $locale->getLanguage();
$region = $locale->getRegion();
$this->_localeName = $language."_".$region;
//-- set the manipulation server informations
$this->_manScheme = (isset($config['system']['imageserver']['scheme']) && $config['system']['imageserver']['scheme'] != "") ? $config['system']['imageserver']['scheme'] : false;
$this->_manHost = (isset($config['system']['imageserver']['host']) && $config['system']['imageserver']['host'] != "") ? $config['system']['imageserver']['host'] : false;
$this->_manRoot = (isset($config['system']['imageserver']['root']) && $config['system']['imageserver']['root'] != "") ? $config['system']['imageserver']['root'] : false;
$this->_webRoot = (isset($config['system']['webserver']['root']) && $config['system']['webserver']['root'] != "") ? $config['system']['webserver']['root'] : false;
$this->_debugPath = (isset($config['system']['paths']['debug']) && $config['system']['paths']['debug'] != "") ? $config['system']['paths']['debug'] : false;
$this->_reportPath = (isset($config['system']['paths']['report']) && $config['system']['paths']['report'] != "") ? $config['system']['paths']['report'] : false;
$this->_debugLogFlag= (isset($config['system']['cus']['debug']['enable']) && $config['system']['cus']['debug']['enable'] != "") ? $config['system']['cus']['debug']['enable'] : false;
$this->_reportLogFlag= (isset($config['system']['cus']['report']['enable']) && $config['system']['cus']['report']['enable'] != "") ? $config['system']['cus']['report']['enable'] : false;
}
/**
* Helper function called from the view file
*
* Created: Aug 3, 2010
*/
public function urls(){
//-- assign the layout path
$this->_publicPath = $this->view->baseUrl()."/public/";
$this->_layoutPath = $this->_publicPath."layout/{$this->_moduleName}/{$this->_layoutName}/";
$this->_skinPath = $this->layout()."{$this->_localeName}/{$this->_skinName}/";
$this->_skinCssPath = $this->skin()."css";
$this->_skinImagesPath = $this->skin()."images/";
$this->_jsPath = $this->_publicPath."js/";
$this->_manPath = $this->_manScheme.'://'.$this->_manHost."/".$this->_manRoot ."/";
$this->_manPath = $this->_manScheme.'://'.$this->_manHost."/".$this->_manRoot ."/";
$this->_manPotovolPath = $this->_manPath.'photovol/';
$this->_manMediaPath = $this->_manPotovolPath.'media/';
$this->_libraryPath = $this->view->baseUrl()."/library/";
$this->_toolsPath = $this->_libraryPath.'tools/';
$this->_httpWebPath = $this->_manScheme.'://'.$_SERVER['HTTP_HOST']."/".$this->_webRoot ."/";
return $this;
}
/**
* Returns the current layout / skin css path
*
* Created: Aug 3, 2010
*/
public function css(){
return $this->_skinCssPath;
}
/**
* Returns the current images url
* Created: Aug 3, 2010
*/
public function images(){
//return $this->skin()."/images";
return $this->_skinImagesPath;
}
/**
* Returns the java script url
*
* Created: Aug 3, 2010
*/
public function js(){
//return $this->_publicPath."/js";
return $this->_jsPath;
}
/**
* Returns the current layout url
*
* Created: Aug 3, 2010
*/
public function layout(){
//return $this->_publicPath."/layout/{$this->_moduleName}/{$this->_layoutName}";
return $this->_layoutPath;
}
/**
* Returns the current skin url
*
* Created: Aug 3, 2010
*/
public function skin(){
//return $this->layout()."/{$this->_localeName}/{$this->_skinName}";
return $this->_skinPath;
}
public function man(){
return $this->_manPath;
}
public function manPotovol(){
return $this->_manPotovolPath;
}
public function manMedia(){
return $this->_manMediaPath;
}
public function libraryPath(){
return $this->_libraryPath;
}
public function toolsPath(){
return $this->_toolsPath;
}
public function httpWebPath(){
return $this->_httpWebPath;
}
/**
* Returns the debug log path
*
* Created: Aug 3, 2010
*/
public function debugPath(){
return $this->_debugPath;
}
/**
* Returns the report log path
*
* Created: Aug 3, 2010
*/
public function reportPath() {
return $this->_reportPath;
}
/**
* Returns the debug log flag
*
* Created: Aug 3, 2010
*/
public function debugLogFlag() {
return $this->_debugLogFlag;
}
/**
* Returns the error log flag
*
* Created: Aug 3, 2010
*/
public function reportLogFlag() {
return $this->_reportLogFlag;
}
}
No comments:
Post a Comment