public function fetchMenuByUid($uid) { $menu = $this->fetch("uid = {$uid}"); if (empty($menu)) { $ret = MenuCommon::model()->fetchCommonAndNotUsed(); } else { $allMenus = MenuCommon::model()->fetchAllEnabledMenu(); $allIds = ConvertUtil::getSubByKey($allMenus, "id"); $menuIds = explode(",", $menu["common"]); $commonMenu = $notUsedMenu = array(); foreach ($menuIds as $id) { if (in_array($id, $allIds)) { $commonMenu[$id] = $allMenus[$id]; } } foreach ($allMenus as $id => $menuInfo) { if (!in_array($menuInfo["id"], $menuIds)) { $notUsedMenu[$id] = $menuInfo; } } $ret = array("commonMenu" => $commonMenu, "notUsedMenu" => $notUsedMenu); } return $ret; }
<?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); }
<?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); }
private function changeOpenWay() { $id = intval(EnvUtil::getRequest("id")); $type = StringUtil::filterStr(EnvUtil::getRequest("type")); if ($type == "disabled") { $openway = 1; } else { $openway = 0; } MenuCommon::model()->modify($id, array("openway" => $openway)); $this->ajaxReturn(array("openway" => $openway, "isSuccess" => true, "msg" => Ibos::lang("Operation succeed", "message"))); }
public function actionCommonMenu() { if (EnvUtil::submitCheck("commonMenu")) { $ids = EnvUtil::getRequest("mod"); MenuCommon::model()->updateAll(array("sort" => 0, "iscommon" => 0)); if (!empty($ids)) { foreach ($ids as $index => $id) { MenuCommon::model()->updateAll(array("sort" => intval($index) + 1, "iscommon" => 1), "module='{$id}'"); } } $this->ajaxReturn(array("isSuccess" => true)); } }