• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_module函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_module函数的典型用法代码示例。如果您正苦于以下问题:PHP get_module函数的具体用法?PHP get_module怎么用?PHP get_module使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_module函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: init_module

function init_module($module)
{
    $modpath = BASEPATH . 'modules/' . $module . '/';
    if (is_dir($modpath)) {
        $modcfg = array('name' => $module, 'path' => $modpath, 'validate' => 'user', 'redirect' => 'login', 'layout' => 'main');
        if (file_exists($modpath . 'config.php')) {
            $config = (include $modpath . 'config.php');
            foreach ($config as $key => $val) {
                $modcfg[$key] = $val;
            }
        }
        $modcfg = json_decode(json_encode($modcfg));
        add_module($module, $modcfg);
        if ($modcfg->validate) {
            if (!has_session($modcfg->validate)) {
                if (is_ajax()) {
                    echo json_encode(array('success' => false, 'message' => __('Your session has been expired !'), 'redirect' => site_url($modcfg->redirect)));
                    exit;
                } else {
                    redirect($modcfg->redirect);
                }
            }
        }
    } else {
        show_404(sprintf(__('Page %s does not found!'), $module));
    }
    return get_module($module);
}
开发者ID:londomloto,项目名称:immortal,代码行数:28,代码来源:module.php


示例2: get_new_record_form

