本文整理汇总了PHP中Module::getModuleById方法的典型用法代码示例。如果您正苦于以下问题:PHP Module::getModuleById方法的具体用法?PHP Module::getModuleById怎么用?PHP Module::getModuleById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Module
的用法示例。
在下文中一共展示了Module::getModuleById方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editForm
public function editForm($id)
{
$module = Module::getModuleById($id);
$template = $this->getTemplate($module);
$template->action = "/modulepage/update/" . $module->id;
return $template->parse();
}
示例2: getMenuByUrl
public static function getMenuByUrl($url)
{
$url_array = array();
$condition = array("menu_url" => $url);
$db = self::__instance();
$list = $db->select(self::getTableName(), self::$columns, $condition);
if ($list) {
$menu = $list[0];
$module = Module::getModuleById($menu['module_id']);
$menu['module_id'] = $module['module_id'];
$menu['module_name'] = $module['module_name'];
$menu['module_url'] = $module['module_url'];
if ($menu['father_menu'] > 0) {
$father_menu = self::getMenuById($menu['father_menu']);
$menu['father_menu_url'] = $father_menu['menu_url'];
$menu['father_menu_name'] = $father_menu['menu_name'];
}
return $menu;
}
return array();
}
示例3: extract
<?php
require '../include/init.inc.php';
$module_id = $menu_ids = $module = '';
extract($_REQUEST, EXTR_IF_EXISTS);
Common::checkParam($module_id);
$temp = Module::getModuleById($module_id);
if (empty($temp)) {
Common::exitWithError(ErrorMessage::MODULE_NOT_EXIST, "panel/modules.php");
}
if (Common::isPost()) {
if (empty($module) || empty($menu_ids)) {
OSAdmin::alert("error", ErrorMessage::NEED_PARAM);
} else {
if ($module != 1) {
foreach ($menu_ids as $menu_id) {
if ($menu_id <= 100) {
Common::exitWithError('系统菜单不能转移到其它模块', 'panel/modules.php');
}
}
}
$menu_ids = implode(',', $menu_ids);
$update_data = array('module_id' => $module);
$result = MenuUrl::batchUpdateMenus($menu_ids, $update_data);
if ($result >= 0) {
SysLog::addLog(UserSession::getUserName(), 'MODIFY', 'MenuUrl', $menu_ids, json_encode($update_data));
Common::exitWithSuccess('更新完成', 'panel/modules.php');
} else {
OSAdmin::alert("error");
}
}
示例4: edit
function edit()
{
DB::escapePost('data');
$modul = Module::getModuleById($_POST['module']);
if ($modul['type'] == 'cat') {
$model = new Catalog();
$model->edit();
} else {
$model = new Work();
$model->edit();
}
if ($modul['type'] == 'struct') {
Fields::setFeatures();
}
//if($_POST['submitbutton']=='Применить'){
$_SESSION['HTTP_REFERER'] = $_POST['redirect'];
$this->redirect($_SERVER['HTTP_REFERER']);
/*}else{
$_SESSION['HTTP_REFERER']='';
if($_POST['redirect'] && strpos($_POST['redirect'],'tree=new')===false){
$this->redirect($_POST['redirect']);
}elseif($_POST['parent']){
$this->redirect('/work/'.$_POST['parent'].'/');
}else{
$this->redirect('/');
}
}*/
}
示例5: extract
<?php
require '../include/init.inc.php';
$module_id = $module_name = $module_sort = $module_url = $module_desc = $module_icon = $online = '';
extract($_REQUEST, EXTR_IF_EXISTS);
Common::checkParam($module_id);
$module = Module::getModuleById($module_id);
if (empty($module)) {
Common::exitWithError(ErrorMessage::MODULE_NOT_EXIST, "panel/modules.php");
}
if (Common::isPost()) {
if ($module_name == "" || $module_url == "") {
OSAdmin::alert("error", ErrorMessage::NEED_PARAM);
} else {
$update_data = array('module_name' => $module_name, 'module_desc' => $module_desc, 'module_icon' => $module_icon, 'module_url' => $module_url, 'module_sort' => $module_sort);
if ($module_id > 1) {
$update_data['online'] = $online;
}
$result = Module::updateModuleInfo($module_id, $update_data);
if ($result >= 0) {
SysLog::addLog(UserSession::getUserName(), 'MODIFY', 'Module', $module_id, json_encode($update_data));
Common::exitWithSuccess('更新完成', 'panel/modules.php');
} else {
OSAdmin::alert("error");
}
}
}
$module_online_optioins = array("1" => "在线", "0" => "下线");
Template::assign('module', $module);
Template::assign('module_online_optioins', $module_online_optioins);
Template::display('panel/module_modify.tpl');
示例6: getRadio
function getRadio($row)
{
$value = OutFieldWidget::getValue($row['path']);
$row['value'] = $value['value_int'];
$row['id'] = $value['id'];
if ($row['id'] == '') {
$row['id'] = 0;
}
$module = Module::getModuleById($row['module']);
if ($module['type'] == 'cat' && in_array($row['path'], OneSSA::$catalogStandart)) {
$row['tab'] = $module['path'];
$row['field'] = $row['path'];
} else {
$row['tab'] = 'data';
$row['field'] = 'value_int';
}
return View::getWidget('outfields/radio', $row);
}
示例7: edit
public function edit()
{
$fields = array();
$sql = '
DELETE FROM {{multival}}
WHERE data IN (SELECT id FROM {{data}} WHERE tree=' . $_POST['tree'] . ')
';
DB::exec($sql);
$sql = '
DELETE FROM {{relations}}
WHERE modul1=\'data\'
AND id1 IN (SELECT id FROM {{data}} WHERE tree=' . $_POST['tree'] . ' AND type<>\'gallery\')
';
DB::exec($sql);
$sql = '
DELETE FROM {{data}}
WHERE tree=' . $_POST['tree'] . '
AND type<>\'gallery\'
';
DB::exec($sql);
$module = Module::getModuleById($_POST['module']);
Tree::editTree($_POST['tree']);
if (isset($_POST['data']['price'])) {
$fields['price'] = $_POST['data']['price'] == '' ? 0 : $_POST['data']['price'];
}
if (isset($_POST['data']['subprice'])) {
$fields['subprice'] = $_POST['data']['subprice'] == '' ? 0 : $_POST['data']['subprice'];
}
if (isset($_POST['data']['vendor'])) {
$fields['vendor'] = $_POST['data']['vendor'] == '' ? 0 : $_POST['data']['vendor'];
}
if (isset($_POST['data']['available'])) {
$fields['available'] = $_POST['data']['available'] == '' ? 0 : $_POST['data']['available'];
}
if (isset($_POST['data']['bid'])) {
$fields['bid'] = $_POST['data']['bid'] == '' ? 0 : $_POST['data']['bid'];
}
if (isset($_POST['data']['cbid'])) {
$fields['cbid'] = $_POST['data']['cbid'] == '' ? 0 : $_POST['data']['cbid'];
}
if (isset($_POST['data']['manufacturer_warranty'])) {
$fields['manufacturer_warranty'] = $_POST['data']['manufacturer_warranty'] == '' ? 0 : $_POST['data']['manufacturer_warranty'];
}
foreach (OneSSA::$catalogStandart as $item) {
if (array_key_exists($item, $fields) === false) {
$fields[$item] = trim($_POST['data'][$item]);
}
}
$sql = '
UPDATE {{catalog}}
SET
';
foreach ($fields as $key => $item) {
if (strpos($item, '<') === false || strpos($item, '>') === false) {
$item = str_replace('"', '"', str_replace("'", '’', $item));
}
$sql .= $key . '=\'' . $item . '\',';
}
$sql = substr($sql, 0, strlen($sql) - 1);
$sql .= '
WHERE tree=' . $_POST['tree'] . '
';
$dataId = DB::exec($sql);
$i = 0;
//print_r($_POST);
foreach ($_POST['data'] as $key => $item) {
if (!in_array($key, OneSSA::$catalogStandart)) {
Fields::Insert($_POST['tree'], $_POST['module'], $key, $item, $_POST['fieldtypes'][$i], $i);
}
$i++;
}
$i = 0;
if (!empty($_POST['features'])) {
foreach ($_POST['features'] as $key => $item) {
Fields::insertFeatures($_POST['tree'], $_POST['featuresid'][$i], $key, $_POST['featurestype'][$i], $item, $i);
$i++;
}
}
}