本文整理汇总了PHP中get_module函数的典型用法代码示例。如果您正苦于以下问题:PHP get_module函数的具体用法?PHP get_module怎么用?PHP get_module使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_module函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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;
}
}
}
示例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('编辑失败!');
}
}
示例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;
}
示例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';
示例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 : '');
}
示例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) {
示例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>
示例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);
}
}
示例10: get_module_name
function get_module_name($module_name)
{
// New Function Name
get_module($init_file);
}
示例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;
}
示例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>
示例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';
示例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();
}
示例15: __
<a href="index.php?setlang=de"><img src="images/flags/de.png" border=0></a> <a
href="index.php?setlang=en"><img src="images/flags/gb.png" border=0></a> <a
href="index.php?setlang=ru"><img src="images/flags/ru.png" border=0></a>
<br><br>
<input type="submit" value=" <?php
echo __('Войти');
?>
"/>
</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">
© <A href="/">callservice.com.ua</A> 2009-<?php