function get_new_record_form()
{
    require_once 'modules/DynamicLayout/AddField.php';
    global $image_path, $mod_strings;
    global $sugar_version, $sugar_config;
    if (!empty($_REQUEST['edit_label_MSI']) && !empty($_SESSION['dyn_layout_module'])) {
        $module_name = $_SESSION['dyn_layout_module'];
        $html = get_left_form_header($mod_strings['LBL_TOOLBOX']);
        $html .= <<<EOQ
 \t<table class="contentBox" cellpadding="0" cellspacing="0" border="0" width="100%" id="sugar_labels_MSI">Sugar Labels <br><iframe name="labeleditor"  height='400' id="labeleditor" frameborder="0"  width="280" marginwidth="0" marginheight="0" style="border: 1px solid #444444;" src="index.php?module=LabelEditor&action=LabelList&module_name={$module_name}&sugar_body_only=1" ></iframe></td></tr></table>
EOQ;
        $html .= get_left_form_footer();
        return $html;
    } else {
        if (!empty($_REQUEST['edit_subpanel_MSI']) || empty($_REQUEST['edit_row_MSI']) && empty($_REQUEST['edit_col_MSI']) && $_REQUEST['action'] != 'SelectFile' && !empty($_SESSION['dyn_layout_file'])) {
            $addfield = new AddField();
            if (isset($_SESSION['dyn_layout_file'])) {
                $the_module = get_module($_SESSION['dyn_layout_file']);
            }
            $font_slot = '<IMG src="' . $image_path . 'slot.gif" alt="Slot" border="0" >';
            $slot_path = $image_path . "slot.gif";
            $html = get_left_form_header($mod_strings['LBL_TOOLBOX']);
            $add_field_icon = get_image($image_path . "plus_inline", 'style="margin-left:4px;margin-right:4px;" alt="Add Field" border="0" align="absmiddle"');
            $minus_field_icon = get_image($image_path . "minus_inline", 'style="margin-left:4px;margin-right:4px;" alt="Add Field" border="0" align="absmiddle"');
            $edit_field_icon = get_image($image_path . "edit_inline", 'style="margin-left:4px;margin-right:4px;" alt="Add Field" border="0" align="absmiddle"');
            $delete = get_image($image_path . "delete_inline", "border='0' alt='Delete' style='margin-left:4px;margin-right:4px;'");
            $show_bin = true;
            if (isset($_REQUEST['edit_subpanel_MSI'])) {
                $show_bin = false;
            }
            $delete_items = $addfield->get_html(true, $show_bin);
            $html .= "\n\t<script>\n\tvar slot_path = '{$slot_path}';\n\tvar font_slot = '{$font_slot}';\n\t</script>\n\t<script type=\"text/javascript\" src=\"modules/DynamicLayout/DynamicLayout_3.js?s=" . $sugar_version . '&c=' . $sugar_config['js_custom_version'] . "\">\n\t</script>\n\t<p>\n";
            if (isset($_REQUEST['edit_col_MSI'])) {
                // do nothing
            } else {
                if (!isset($_REQUEST['edit_subpanel_MSI'])) {
                    $html .= "\n\t<input type='checkbox' class=\"checkbox\" style='vertical-align: middle;' id='display_html_MSI' name='display_html_MSI' > {$mod_strings['LBL_DISPLAY_HTML']} <br>\n\t<a href='#' onclick='addFieldPOPUP()' class='leftColumnModuleS3Link'>{$add_field_icon}</a> <a href='#' onclick='addFieldPOPUP()' class='leftColumnModuleS3Link'>{$mod_strings['LBL_ADD_FIELDS']}</a>\n\t<br>";
                }
                $html .= "\n\t<a href=\"#\" onclick=\"editCustomFields();\" class='leftColumnModuleS3Link'>{$edit_field_icon}</a>\n\t<a href='#' onclick=\"editCustomFields();\" class='leftColumnModuleS3Link'>{$mod_strings['LBL_EDIT_FIELDS']}</a><br>\n\t\n\t<p>{$delete_items}</p>";
            }
            $html .= get_left_form_footer();
            return $html;
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:45,代码来源:Forms.php


示例3: _update

 protected function _update()
 {
     $id = $_POST['id'];
     $model = D("Node");
     if (false === $model->create()) {
         $this->error($model->getError());
     }
     if (strpos($model->url, '##') !== false) {
         $model->sub_folder = ucfirst(get_module(str_replace("##", "", $model->url))) . "Folder";
     } else {
         $model->sub_folder = '';
     }
     // 更新数据
     $list = $model->save();
     if (false !== $list) {
         //成功提示
         $this->assign('jumpUrl', get_return_url());
         $this->success('编辑成功!');
     } else {
         //错误提示
         $this->error('编辑失败!');
     }
 }
开发者ID:hongweipeng,项目名称:oa,代码行数:23,代码来源:NodeAction.class.php


示例4: update

 function update()
 {
     $updateSuccess = new XCube_Delegate();
     $updateSuccess->register('Legacy_ModuleUpdateAction.UpdateSuccess');
     $updateFail = new XCube_Delegate();
     $updateFail->register('Legacy_ModuleUpdateAction.UpdateFail');
     $module = get_module($this->name);
     $dirname = $module->get('dirname');
     $installer = Legacy_ModuleInstallUtils::createUpdater($dirname);
     $installer->setCurrentXoopsModule($module);
     // Load the manifesto, and set it as the target object.
     $module->loadInfoAsVar($dirname);
     $module->set('name', $module->get('name'));
     $installer->setTargetXoopsModule($module);
     $installer->executeUpgrade();
     if ($installer->mLog->hasError() === false) {
         $updateSuccess->call(new XCube_Ref($module), new XCube_Ref($installer->mLog));
         XCube_DelegateUtils::call('Legacy.Admin.Event.ModuleUpdate.' . ucfirst($dirname . '.Success'), new XCube_Ref($module), new XCube_Ref($installer->mLog));
         $success = true;
     } else {
         $updateFail->call(new XCube_Ref($module), new XCube_Ref($installer->mLog));
         XCube_DelegateUtils::call('Legacy.Admin.Event.ModuleUpdate.' . ucfirst($dirname . '.Fail'), new XCube_Ref($module), new XCube_Ref($installer->mLog));
         $success = false;
     }
     /*		foreach ($installer->mLog->mMessages as $message)
     		{
     			echo sprintf('[%s] update: %s', date('Y-m-d H:i:s'), $message['message']), PHP_EOL; // TODO >> observer
     		}
     */
     return $success;
 }
开发者ID:nouphet,项目名称:xoops-watch-template,代码行数:31,代码来源:xoops-watch-template.php


示例5: unset

    } else {
        unset($_SESSION['editinplace']);
    }
    header('Location: index.php?action=index&module=Home');
}
//MAKE SURE A FILE IS SELECTED
require_once 'modules/DynamicLayout/HTMLPHPMapping.php';
if (isset($_REQUEST['edit_subpanel_MSI'])) {
    $fileType = 'subpanel';
    require_once 'modules/DynamicLayout/plugins/SubPanelParser.php';
    SubPanelParser::indexPage();
    //else if we should be editing columns (listview) lets get that done
} else {
    if (!empty($_SESSION['dyn_layout_file'])) {
        $file = $_SESSION['dyn_layout_file'];
        $the_module = get_module($file);
        $fileType = '';
        if (substr_count($file, 'EditView') > 0 || isset($html_php_mapping_edit[$file])) {
            $fileType = 'edit';
        } else {
            if (substr_count($file, 'DetailView') > 0 || isset($html_php_mapping_detail[$file])) {
                $fileType = 'detail';
            } else {
                if (substr_count($file, 'ListView') > 0 || isset($html_php_mapping_subpanel[$file])) {
                    $fileType = 'list';
                } else {
                    if (substr_count($file, 'SearchForm') > 0 || isset($html_php_mapping_searchform[$file])) {
                        $fileType = 'search';
                    } else {
                        if (isset($html_php_mapping_other[$file])) {
                            $fileType = 'other';
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:31,代码来源:index.php


示例6: dr_page_url

function dr_page_url($data, $page = NULL)
{
    if (!$data) {
        return SITE_URL;
    }
    if ($page) {
        $data['page'] = $page = is_numeric($page) ? max((int) $page, 1) : $page;
    }
    if ($data['module'] && ($module = get_module($data['module']))) {
        $path = $module['url'];
    } else {
        $path = SITE_URL;
    }
    $ci =& get_instance();
    $rule = $ci->get_cache('urlrule', (int) $data['urlrule'], 'value');
    if ($rule && $rule['page'] && $rule['page_page']) {
        // URL模式为自定义,且已经设置规则
        $data['pdirname'] .= $data['dirname'];
        $data['pdirname'] = str_replace('/', $rule['catjoin'], $data['pdirname']);
        $url = $page ? $rule['page_page'] : $rule['page'];
        // 兼容php5.5
        if (version_compare(PHP_VERSION, '5.5.0') >= 0) {
            $rep = new php5replace($data);
            $url = preg_replace_callback("#{([a-z_0-9]+)}#Ui", array($rep, 'php55_replace_data'), $url);
            $url = preg_replace_callback('#{([a-z_0-9]+)\\((.*)\\)}#Ui', array($rep, 'php55_replace_function'), $url);
            unset($rep);
        } else {
            $url = preg_replace('#{([a-z_0-9]+)}#Uei', "\$data[\\1]", $url);
            $url = preg_replace('#{([a-z_0-9]+)\\((.*)\\)}#Uie', "\\1(dr_safe_replace('\\2'))", $url);
        }
        return $path . $url;
    }
    return $path . 'index.php?c=page&id=' . $data['id'] . ($page ? '&page=' . $page : '');
}
开发者ID:Thebeautifullife,项目名称:yichunchengguan,代码行数:34,代码来源:durl_helper.php


示例7: foreach

foreach (glob($LANG_DIR . '/??.inc.php') as $file) {
    $LanCode = strtolower(substr(basename($file), 0, 2));
    $LANGS[$LanCode] = get_vars($file);
    $MENUS[$LanCode] = get_menu(strtoupper($LanCode));
}
$BACKS = $LANGS;
unset($LANGS['en']);
unset($MENUS['en']);
$HTTFlags = array('HTTFlags_SelectX' => 'HTTSelectX', 'HTTFlags_SelectM' => 'HTTSelectM', 'HTTFlags_SelectE' => 'HTTSelectE', 'HTTFlags_3Arrows' => 'HTT3Arrows', 'HTTFlags_LasVegasMode' => 'HTTLasVegasMode', 'HTTFlags_DistanceTotal' => 'HTTDistanceTotal', 'HTTFlags_Min6_A' => 'HTTMin6_A', 'HTTFlags_Min6_B' => 'HTTMin6_B', 'HTTFlags_Min6_C' => 'HTTMin6_C', 'HTTFlags_Min6_D' => 'HTTMin6_D', 'HTTFlags_TargetLetter' => 'HTTTargetLetter', 'HTTFlags_GameInfo' => 'HTTGameInfo', 'HTTFlags_ResetInfo' => 'ResetInfo', 'HTTFlags_ResetID' => 'HTTResetID');
foreach ($MODULES as $Module) {
    $lang = array();
    include $Module;
    // prepara i files vuoti per ogni lingua
    $Files = array();
    foreach (array_keys($LANGS) as $LanCode) {
        $Files[$LanCode] = get_module("{$LANG_DIR}/{$LanCode}/" . basename($Module));
    }
    // inizia il lavoro: per ogni chiave del modulo cerco la corrispondente variabile nei files di lingua
    // la inserisco nel file di lingua corrispondente
    foreach ($lang as $key => $val) {
        foreach ($LANGS as $LanCode => $vars) {
            $val2 = '';
            if (strstr($key, 'DayOfWeek_') == $key) {
                $val2 = $vars['StrDayOfWeek'][substr($key, -1)];
                //				unset($BACKS[$LanCode]['StrDayOfWeek'][substr($key,-1)]);
                //				unset($BACKS['en']['StrDayOfWeek'][substr($key,-1)]);
            } elseif (strstr($key, 'HTTFlags_') == $key) {
                $val2 = $vars['StrHTTFlags'][$HTTFlags[$key]];
                //				unset($BACKS[$LanCode]['StrHTTFlags'][$HTTFlags[$key]]);
                //				unset($BACKS['en']['StrHTTFlags'][$HTTFlags[$key]]);
            } elseif (strstr($key, 'Eliminations_') == $key) {
开发者ID:brian-nelson,项目名称:ianseo,代码行数:31,代码来源:crealingue.php


示例8: get_module

            ?>
            </ul>
        <?php 
        }
        ?>
    <?php 
    }
    ?>
    <?php 
}
?>
    <div style="clear:both"></div>

    <?php 
if ($registry['post'][0]['test'] > 0) {
    ?>
        <?php 
    get_module('vic');
    ?>
    <?php 
}
?>
 
    <div style="clear:both"></div>
    <?php 
/*?><div class="fb-comments" data-href="http://<?=$_SERVER['SERVER_NAME'];?>/<?=$registry['post'][0]['cat_chpu'];?>/<?=$registry['post'][0]['chpu'];?>/" data-width="100%" data-numposts="5" data-colorscheme="light"></div>
</div><?php */
?>
<br> 
 
开发者ID:Vatia13,项目名称:funtime,代码行数:29,代码来源:default.php


示例9: unpublish

 public function unpublish()
 {
     $path = $this->getStaticPath();
     if (file_exists($path)) {
         array_map('unlink', glob($path . "/*"));
         rmdir($path);
     }
     // Load CDN publishing class
     $config = $GLOBALS['dw_config'];
     if (!empty($config['publish'])) {
         // remove files from CDN
         $pub = get_module('publish', dirname(__FILE__) . '/../../../../');
         $id = $this->getID();
         $chart_files = array();
         $chart_files[] = "{$id}/index.html";
         $chart_files[] = "{$id}/data";
         $chart_files[] = "{$id}/{$id}.min.js";
         $pub->unpublish($chart_files);
     }
 }
开发者ID:shelsonjava,项目名称:datawrapper,代码行数:20,代码来源:Chart.php


示例10: get_module_name

function get_module_name($module_name)
{
    // New Function Name
    get_module($init_file);
}
开发者ID:blakemcdermott,项目名称:timeclock,代码行数:5,代码来源:functions.php


示例11: dr_field_options

/**
 * 模块字段的选项值(用于options参数的字段,如复选框、下拉选择框、单选按钮)
 *
 * @param	string	$name
 * @param	intval	$catid
 * @param	string	$dirname
 * @return	array
 */
function dr_field_options($name, $catid = 0, $dirname = APP_DIR)
{
    if (!$name) {
        return NULL;
    }
    $module = get_module($dirname, SITE_ID);
    if (!$module) {
        return NULL;
    }
    $field = $catid && isset($module['category'][$catid]['field'][$name]) ? $module['category'][$catid]['field'][$name] : $module['field'][$name];
    if (!$field) {
        return NULL;
    }
    $option = $field['setting']['option']['options'];
    if (!$option) {
        return NULL;
    }
    $data = explode(PHP_EOL, str_replace(array(chr(13), chr(10)), PHP_EOL, $option));
    $return = array();
    foreach ($data as $t) {
        if ($t) {
            list($i, $v) = explode('|', $t);
            $v = is_null($v) || !strlen($v) ? trim($i) : trim($v);
            $return[$v] = trim($i);
        }
    }
    return $return;
}
开发者ID:xxjuan,项目名称:php-coffee,代码行数:36,代码来源:function_helper+-+副本.php


示例12: get_banner

if (function_exists('get_banner')) {
    ?>
                <?php 
    if (get_banner('F3', 1) == true) {
        ?>
                    <?php 
        echo get_banner('F3', 1);
        ?>
                <?php 
    } else {
        ?>
                    <span>სარეკლამო ბანერი (800x100)</span>
                <?php 
    }
    ?>
            <?php 
}
?>
        </div>
    </div>
    <!-- END BANNER PLACE-->


    <?php 
get_module('loadmore');
?>
    </div>



</div>
开发者ID:Vatia13,项目名称:funtime,代码行数:31,代码来源:default.php


示例13: delete_module

            if (!empty($module)) {
                delete_module('mcp', $module);
            }
        }
        //Delete ACP Management Modules
        $acp_management_modules = array('ACP_GARAGE_BUSINESS', 'ACP_GARAGE_CATEGORIES', 'ACP_GARAGE_MODELS', 'ACP_GARAGE_PRODUCTS', 'ACP_GARAGE_QUOTAS', 'ACP_GARAGE_TOOLS', 'ACP_GARAGE_TRACK', 'ACP_GARAGE_MANAGEMENT');
        for ($i = 0, $count = sizeof($acp_management_modules); $i < $count; $i++) {
            $module = get_module('acp', $acp_management_modules[$i]);
            if (!empty($module)) {
                delete_module('acp', $module);
            }
        }
        //Delete ACP Settings Modules
        $acp_settings_modules = array('ACP_GARAGE_GENERAL_SETTINGS', 'ACP_GARAGE_MENU_SETTINGS', 'ACP_GARAGE_INDEX_SETTINGS', 'ACP_GARAGE_IMAGES_SETTINGS', 'ACP_GARAGE_QUARTERMILE_SETTINGS', 'ACP_GARAGE_DYNORUN_SETTINGS', 'ACP_GARAGE_TRACK_SETTINGS', 'ACP_GARAGE_INSURANCE_SETTINGS', 'ACP_GARAGE_BUSINESS_SETTINGS', 'ACP_GARAGE_RATING_SETTINGS', 'ACP_GARAGE_GUESTBOOK_SETTINGS', 'ACP_GARAGE_PRODUCT_SETTINGS', 'ACP_GARAGE_SERVICE_SETTINGS', 'ACP_GARAGE_BLOG_SETTINGS', 'ACP_GARAGE_SETTINGS');
        for ($i = 0, $count = sizeof($acp_settings_modules); $i < $count; $i++) {
            $module = get_module('acp', $acp_settings_modules[$i]);
            if (!empty($module)) {
                delete_module('acp', $module);
            }
        }
        $modules->remove_cache_file();
        $template->assign_vars(array('MESSAGE_TITLE' => 'MODULES DELETED', 'MESSAGE_TEXT' => 'UCP, MCP & ACP Modules Deleted'));
        break;
}
page_footer();
function create_modules($module_data)
{
    global $modules;
    for ($i = 0, $count = sizeof($module_data); $i < $count; $i++) {
        if ($module_data[$i]['module_class'] == 'acp') {
            $modules->module_class = 'acp';
开发者ID:Phatboy82,项目名称:phpbbgarage,代码行数:31,代码来源:manage_garage_modules.php


示例14: unpublish

 public function unpublish()
 {
     $path = $this->getStaticPath();
     if (file_exists($path)) {
         $dirIterator = new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS);
         $itIterator = new RecursiveIteratorIterator($dirIterator, RecursiveIteratorIterator::CHILD_FIRST);
         foreach ($itIterator as $entry) {
             $file = realpath((string) $entry);
             if (is_dir($file)) {
                 rmdir($file);
             } else {
                 unlink($file);
             }
         }
         rmdir($path);
     }
     // Load CDN publishing class
     $config = $GLOBALS['dw_config'];
     if (!empty($config['publish'])) {
         // remove files from CDN
         $pub = get_module('publish', dirname(__FILE__) . '/../../../../');
         $id = $this->getID();
         $chart_files = array();
         $chart_files[] = "{$id}/index.html";
         $chart_files[] = "{$id}/data";
         $chart_files[] = "{$id}/{$id}.min.js";
         $pub->unpublish($chart_files);
     }
     // remove all jobs related to this chart
     JobQuery::create()->filterByChart($this)->delete();
 }
开发者ID:Halfnhav4,项目名称:datawrapper,代码行数:31,代码来源:Chart.php


示例15: __

                            <a href="index.php?setlang=de"><img src="images/flags/de.png" border=0></a>&nbsp;<a
                                href="index.php?setlang=en"><img src="images/flags/gb.png" border=0></a>&nbsp;<a
                                href="index.php?setlang=ru"><img src="images/flags/ru.png" border=0></a>
                            <br><br>
                            <input type="submit" value="&nbsp;&nbsp;<?php 
    echo __('Войти');
    ?>
&nbsp;&nbsp;"/>
                        </form>
                    </div>
                </center>
                <?php 
} else {
    define("user_id", $iUsrId);
    if (get_params($sModule, 'show_to_user')) {
        if (!($sPath = get_module($sModule))) {
            echo '<br><br><br><br><center>' . __('Ошибка: модуль не подключен') . '</center><br><br><br><br>';
        } else {
            include $sPath;
        }
    } else {
        echo '<br><br><br><br><center>' . __('Ошибка: недостаточно прав') . '</center><br><br><br><br>';
    }
}
?>

        </div>
    </article>
    <footer>
        <div class="foot_logo">
            &copy; <A href="/">callservice.com.ua</A> 2009-<?php 
开发者ID:kipkaev55,项目名称:asterisk,代码行数:31,代码来源:index.php


示例16: get_module

    } else {
        ?>
        <?php 
        include 'new_slider.php';
        ?>
 <!-- ახალი სლაიდერის სტილები და ჯავასკრიპტი -->
    <?php 
    }
}
?>


<!-- end pretty Photo -->
<?php 
if ($registry['deviceType'] == 'computer' or $registry['deviceType'] == 'tablet') {
    get_module('new-articles');
}
?>
<script>
    $(document).ready(function(){
       //var uagent = '<?php 
echo $_SERVER['HTTP_USER_AGENT'];
?>
';
       var iOS = /iPad|iPhone|iPod/i.test( navigator.userAgent );
       var Android = /Android/i.test( navigator.userAgent );
        if(/Android|iPhone|iPod/i.test( navigator.userAgent )){
            var bannerNum = $('div.mobile-content a').length;
        }else{
            var bannerNum = $('div.post-content a').length;
        }
开发者ID:Vatia13,项目名称:funtime,代码行数:31,代码来源:post.php


示例17: list_tag

 public function list_tag($_params)
 {
     if (!$this->ci) {
         return NULL;
     }
     $system = array('num' => '', 'form' => '', 'page' => '', 'site' => '', 'flag' => '', 'more' => '', 'catid' => '', 'field' => '', 'order' => '', 'space' => '', 'cache' => (int) SITE_QUERY_CACHE, 'action' => '', 'return' => '', 'module' => APP_DIR, 'modelid' => '', 'keyword' => '', 'urlrule' => '', 'pagesize' => '');
     $param = $where = array();
     $params = explode(' ', $_params);
     $sysadj = array('IN', 'BEWTEEN', 'BETWEEN', 'LIKE', 'NOTIN', 'NOT', 'BW');
     foreach ($params as $t) {
         $var = substr($t, 0, strpos($t, '='));
         $val = substr($t, strpos($t, '=') + 1);
         if (!$var) {
             continue;
         }
         if (isset($system[$var])) {
             // 系统参数,只能出现一次,不能添加修饰符
             $system[$var] = $val;
         } else {
             if (preg_match('/^([A-Z_]+)(.+)/', $var, $match)) {
                 // 筛选修饰符参数
                 $_pre = explode('_', $match[1]);
                 $_adj = '';
                 foreach ($_pre as $p) {
                     if (in_array($p, $sysadj)) {
                         $_adj = $p;
                     }
                 }
                 $where[] = array('adj' => $_adj, 'name' => $match[2], 'value' => $val);
             } else {
                 $where[] = array('adj' => '', 'name' => $var, 'value' => $val);
             }
             $param[$var] = $val;
             // 用于特殊action
         }
     }
     // 替换order中的非法字符
     if (isset($system['order']) && $system['order']) {
         $system['order'] = str_ireplace(array('"', "'", ')', '(', ';', 'select', 'insert'), '', $system['order']);
     }
     // action
     switch ($system['action']) {
         case 'cache':
             // 系统缓存数据
             if (!isset($param['name'])) {
                 return $this->_return($system['return'], 'name参数不存在');
             }
             $pos = strpos($param['name'], '.');
             if ($pos !== FALSE) {
                 $_name = substr($param['name'], 0, $pos);
                 $_param = substr($param['name'], $pos + 1);
             } else {
                 $_name = $param['name'];
                 $_param = NULL;
             }
             $cache = $this->_cache_var($_name, !$system['site'] ? SITE_ID : $system['site']);
             if (!$cache) {
                 return $this->_return($system['return'], "缓存({$_name})不存在,请在后台更新缓存");
             }
             if ($_param) {
                 @eval('$data=$cache' . $this->_get_var($_param) . ';');
                 if (!$data) {
                     return $this->_return($system['return'], "缓存({$_name})参数不存在!!");
                 }
             } else {
                 $data = $cache;
             }
             return $this->_return($system['return'], $data, '');
             break;
         case 'content':
             // 模块文档内容
             if (!isset($param['id'])) {
                 return $this->_return($system['return'], 'id参数不存在');
             }
             $dirname = $system['module'] ? $system['module'] : APP_DIR;
             if (!$dirname) {
                 return $this->_return($system['return'], 'module参数不能为空');
             }
             $system['site'] = !$system['site'] ? SITE_ID : $system['site'];
             // 默认站点参数
             $module = get_module($dirname, $system['site']);
             if (!$module) {
                 return $this->_return($system['return'], "模块({$system['module']})未安装");
             }
             // 定义的模块内容模型类
             $file = FCPATH . $module['dirname'] . '/models/Content_model.php';
             if (!is_file($file)) {
                 return $this->_return($system['return'], "模块({$system['module']})文件models/Content_model.php不存在");
             }
             require_once $file;
             $db = new Content_model();
             $db->link = $this->ci->site[$system['site']];
             $db->prefix = $this->ci->db->dbprefix($system['site'] . '_' . $module['dirname']);
             // 缓存查询结果
             $data = $db->get($param['id']);
             $page = max(1, (int) $_GET['page']);
             $name = 'list-action-content-' . md5(dr_array2string($param)) . '-' . $page;
             $cache = $this->ci->get_cache_data($name);
             if (!$cache) {
                 $fields = $module['field'];
//.........这里部分代码省略.........
开发者ID:surgeon-xie,项目名称:jxseo,代码行数:101,代码来源:Template.php


示例18: _field_module

 private function _field_module($tableinfo, $name)
 {
     $_field = $this->db->where('fieldname', $name)->where('relatedid', $this->relatedid)->where('relatedname', $this->relatedname)->count_all_results('field');
     if (!$_field) {
         $module = get_module($this->data['dirname'], SITE_ID);
         $_field = isset($module['field'][$name]) ? 1 : 0;
     }
     $_system = $tableinfo[$this->db->dbprefix(SITE_ID . '_' . $this->data['dirname'])]['field'];
     return $_field ? 1 : (isset($_system[$name]) ? 1 : 0);
 }
开发者ID:Thebeautifullife,项目名称:yichunchengguan,代码行数:10,代码来源:Field_model.php


示例19: get_xtpl_file_and_cache

function get_xtpl_file_and_cache($file)
{
    include 'modules/DynamicLayout/HTMLPHPMapping.php';
    global $beanList;
    if (!empty($html_php_mapping_subpanel[$file])) {
        $xtpl = $html_php_mapping_subpanel[$file];
    } else {
        if (!empty($html_php_mapping_edit[$file])) {
            $xtpl = $html_php_mapping_edit[$file];
        } else {
            if (!empty($html_php_mapping_detail[$file])) {
                $xtpl = $html_php_mapping_detail[$file];
            } else {
                if (!empty($html_php_mapping_other[$file])) {
                    $xtpl = $html_php_mapping_other[$file];
                } else {
                    $xtpl = $file;
                }
            }
        }
    }
    $xtpl = str_replace(array('.html', 'SearchForm'), array('.php', 'ListView'), $xtpl);
    $xtpl_fp = fopen($xtpl, 'r');
    $buffer = fread($xtpl_fp, filesize($xtpl));
    fclose($xtpl_fp);
    $cache_file = create_cache_directory('layout/' . $file);
    $xtpl_cache = create_cache_directory('layout/' . $xtpl);
    $module = get_module($file);
    $form_string = "require_once('modules/" . $module . "/Forms.php');";
    if (substr_count($file, 'DetailView') > 0) {
        $buffer = str_replace('header(', 'if(false) header(', $buffer);
    }
    if (substr_count($file, 'DetailView') > 0 || substr_count($file, 'EditView') > 0) {
        if (empty($_REQUEST['record'])) {
            $buffer = preg_replace('(\\$xtpl[\\ ]*=)', "\$focus->assign_display_fields('{$module}'); \$0", $buffer);
        } else {
            $buffer = preg_replace('(\\$xtpl[\\ ]*=)', "\$focus->retrieve('" . $_REQUEST['record'] . "');\n\$focus->assign_display_fields('{$module}');\n \$0", $buffer);
        }
    }
    $_REQUEST['query'] = true;
    if (substr_count($file, 'SearchForm') > 0) {
        $temp_xtpl = new XTemplate($file);
        if ($temp_xtpl->exists('advanced')) {
            global $current_language;
            $mods = return_module_language($current_language, 'DynamicLayout');
            $class_name = $beanList[$module];
            if ($class_name == 'aCase') {
                $class_file = 'Case';
            } else {
                $class_file = $class_name;
            }
            require_once "modules/{$module}/{$class_file}.php";
            $mod = new $class_name();
            populate_request_from_buffer($file);
            $mod->assign_display_fields($module);
            $buffer = str_replace(array('$search_form->parse("advanced");', '$search_form->out("advanced");', '$search_form->parse("main");', '$search_form->out("main");'), array('', '', '', ''), $buffer);
            $buffer = str_replace('echo get_form_footer();', '$search_form->parse("main");' . "\n" . '$search_form->out("main");' . "\necho '<br><b>" . translate('LBL_ADVANCED', 'DynamicLayout') . "</b><br>';" . '$search_form->parse("advanced");' . "\n" . '$search_form->out("advanced");' . "\necho get_form_footer();\n \$sugar_config['list_max_entries_per_page'] = 1;", $buffer);
        }
    }
    if (!empty($html_php_mapping_subpanel[$file])) {
        global $beanList;
        if (!empty($_REQUEST['mod_class'])) {
            $bean = $beanList[$_REQUEST['mod_class']];
        } else {
            $bean = $beanList[$module];
        }
        $buffer = str_replace('replace_file_name', $file, $buffer);
        if (empty($_REQUEST['record'])) {
            $buffer = str_replace('global $focus_list;', "global \$focus_list;\n\$focus_list = new {$bean}();\n\$focus_list->assign_display_fields('{$module}');", $buffer);
        } else {
            $buffer = str_replace('global $focus_list;', "global \$focus_list;\n\$focus_list = new {$bean}();\n\$focus_list->retrieve('" . $_REQUEST['record'] . "');", $buffer);
        }
    }
    if (!empty($html_php_mapping_subpanel[$file])) {
        foreach ($html_php_mapping_subpanel as $key => $val) {
            if ($val == $xtpl) {
                $buffer = str_replace($key, $cache_file, $buffer);
            }
        }
    } else {
        $buffer = str_replace($file, $cache_file, $buffer);
    }
    $buffer = "<?php\n\$sugar_config['list_max_entries_per_page'] = 1;\n ?>" . $buffer;
    $buffer = str_replace($form_string, '', $buffer);
    $buffer = replace_inputs($buffer);
    $xtpl_fp_cache = fopen($xtpl_cache, 'w');
    fwrite($xtpl_fp_cache, $buffer);
    fclose($xtpl_fp_cache);
    return $xtpl_cache;
}
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:90,代码来源:DynamicLayoutUtils.php


示例20: get_module

        <div class="fix"></div>
        <?php 
        get_module('popular-articles');
        ?>
    </div>
</div>


<br>
<div class="fix"></div>
<?php 
    } else {
        ?>
    <?php 
        get_module('rm');
    }
} else {
    echo '<div class="content"><div class="warning_box ">სტატია არ მოიძებნა.</div></div>';
}
?>

<script>
    $(document).ready(function() {
        var options = {
            transitionEffect : 'fading',
            displayControls: false,
            displayList: true,
            maxHeight : 500
        }
        $('.pgwSlideshow').pgwSlideshow(options);
开发者ID:Vatia13,项目名称:funtime,代码行数:30,代码来源:post1.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_module_course_tbl函数代码示例发布时间:2022-05-15
下一篇:
PHP get_moderators函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap