当前位置: 首页>>代码示例>>PHP>>正文


PHP Module::getModuleById方法代码示例

本文整理汇总了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();
 }
开发者ID:BackupTheBerlios,项目名称:frameorm-svn,代码行数:7,代码来源:Modulepage.class.php

示例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();
 }
开发者ID:leohdr,项目名称:OSAdmin,代码行数:21,代码来源:MenuUrl.class.php

示例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");
        }
    }
开发者ID:hongweipeng,项目名称:screen,代码行数:31,代码来源:module.php

示例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('/');
     			}
     		}*/
 }
开发者ID:sov-20-07,项目名称:billing,代码行数:28,代码来源:WorkController.php

示例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');
开发者ID:hongweipeng,项目名称:screen,代码行数:31,代码来源:module_modify.php

示例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);
 }
开发者ID:sov-20-07,项目名称:billing,代码行数:18,代码来源:OutFieldWidget.php

示例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('"', '&quot;', str_replace("'", '&rsquo;', $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++;
            }
        }
    }
开发者ID:sov-20-07,项目名称:billing,代码行数:79,代码来源:CatalogModel.php


注:本文中的Module::getModuleById方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。