/**
  * Render backend
  */
 public function render()
 {
     if ($this->_isAuthorized()) {
         $this->_ajax->addHtml(Zo2Html::_('admin', 'config'), '#zo2-framework');
         $this->_ajax->addExecute('zo2.admin.reInit();');
     }
     $this->_ajax->response();
 }
 /**
  * Get the html for input
  *
  * @return string
  */
 public function getInput()
 {
     if (!defined('ZO2_LOADED')) {
         return 'Please enable Zo2 Framework plugin';
     } else {
         $html = Zo2Html::_('admin', $this->element['layout']);
         $html = '<div id="zo2-framework" class="zo2-framwork">' . $html . '</div>';
         return $html;
     }
 }
 /**
  * Generate html from a column item
  * @param $item
  * @return string
  */
 private function _generateColumn($item)
 {
     /* Check is allowed to show this jdoc */
     if ($this->_checkShowColumn($item)) {
         $jdoc = $item->get('jdoc', 'modules');
         if (trim($jdoc) == '') {
             $jdoc = 'modules';
         }
         $html = '';
         $html .= '<!-- build column: ' . trim($item->get('name', 'unknown')) . ' -->' . "\n\r";
         $html .= '<!-- jdoc: ' . $jdoc . ' - position: ' . $item->get('position') . ' -->';
         $class[] = 'col-md-' . $item->get('span');
         $class[] = 'col-sm-' . $item->get('span');
         if ($item->get('offset') != 0) {
             $class[] = ' col-md-offset-' . $item->get('offset');
         }
         $class = array_merge($class, $item->getVisibilityClass());
         $customClass = explode(' ', $item->get('customClass'));
         $class = array_merge($class, $customClass);
         $class = array_unique($class);
         $gridClass = array();
         /* Find grid core class */
         foreach ($class as $key => $value) {
             if (strpos($value, 'col-xs-') !== false || strpos($value, 'col-sm-') !== false || strpos($value, 'col-md-') !== false || strpos($value, 'col-lg-') !== false) {
                 $subs = explode('-', $value);
                 if (count($subs) == 3) {
                     $gridClass[$subs[0] . '-' . $subs[1]] = $subs[2];
                 }
                 unset($class[$key]);
             }
         }
         foreach ($gridClass as $key => $value) {
             $class[] = $key . '-' . $value;
         }
         $class = array_unique($class);
         /* BEGIN COL */
         $id = JFilterOutput::stringURLSafe(strtolower(trim($item->get('name', $item->get('position')))));
         $id = str_replace('_', '-', $id);
         $html .= '<div id="zo2-' . $id . '" class="' . trim(implode(' ', $class)) . '">';
         switch ($jdoc) {
             case 'component':
                 $html .= '<jdoc:include type="component" />';
                 break;
             case 'message':
                 $html .= '<jdoc:include type="message" />';
                 break;
             case 'modules':
                 /**
                  * old code
                  * @todo position only used to define where is element render not what kind of element
                  */
                 if ($item->get('position') == 'component') {
                     $html .= '<jdoc:include type="component" />';
                 } else {
                     if ($item->get('position') == 'message') {
                         $html .= '<jdoc:include type="message" />';
                     } else {
                         $html .= '<jdoc:include type="modules" name="' . $item->get('position') . '"  style="' . $item->get('style') . '" />';
                     }
                 }
                 /**
                  * @todo need move to correct jdoc
                  */
                 $template = new Zo2Template();
                 switch ($item->get('position')) {
                     case 'footer_copyright':
                     case 'footer-copyright':
                         $html .= Zo2Html::_('copyright', 'render');
                         break;
                     case 'header_logo':
                     case 'header-logo':
                         $html .= Zo2Html::_('headerlogo', 'render');
                         break;
                     case 'mega_menu':
                     case 'mega-menu':
                         /* Display frontend megamenu */
                         $framework = Zo2Framework::getInstance();
                         $megamenu = $framework->displayMegaMenu(Zo2Framework::getInstance()->profile->menu_type);
                         $html .= $megamenu;
                         break;
                 }
                 break;
             case 'megamenu':
                 /* Display frontend megamenu */
                 $framework = Zo2Framework::getInstance();
                 $megamenu = $framework->displayMegaMenu(Zo2Framework::getInstance()->profile->menu_type);
                 $html .= $megamenu;
                 break;
             case 'canvasmenu':
                 $this->set('canvasMenu', $item);
                 $html .= '<span class="button-canvas"><i class="fa fa-2x fa-bars" data-toggle="offcanvas"></i></span>';
                 break;
             default:
                 /**
                  * 3rd addons
                  */
                 if (strpos($jdoc, 'addon-') !== false) {
                     $jdoc = str_replace('addon-', '', $jdoc);
                     $addons = Zo2Factory::getFramework()->getRegisteredAddons();
                     if (isset($addons[$jdoc])) {
                         /**
                          * Prevent evil code
                          */
                         $html .= call_user_func($addons[$jdoc]);
                     }
                 } else {
                 }
         }
         foreach ($item->get('children') as $child) {
             $html .= $this->_buildItem($child);
         }
         /* END COLUMN */
         $html .= '</div>';
         return $html;
     }
 }
 * Zo2 (http://www.zootemplate.com/zo2)
 * A powerful Joomla template framework
 *
 * @version     1.4.3
 * @since       1.4.3
 * @uses        For Joomla! 3.x
 * @link        http://www.zootemplate.com/zo2
 * @link        https://github.com/cleversoft/zo2
 * @author      ZooTemplate <http://zootemplate.com>
 * @copyright   Copyright (c) 2014 CleverSoft (http://cleversoft.co/)
 * @license     GPL v2
 */
defined('_JEXEC') or die('Restricted access');
?>
<!------------ Layout Builder -------------->
<div class="tab-pane" id="zo2-layout">
    <h2><?php 
echo JText::_('ZO2_ADMIN_LAYOUT_BUILDER');
?>
</h2>
    <div class="zo2-divider"></div>

    <?php 
echo Zo2Html::field('description', null, array('text' => JText::_('ZO2_ADMIN_DESCRIPTION_LAYOUTS'), 'subtext' => '<a href="http://docs.zootemplate.com/category/zo2/layoutbuilder">Document</a>'));
?>

    <?php 
echo Zo2Html::_('admin', 'builder');
?>
   
</div>