public function actionStatus() { $moduleStatus = EnvUtil::getRequest("type"); $module = EnvUtil::getRequest("module"); if (Ibos::app()->getRequest()->getIsAjaxRequest()) { $status = 0; if ($moduleStatus == "disabled") { $status = 1; } $changeStatus = Module::model()->modify($module, array("disabled" => $status)); Nav::model()->updateAll(array("disabled" => $status), "module = :module", array(":module" => $module)); CacheUtil::update(array("setting", "nav")); ModuleUtil::updateConfig($module); $this->ajaxReturn(array("IsSuccess" => $changeStatus), "json"); } }
public static function getTopItems() { $navs = Nav::model()->findAll(array('order' => 'weight asc')); $items = array(); foreach ($navs as $nav) { $item = array(); if (DxdUtil::startWith($nav->url, 'http://') || DxdUtil::startWith($nav->url, 'https://')) { $item['url'] = $nav->url; } else { $item['url'] = Yii::app()->createUrl($nav->url); } if ($nav->activeRule) { $item['active'] = eval($nav->activeRule); } $item['label'] = $nav->title; $items[] = $item; } return $items; }
private function runAdd($nav) { if (!isset($nav["disabled"])) { $nav["disabled"] = 1; } if (!isset($nav["targetnew"])) { $nav["targetnew"] = 0; } if (!isset($nav["type"]) || $nav["type"] == 0) { $nav["pageid"] = 0; } else { if ($nav["type"] == 1 && $nav["pageid"] == 0) { $nav["pageid"] = Page::model()->add(array("template" => "index", "content" => ""), true); } } if (isset($nav["type"]) && $nav["type"] == 1) { $nav["url"] = "main/page/index&pageid={$nav["pageid"]}&name={$nav["name"]}"; } $navid = Nav::model()->add($nav, true); return $navid; }
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer the ID of the model to be loaded */ public function loadModel($id) { $model = Nav::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
<?php Nav::model()->deleteAllByAttributes(array("module" => "workflow")); Notify::model()->deleteAllByAttributes(array("module" => "workflow")); NotifyMessage::model()->deleteAllByAttributes(array("module" => "workflow")); CacheUtil::set("notifyNode", null); Node::model()->deleteAllByAttributes(array("module" => "workflow")); NodeRelated::model()->deleteAllByAttributes(array("module" => "workflow")); AuthItem::model()->deleteAll("name LIKE 'workflow%'"); AuthItemChild::model()->deleteAll("child LIKE 'workflow%'"); MenuCommon::model()->deleteAllByAttributes(array("module" => "workflow")); $settingFields = "wfremindbefore,wfremindafter,sealfrom"; Setting::model()->deleteAll("FIND_IN_SET(skey,'{$settingFields}')"); Menu::model()->deleteAllByAttributes(array("m" => "workflow")); Nav::model()->deleteAllByAttributes(array("module" => "workflow")); Node::model()->deleteAllByAttributes(array("module" => "workflow")); NodeRelated::model()->deleteAllByAttributes(array("module" => "workflow")); AuthItem::model()->deleteAll("name LIKE 'workflow%'"); AuthItemChild::model()->deleteAll("child LIKE 'workflow%'"); $db = Ibos::app()->db->createCommand(); $prefix = $db->getConnection()->tablePrefix; $tables = $db->setText("SHOW TABLES LIKE '" . str_replace("_", "\\_", $prefix . "flow_data_%") . "'")->queryAll(false); foreach ($tables as $table) { $tableName = $table[0]; !empty($tableName) && $db->dropTable($tableName); }
public function handleNav($event) { $navs = Nav::model()->fetchAllByAllPid(); Syscache::model()->modify("nav", $navs); }
<?php $settingFields = "emailexternalmail,emailrecall,emailsystemremind,emailroleallocation,emaildefsize"; Setting::model()->deleteAll("FIND_IN_SET(skey,'{$settingFields}')"); Setting::model()->updateSettingValueByKey("emailtableids", "a:2:{i:0;i:0;i:1;i:1;}"); Setting::model()->updateSettingValueByKey("emailtable_info", "a:2:{i:0;a:1:{s:4:\"memo\";s:0:\"\";}i:1;a:2:{s:4:\"memo\";s:0:\"\";s:11:\"displayname\";s:12:\"默认归档\";}}"); Nav::model()->deleteAllByAttributes(array("module" => "email")); Menu::model()->deleteAllByAttributes(array("m" => "email")); MenuCommon::model()->deleteAllByAttributes(array("module" => "email")); Notify::model()->deleteAllByAttributes(array("node" => "email_message")); NotifyMessage::model()->deleteAllByAttributes(array("module" => "email")); CacheUtil::set("notifyNode", null); Node::model()->deleteAllByAttributes(array("module" => "email")); NodeRelated::model()->deleteAllByAttributes(array("module" => "email")); AuthItem::model()->deleteAll("name LIKE 'email%'"); AuthItemChild::model()->deleteAll("child LIKE 'email%'"); $db = Ibos::app()->db->createCommand(); $prefix = $db->getConnection()->tablePrefix; $tables = $db->setText("SHOW TABLES LIKE '" . str_replace("_", "\\_", $prefix . "email_%") . "'")->queryAll(false); foreach ($tables as $table) { $tableName = $table[0]; !empty($tableName) && $db->dropTable($tableName); }