本文整理汇总了PHP中XmlParser::masterLayout方法的典型用法代码示例。如果您正苦于以下问题:PHP XmlParser::masterLayout方法的具体用法?PHP XmlParser::masterLayout怎么用?PHP XmlParser::masterLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XmlParser
的用法示例。
在下文中一共展示了XmlParser::masterLayout方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: readTemplates
//.........这里部分代码省略.........
$arg = 0;
if (substr($name, 0, 4) != "tree") {
if (isset($component["post"])) {
$this->multisubmit = $component["post"];
}
// Checking widget permissions
if ($this->checkWidgetCredentials($component["module"], $component["name"]) === false) {
continue;
}
//adds all the widgets by default to first column
if ($area_type == "content" && !$this->portalStateObj) {
if ($this->type !== self::WIZARD) {
$idx = $component["column"];
if ($idx >= $sizedata[1]) {
throw new XmlParserException("Invalid column reference!");
}
} else {
$idx = 0;
}
$this->portalConfig->content[$k]["portalColumns"][$idx][] = new stdClass();
$kx = count($this->portalConfig->content[$k]["portalColumns"][$idx]) - 1;
$this->portalConfig->content[$k]["portalColumns"][$idx][$kx]->idxml = $component["module"] . "/" . $component["name"];
}
$config_vars = afConfigUtils::getConfigVars($component['module'], $component['name'], $this->context->getRequest());
$this->vars[$component['module'] . "/" . $component['name']] = $config_vars;
$attribute_holder->add($config_vars);
$fileCU = new afConfigUtils($component['module']);
$file = $fileCU->getConfigFilePath($component["name"] . ".xml", true);
if (isset($component["params"])) {
foreach ($component["params"] as $pname => $pvalue) {
$attribute_holder->add(array($pname => $pvalue));
}
}
$this->readXmlDocument($file);
$this->iteration++;
$this->process["parses"][$this->iteration]["component"] = $name;
$this->process["parses"][$this->iteration]["component_name"] = $component["name"];
$this->process["parses"][$this->iteration]["module"] = $component["module"];
$this->process["parses"][$this->iteration]["area"] = $area_type;
$this->process["parses"][$this->iteration]["refresh"] = isset($component['refresh']) ? $component['refresh'] : false;
if (($this->getCurrentView() == "edit" || $this->getCurrentView() == "show") && $this->fetch("//i:grouping")->length == 0) {
$arg = 1;
}
$this->runParser($arg);
} else {
if ($area_type == "content" && !$this->portalStateObj) {
if ($this->type !== self::WIZARD) {
$idx = $component["column"];
if ($idx >= $sizedata[1]) {
throw new XmlParserException("Invalid column reference!");
}
} else {
$idx = 0;
}
$idxml = "tree" . $z;
$this->portalConfig->content[$k]["portalColumns"][$idx][] = new stdClass();
$kx = count($this->portalConfig->content[$k]["portalColumns"][$idx]) - 1;
$this->portalConfig->content[$k]["portalColumns"][$idx][$kx]->idxml = $idxml;
}
$this->tree = new afExtjsTree(array('title' => $component["title"]));
$this->tree_root = $this->tree->startRoot(array("title" => "Startroot"));
$this->buildTree($component["rootnode"], 1);
foreach (array_reverse($this->tree_item) as $level) {
foreach ($level as $f) {
$f->end();
}
}
$this->tree->endRoot($this->tree_root);
$this->tree->end();
$this->extobjects[$idxml] = $this->tree;
}
}
}
}
}
if ($this->type == self::PAGE) {
if (!$this->portalStateObj) {
$this->portalStateObj = afPortalStatePeer::createOrUpdateState($this->portalConfig);
}
$layoutType = $this->portalStateObj->getLayoutType();
$portalLayoutType = $this->portalStateObj->getPortalLayoutType();
$this->portalContent = $this->portalStateObj->getContent();
$this->portalColumns = $this->portalStateObj->getColumns();
ksort($this->portalColumns);
$this->portalColumnsSize = $this->portalStateObj->getColumnsSize();
$portalTools = new afExtjsTools();
if ($layoutType == afPortalStatePeer::TYPE_NORMAL) {
$portalWidgets = $this->widgets;
$portalTools->addItem(array('id' => 'gear', 'handler' => array('parameters' => 'e,target,portal', 'source' => "\r\n\t\t\t\t if(afApp.hasDesktop()){portal = portal.items.items[0].items.items[0];}\r\n\t\t\t\t \r\n\t\t\t\t\t\tvar layouts=[[100],[50,50],[25,75],[75,25],[33,33,33],[50,25,25],[25,50,25],[25,25,25,25],[40,20,20,20]]; \r\n\t\t\t\t\t\tvar menu=new Ext.menu.Menu({items:[\r\n\t\t\t\t\t\t\t{text: 'Layout Selector', handler:function(){\r\n\t\t\t\t\t\t\t\t\tportal.showLayoutSelector(target,'Layout Selector',layouts);\r\n\t\t\t\t\t\t\t\t},icon: '/images/famfamfam/application_tile_horizontal.png' \r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t{text: 'Widget Selector', handler:function(){\r\n\t\t\t\t\t\t\t\t\tportal.showWidgetSelector(target,'Widget Selector');\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t},icon: '/images/famfamfam/application_side_boxes.png'\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t{text: 'Reset to Default', handler:function(){\r\n\t\t\t\t\t\t\t\t\tnew Portals().reset(target,portal);\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t},icon: '/images/famfamfam/application_lightning.png'\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t ]});\t\t\t\t\t\t \r\n\t\t\t\t\t\tmenu.showAt(e.getXY());")));
} else {
// TODO: Thise must be changed in 1165!!
$newTabPortalWidgets = $this->filterWidgets(null, $this->portalContent, $this->widgets);
$portalWidgets = null;
$portalTools->addItem(array('id' => 'gear', 'handler' => array('parameters' => 'e,target,panel', 'source' => "\r\n\t\t\t\t if(afApp.hasDesktop()){panel = panel.items.items[0];}\r\n\t\t\t\t \r\n\t\t\t\t\t\tvar layouts=[[100],[50,50],[25,75],[75,25],[33,33,33],[50,25,25],[25,50,25],[25,25,25,25],[40,20,20,20]];\r\n\t\t\t\t\t\tvar tabpanel=panel.items.items[0];\r\n\t\t\t\t\t\tvar menu=new Ext.menu.Menu({items:[\r\n\t\t\t\t\t\t\t{text: 'Layout Selector', handler:function(){\r\n\t\t\t\t\t\t\t\t\ttabpanel.getActiveTab().items.items[0].showLayoutSelector(target,'Layout Selector for '+tabpanel.getActiveTab().title,layouts);\r\n\t\t\t\t\t\t\t\t},icon: '/images/famfamfam/application_tile_horizontal.png' \r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t{text: 'Widget Selector', handler:function(){\r\n\t\t\t\t\t\t\t\t\ttabpanel.getActiveTab().items.items[0].showWidgetSelector(target,'Widget Selector for '+tabpanel.getActiveTab().title);\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t},icon: '/images/famfamfam/application_side_boxes.png'\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t{text: 'Add New Tab', handler:function(){\r\n\t\t\t\t\t\t\t\t\tvar newTabPortalWidgets=" . json_encode($newTabPortalWidgets) . ";\r\n\t\t\t\t\t\t\t\t\tnew Portals().createNewTab(target,tabpanel,newTabPortalWidgets);\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t},icon: '/images/famfamfam/application_add.png'\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t{text: 'Remove Tab', handler:function(){\r\n\t\t\t\t\t\t\t\t\tnew Portals().removeTab(target,tabpanel);\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t},icon: '/images/famfamfam/application_delete.png'\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t{text: 'Change Title', handler:function(){\r\n\t\t\t\t\t\t\t\t\tnew Portals().changeTitle(target,tabpanel);\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t},icon: '/images/famfamfam/application_edit.png'\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t{text: 'Reset to Default', handler:function(){\r\n\t\t\t\t\t\t\t\t\tnew Portals().reset(target,tabpanel.getActiveTab().items.items[0]);\r\n\t\t\t\t\t\t\t\t},icon: '/images/famfamfam/application_lightning.png'\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t ]});\t\t\t\t\t\t \r\n\t\t\t\t\t\tmenu.showAt(e.getXY());")));
}
$this->layout = new afExtjsPortalLayout(array('id' => 'center_panel', 'tools' => $portalTools, 'idxml' => $this->portalIdXml, 'layoutType' => $layoutType, 'portalLayoutType' => $portalLayoutType, 'portalWidgets' => $portalWidgets));
self::$masterLayout = $this->layout;
}
$this->postProcess();
}