本文整理汇总了PHP中Shineisp_Commons_Utilities::columnSort方法的典型用法代码示例。如果您正苦于以下问题:PHP Shineisp_Commons_Utilities::columnSort方法的具体用法?PHP Shineisp_Commons_Utilities::columnSort怎么用?PHP Shineisp_Commons_Utilities::columnSort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shineisp_Commons_Utilities
的用法示例。
在下文中一共展示了Shineisp_Commons_Utilities::columnSort方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showblock
/**
* showblock
* Handle the XML Blocks
* @param unknown_type $side
*/
public function showblock($side)
{
$ns = new Zend_Session_Namespace('Admin');
$languageID = Languages::get_language_id($ns->lang);
$record = array();
$blocks = array();
// Get the main variables
$module = Zend_Controller_Front::getInstance()->getRequest()->getModuleName();
$controller = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();
$action = Zend_Controller_Front::getInstance()->getRequest()->getActionName();
$customskin = Settings::findbyParam('adminskin');
$skin = !empty($customskin) ? $customskin : "base";
// call the placeholder view helper for each side parsed
echo $this->view->placeholder($side);
// Get all the xml blocks
$xmlblocks = Shineisp_Commons_Layout::getBlocks($module, $side, $controller, $skin);
if (!empty($xmlblocks)) {
$blocks['reference'] = $xmlblocks;
}
if (!empty($blocks['reference'])) {
$blocks['reference'] = Shineisp_Commons_Utilities::columnSort($blocks['reference'], 'position');
}
if (isset($blocks['reference']['block'])) {
$this->Iterator($blocks['reference'], $side);
} elseif (isset($blocks['reference'][0])) {
foreach ($blocks['reference'] as $block) {
$this->Iterator($block, $side);
}
}
$this->view->module = $module;
$this->view->controller = $controller;
$this->view->action = $action;
}
示例2: showblock
/**
* showblock
* Handle the Cms blocks and XML Blocks
* @param unknown_type $side
*/
public function showblock($side)
{
$ns = new Zend_Session_Namespace();
$languageID = $ns->langid;
$record = array();
$blocks = array();
// Get the main variables
$module = Zend_Controller_Front::getInstance()->getRequest()->getModuleName();
$controller = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();
$action = Zend_Controller_Front::getInstance()->getRequest()->getActionName();
$customskin = Settings::findbyParam('skin');
$skin = !empty($customskin) ? $customskin : "blank";
// call the placeholder view helper for each side parsed
echo $this->view->placeholder($side);
// Get all the xml blocks
$xmlblocks = Shineisp_Commons_Layout::getBlocks($module, $side, $controller, $skin);
// HOMEPAGE BLOCKS
// If the controller called is the homepage, event detail page or a cms page ...
// #################
if ($controller == "index") {
$record = CmsPages::findbyvar('homepage', $ns->lang);
$var = Zend_Controller_Front::getInstance()->getRequest()->getParam('url');
if (!empty($var)) {
$record = CmsPages::findbyvar($var, $ns->lang);
}
} elseif ($controller == "cms") {
$var = Zend_Controller_Front::getInstance()->getRequest()->getParam('url');
$record = CmsPages::findbyvar($var, $ns->lang);
}
// Load the xml found in the recordset
if (!empty($record['blocks'])) {
// Load the xml into an array
$xmlobject = simplexml_load_string($record['blocks']);
// Get the blocks from the xml structure
if (count($xmlobject)) {
$i = 0;
foreach ($xmlobject as $block) {
$blocks['reference'][$i]['block']['name'] = (string) $block;
$blocks['reference'][$i]['side'] = (string) $block['side'];
$blocks['reference'][$i]['position'] = (string) $block['position'];
$i++;
}
}
}
// Join every block in one unique blocks structure
if (!empty($xmlblocks)) {
if (!empty($blocks['reference'])) {
$blocks['reference'] = array_merge($xmlblocks, $blocks['reference']);
} else {
$blocks['reference'] = $xmlblocks;
}
}
if (!empty($blocks['reference'])) {
$blocks['reference'] = Shineisp_Commons_Utilities::columnSort($blocks['reference'], 'position');
}
if (isset($blocks['reference']['block'])) {
$this->Iterator($blocks['reference'], $side);
} elseif (isset($blocks['reference'][0])) {
foreach ($blocks['reference'] as $block) {
$this->Iterator($block, $side);
}
}
if (Settings::findbyParam('debug')) {
echo "<div class=\"alert alert-info\"><h4>{$side} <small>({$skin})</small></h4>Path: {$module}/{$controller}/{$action}</div>";
}
$this->view->module = $module;
$this->view->controller = $controller;
$this->view->action = $action;
}