public function execute() { $this->plugin_id = 'category'; parent::execute(); if ($data = waRequest::post($this->plugin_id)) { $order = 0; $model = new blogCategoryModel(); foreach ($data as $id => &$row) { $id = intval($id); if (!empty($row['name'])) { $row['sort'] = $order++; if ($id > 0) { if (!empty($row['delete'])) { $model->deleteById($id); } else { $model->updateById($id, $row); $row['id'] = $id; } } elseif ($id < 0) { $row['id'] = $model->insert($row); } } } unset($row); } $categories = blogCategory::getAll(); $icons = $this->getConfig()->getIcons(); if (!$categories) { $categories[0] = array('url' => '', 'name' => '', 'icon' => current($icons), 'id' => 0, 'qty' => 0, 'sort' => 0); } $this->view->assign('categories', $categories); $this->view->assign('icons', $icons); }
public function execute() { waHtmlControl::registerControl('ReplaceMap', __CLASS__ . "::controlReplaceMap"); $this->plugin_id = 'import'; parent::execute(); $this->getResponse()->addJs('plugins/import/js/settings.js?' . wa()->getVersion(), true)->addJs('js/jquery.form.js', true); $protocols = array(); $protocols['wordpress'] = array('name' => 'WordPress', 'description' => _wp('Import posts and comments from a WordPress blog')); $protocols['lj'] = array('name' => 'LiveJournal', 'description' => _wp('Import posts from a LiveJournal blog (comments are not imported)')); $this->view->assign('protocols', $protocols); }
public function execute() { waHtmlControl::registerControl('ReplaceMap', array($this, 'controlReplaceMap')); $this->plugin_id = 'import'; parent::execute(); $this->getResponse()->addJs('plugins/import/js/settings.js?' . wa()->getVersion(), true)->addJs('js/jquery.form.js', true); $protocols = array(); $protocols['wordpress'] = array('name' => _wp('WordPress'), 'description' => _wp('Import posts and comments from a WordPress blog')); $protocols['lj'] = array('name' => _wp('LiveJournal'), 'description' => _wp('Import posts from a LiveJournal blog (comments are not imported)')); $protocols['webasystSame'] = array('name' => _wp('WebAsyst Shop-Script (same server)'), 'description' => _wp('Import news from WebAsyst Shop-Script (older version of the Shop-Script app)')); $protocols['webasystRemote'] = array('name' => _wp('WebAsyst Shop-Script (remote server)'), 'description' => _wp('Import news from WebAsyst Shop-Script (older version of the Shop-Script app)')); $this->view->assign('protocols', $protocols); }