コード例 #1
0
ファイル: megamenu.php プロジェクト: k2jysy/mergeshop
 /**
  * render list of  widgets for column.
  *
  * @access protected
  * @param stdClass $col
  * @return String $output
  */
 protected function renderWidgetsInCol($col)
 {
     if (is_object($col) && isset($col->widgets)) {
         $widgets = $col->widgets;
         $widgets = explode('|wid-', '|' . $widgets);
         if (!empty($widgets)) {
             $dwidgets = WPO_Megamenu_Widget::getInstance()->loadWidgets();
             $shortcode = WPO_Shortcodes::getInstance();
             unset($widgets[0]);
             $output = '';
             foreach ($widgets as $wid) {
                 $o = $dwidgets->getWidgetById($wid);
                 if ($o) {
                     $content = !is_admin() ? $shortcode->renderContent($o->type, $o->params) : "";
                     $output .= '<div id="wid-' . $wid . '" class="wpo-widget">' . $content . '</div>';
                 }
             }
             return $output;
         }
     }
 }
コード例 #2
0
ファイル: shortcodebase.php プロジェクト: k2jysy/mergeshop
 private function setValueInput($id = 0)
 {
     $name = '';
     if ($id == 0) {
         for ($i = 0; $i < count($this->options); $i++) {
             if (!isset($this->options[$i]['default'])) {
                 $this->options[$i]['default'] = '';
             }
         }
     } else {
         $obj = WPO_Megamenu_Widget::getInstance();
         $values = $obj->getWidgetById($id);
         if (is_array($values->params)) {
             foreach ($values->params as $key => $value) {
                 for ($i = 0; $i < count($this->options); $i++) {
                     if ($this->options[$i]['id'] == $key) {
                         if (is_array($value)) {
                             $value = implode(',', $value);
                         }
                         $this->options[$i]['default'] = $value;
                         break;
                     }
                 }
             }
         }
         $name = $values->name;
     }
     return $name;
 }
コード例 #3
0
 public function ajax_shortcode_delete()
 {
     if (isset($_POST['id']) && $_POST['id'] != '') {
         $obj = WPO_Megamenu_Widget::getInstance();
         $obj->delete($_POST['id']);
         echo $_POST['id'];
     } else {
         echo false;
     }
     exit;
 }
コード例 #4
0
ファイル: admin.php プロジェクト: shubham79/Jhintaak
 public function megaMenuVerticalPage()
 {
     $wpos = WPO_Shortcodes::getInstance();
     $widgets = WPO_Megamenu_Widget::getInstance()->getWidgets();
     require WPO_FRAMEWORK_ADMIN_TEMPLATE_PATH . 'megamenu/editor-vertical.php';
 }