function getPositions() { $path = JPATH_SITE; $lang = JFactory::getLanguage(); $clientId = 0; $state = 1; $templates = array_keys(CANVASAdminLayout::getTemplates($clientId, $state)); $templateGroups = array(); // Add positions from templates foreach ($templates as $template) { $options = array(); $positions = CANVASAdminLayout::getTplPositions($clientId, $template); if (is_array($positions)) { foreach ($positions as $position) { $text = CANVASAdminLayout::getTranslatedModulePosition($clientId, $template, $position) . ' [' . $position . ']'; $options[] = CANVASAdminLayout::createOption($position, $text); } } $templateGroups[$template] = CANVASAdminLayout::createOptionGroup(ucfirst($template), $options); } // Add custom position to options $customGroupText = JText::_('CANVAS_LAYOUT_CUSTOM_POSITION'); $customPositions = CANVASAdminLayout::getDbPositions($clientId); $templateGroups[$customGroupText] = CANVASAdminLayout::createOptionGroup($customGroupText, $customPositions); $multiple = $this->toBoolean((string) $this->element['multiple']); $disabled = $this->toBoolean((string) $this->element['disabled']); return JHtml::_('select.groupedlist', $templateGroups, $this->name, array('list.attr' => ($multiple ? ' multiple="multiple" size="10"' : '') . ($disabled ? 'disabled="disabled"' : ''))); }
"><i class="icon-resize-full"></i></button> </div> </div> <div id="canvas-admin-layout-container" class="canvas-admin-layout-container canvas-admin-layout-preview canvas-admin-layout-mode-m"></div> </div> <!-- POPOVER POSITIONS --> <div id="canvas-admin-layout-tpl-positions" class="popover right hide"> <div class="arrow"></div> <h3 class="popover-title"><?php echo JText::_('CANVAS_LAYOUT_POPOVER_TITLE'); ?> </h3> <div class="popover-content"> <?php echo CANVASAdminLayout::getPositions(); ?> <button class="canvas-admin-layout-rmvbtn btn btn-small"><i class="icon-remove"></i> <?php echo JText::_('CANVAS_LAYOUT_EMPTY_POSITION'); ?> </button> <button class="canvas-admin-layout-defbtn btn btn-small btn-success"><i class="icon-ok-circle"></i> <?php echo JText::_('JDEFAULT'); ?> </button> <button class="canvas-admin-layout-combtn btn btn-small btn-primary"><i class="icon-align-justify"></i> <?php echo JText::_('CANVAS_JCOMPONENT'); ?> </button> </div> </div>