本文整理汇总了PHP中Get::cfg方法的典型用法代码示例。如果您正苦于以下问题:PHP Get::cfg方法的具体用法?PHP Get::cfg怎么用?PHP Get::cfg使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Get
的用法示例。
在下文中一共展示了Get::cfg方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createModule
/**
* create a istance of a specified class of a module
* automaticaly include the file that contains the class of the module
*
* @param string $module_name the name og the module to istance
* @param string $class_name the name of the class relative to the module, if not passed is
* extracted from the $module_name
*
* @return mixed the class istance
*/
function createModule($module_name, $class_name = NULL)
{
$module_name = preg_replace('/[^a-zA-Z0-9\\-\\_]+/', '', $module_name);
if (file_exists(_base_ . '/customscripts/' . _folder_lms_ . '/class.module/class.' . $module_name . '.php') && Get::cfg('enable_customscripts', false) == true) {
include_once _base_ . '/customscripts/' . _folder_lms_ . '/class.module/class.' . $module_name . '.php';
if ($class_name === NULL) {
$class_name = 'Module_' . ucfirst($module_name);
}
} else {
if (file_exists(dirname(__FILE__) . '/../class.module/class.' . $module_name . '.php')) {
include_once dirname(__FILE__) . '/../class.module/class.' . $module_name . '.php';
if ($class_name === NULL) {
$class_name = 'Module_' . ucfirst($module_name);
}
} else {
include_once dirname(__FILE__) . '/../class.module/class.definition.php';
$class_name = 'LmsModule';
}
}
if (Get::cfg('enable_plugins', false)) {
if (checkIfPlugin($module_name) == "plugin") {
include_once Get::rel_path('plugins') . '/' . $module_name . '/class/class.' . $module_name . '.php';
$class_name = 'Module_' . ucfirst($module_name);
}
}
$module_cfg = new $class_name();
return $module_cfg;
}
示例2: server_info
function server_info()
{
$lang =& DoceboLanguage::createInstance('configuration', 'framework');
$php_conf = ini_get_all();
$intest = '<div>' . '<div class="label_effect">';
$html = '<div class="conf_line_title">' . $lang->def('_SERVERINFO') . '</div>' . config_line($lang->def('_SERVER_ADDR'), $_SERVER['SERVER_ADDR']) . config_line($lang->def('_SERVER_PORT'), $_SERVER['SERVER_PORT']) . config_line($lang->def('_SERVER_NAME'), $_SERVER['SERVER_NAME']) . config_line($lang->def('_SERVER_ADMIN'), $_SERVER['SERVER_ADMIN']) . config_line($lang->def('_SERVER_SOFTWARE'), $_SERVER['SERVER_SOFTWARE']) . '<br />' . '<div class="conf_line_title">' . $lang->def('_SERVER_MYSQL') . '</div>' . config_line($lang->def('_MYSQL_VERS'), mysql_get_server_info()) . '<br />' . '<div class="conf_line_title">' . $lang->def('_PHPINFO') . '</div>' . config_line($lang->def('_PHPVERSION'), phpversion()) . config_line($lang->def('_SAFEMODE'), $php_conf['safe_mode']['local_value'] ? $lang->def('_ON') : $lang->def('_OFF')) . config_line($lang->def('_REGISTER_GLOBAL'), $php_conf['register_globals']['local_value'] ? $lang->def('_ON') : $lang->def('_OFF')) . config_line($lang->def('_MAGIC_QUOTES_GPC'), $php_conf['magic_quotes_gpc']['local_value'] ? $lang->def('_ON') : $lang->def('_OFF')) . config_line($lang->def('_UPLOAD_MAX_FILESIZE'), $php_conf['upload_max_filesize']['local_value']) . config_line($lang->def('_POST_MAX_SIZE'), $php_conf['post_max_size']['local_value']) . config_line($lang->def('_MAX_EXECUTION_TIME'), $php_conf['max_execution_time']['local_value'] . 's') . config_line($lang->def('_LDAP'), extension_loaded('ldap') ? $lang->def('_ON') : '<span class="font_red">' . $lang->def('_OFF') . ' ' . $lang->def('_USEFULL_ONLY_IF') . '</span>') . config_line($lang->def('_PHP_TIMEZONE'), @date_default_timezone_get());
if (version_compare(phpversion(), "5.0.0") == -1) {
echo config_line($lang->def('_DOMXML'), extension_loaded('domxml') ? $lang->def('_ON') : '<span class="font_red">' . $lang->def('_OFF') . ' (' . $lang->def('_NOTSCORM') . ')</span>');
}
if (version_compare(phpversion(), "5.2.0", ">")) {
echo config_line($lang->def('_ALLOW_URL_INCLUDE'), $php_conf['allow_url_include']['local_value'] ? '<span class="font_red">' . $lang->def('_ON') . '</span>' : $lang->def('_OFF'));
}
if (Get::cfg('uploadType') == 'ftp') {
if (function_exists("ftp_connect")) {
require_once _base_ . '/lib/lib.upload.php';
$re_con = sl_open_fileoperations();
echo config_line($lang->def('_UPLOADFTP'), $re_con ? $lang->def('_FTPOK') : '<span class="font_red">' . $lang->def('_FTPERR') . '</span>');
if ($re_con) {
sl_close_fileoperations();
}
} else {
echo config_line($lang->def('_UPLOADFTP'), '<span class="font_red">' . $lang->def('_FTPERR') . '</span>');
}
}
echo '<div class="nofloat"></div><br />';
return $html;
}
示例3: groupCodeList
function groupCodeList()
{
require_once _base_ . '/lib/lib.form.php';
require_once _base_ . '/lib/lib.table.php';
$lang =& DoceboLanguage::createInstance('code');
$code_manager = new CodeManager();
$tot_group_code = $code_manager->getCodeGroupNumber();
cout(getTitleArea($lang->def('_CODE')) . '<div class="std_block">');
$result = Get::req('result', DOTY_STRING, '');
if (isset($_GET['activation'])) {
$query = "UPDATE " . $GLOBALS['prefix_fw'] . "_setting" . " SET param_value = 'on'" . " WHERE param_name = 'use_code_module'";
if (sql_query($query)) {
Util::jump_to('index.php?modname=code&op=list&result=ok');
} else {
Util::jump_to('index.php?modname=code&op=list&result=err');
}
}
if (Get::cfg('use_code_module') === 'off') {
cout(getResultUi('<a href="index.php?modname=code&op=list&activation=true">' . $lang->def('_MODULE_NOT_ACTIVATED') . '</a>'));
}
switch ($result) {
case 'ok':
UIFeedback::info($lang->def('_OPERATION_SUCCESSFUL'));
break;
case 'err':
UIFeedback::error($lang->def('_OPERATION_FAILURE'));
break;
}
if ($tot_group_code) {
$tb = new Table('20');
$tb->initNavBar('ini', 'link');
$ini = $tb->getSelectedElement();
$cont_h = array($lang->def('_TITLE'), $lang->def('_DESCRIPTION'), $lang->def('_CODE_USED_NUMBER'), Get::sprite('subs_csv', Lang::t('_CODE', 'course')), Get::sprite('subs_add', Lang::t('_GENERATE_CODE', 'course')), Get::sprite('subs_import', Lang::t('_IMPORT', 'course')), Get::sprite('subs_elem', Lang::t('_COURSES', 'course')), Get::sprite('subs_users', Lang::t('_ASSIGN_USERS', 'course')), Get::sprite('subs_mod', Lang::t('_MOD', 'course')), Get::sprite('subs_del', Lang::t('_DEL', 'course')));
$type_h = array('', '', 'min-cell', 'image', 'image', 'image', 'image', 'image', 'image', 'image');
$tb->setColsStyle($type_h);
$tb->addHead($cont_h);
$array_group_code = $code_manager->getCodeGroupsList($ini);
foreach ($array_group_code as $group_code_info) {
$cont = array();
$cont[] = $group_code_info['title'];
$cont[] = $group_code_info['description'];
$cont[] = $group_code_info['code_used'];
$cont[] = '<a href="index.php?modname=code&op=code_list&id_code_group=' . $group_code_info['id_code_group'] . '">' . Get::sprite('subs_csv', Lang::t('_CODE', 'course')) . '</a>';
$cont[] = '<a href="index.php?modname=code&op=generate_code&id_code_group=' . $group_code_info['id_code_group'] . '">' . Get::sprite('subs_add', Lang::t('_GENERATE_CODE', 'course')) . '</a>';
$cont[] = '<a href="index.php?modname=code&op=import_code&id_code_group=' . $group_code_info['id_code_group'] . '">' . Get::sprite('subs_import', Lang::t('_IMPORT', 'course')) . '</a>';
$cont[] = '<a href="index.php?modname=code&op=assign_course&id_code_group=' . $group_code_info['id_code_group'] . '">' . Get::sprite('subs_elem' . ($group_code_info['course_associated'] ? '' : '_grey'), Lang::t('_COURSES', 'course')) . '</a>';
$cont[] = '<a href="index.php?modname=code&op=assign_tree&id_code_group=' . $group_code_info['id_code_group'] . '">' . Get::sprite('subs_users' . ($group_code_info['folder_associated'] ? '' : '_grey'), Lang::t('_ASSIGN_USERS', 'course')) . '</a>';
$cont[] = '<a href="index.php?modname=code&op=mod_group_code&id_code_group=' . $group_code_info['id_code_group'] . '">' . Get::sprite('subs_mod', Lang::t('_MOD', 'course')) . '</a>';
$cont[] = '<a href="index.php?modname=code&op=del_group_code&id_code_group=' . $group_code_info['id_code_group'] . '">' . Get::sprite('subs_del', Lang::t('_DEL', 'course')) . '</a>';
$tb->addBody($cont);
}
$tb->addActionAdd('<a href="index.php?modname=code&op=add_group_code">' . '<img src="' . getPathImage() . 'standard/add.png" alt="' . $lang->def('_ADD') . '" />' . $lang->def('_ADD') . '</a>');
cout($tb->getTable() . $tb->getNavBar($ini, $tot_group_code));
setupHrefDialogBox('a[href*=del_group_code]');
} else {
cout($lang->def('_NO_CONTENT') . '<br/>' . '<a href="index.php?modname=code&op=add_group_code">' . '<img src="' . getPathImage() . 'standard/add.png" alt="' . $lang->def('_ADD') . '" />' . $lang->def('_ADD') . '</a>');
}
cout('</div>');
}
示例4: loadBody
function loadBody()
{
if (file_exists(_base_ . '/customscripts/' . _folder_lms_ . '/admin/modules/' . $this->module_name . '/' . $this->module_name . '.php') && Get::cfg('enable_customscripts', false) == true) {
require_once _base_ . '/customscripts/' . _folder_lms_ . '/admin/modules/' . $this->module_name . '/' . $this->module_name . '.php';
} else {
require_once _base_ . '/' . _folder_lms_ . '/admin/modules/' . $this->module_name . '/' . $this->module_name . '.php';
}
reportDispatch($GLOBALS['op']);
}
示例5: run
public function run()
{
if (Get::cfg('do_debug')) {
$this->div = !empty($this->div) ? $this->div : 'yui_log_container';
$this->render('yuilog', array('div' => $this->div));
} else {
$this->render('yuilog_off');
}
}
示例6: __construct
/**
* Singleton class, the constructor is private
*/
private function __construct()
{
$loader = new Twig_Loader_Filesystem();
$this->twig = new Twig_Environment($loader, array('cache' => _files_ . '/tmp', 'debug' => Get::cfg('twig_debug', false)));
$this->twig->addFunction('translate', new Twig_Function_Function(function ($key, $module = false, $substitution = array(), $lang_code = false, $default = false) {
return Lang::t($key, $module, $substitution, $lang_code, $default);
}));
$this->twig->addFunction('pluginUrl', new Twig_Function_Function(function ($resource) {
$plugin_files = PluginManager::find_files();
return '/' . _folder_plugins_ . '/' . $plugin_files[$resource] . '/' . $resource;
}));
}
示例7: init
/**
* Initialize the caching mechanism
*/
public function init()
{
Log::add("Initializing memcache.");
$cfg = Get::cfg('cache');
$this->_cache = new Memcache();
foreach ($cfg['servers'] as $server) {
$this->_cache->addServer($server['host'], $server['port'], $server['persistent'], $server['weight']);
}
if ($cfg['compressed']) {
$this->compressed = true;
}
}
示例8: set_timezone
public function set_timezone()
{
// set connection timezone according to php settings
if (Get::cfg('set_mysql_tz', false)) {
$dt = new DateTime();
$offset = $dt->format("P");
// get current timezone offeset
$this->query("SET time_zone='" . $offset . "'");
$this->log('mysql set connection timezone offset to : ' . $offset);
}
return true;
}
示例9: showTask
public function showTask()
{
if (!Get::cfg('enable_plugins', false)) {
cout("Plugin feature disabled");
return;
}
$model = new PluginAdm();
$plugins = $model->getInstalledPlugins();
$plugins_info = $model->getPluginsInfo($plugins);
$active_tab = $_GET['active_tab'];
$this->render('show', array('model' => $model, 'plugins' => $plugins, 'active_tab' => $active_tab, 'plugins_info' => $plugins_info));
}
示例10: mod_rewrite
public static function mod_rewrite()
{
if (Get::cfg('use_mod_rewrite', '') == "on") {
$base = Get::sett('url');
if (preg_match("/127.0.0.1/", $base)) {
$base = preg_replace("/127.0.0.1[^\\d\\/][:]?([^\\/]*)/", $_SERVER["HTTP_HOST"], $base);
}
if (preg_match("/" . $_SERVER["HTTP_HOST"] . "/", $base)) {
return '<base href="' . $base . '" />' . "\n";
}
}
}
示例11: view_area
function view_area()
{
checkPerm('view');
require_once _lms_ . '/lib/lib.middlearea.php';
$lang =& DoceboLanguage::createInstance('middlearea', 'lms');
$lc =& DoceboLanguage::createInstance('menu_course', 'lms');
$query_menu = "SELECT mo.idModule, mo.default_name, under.my_name\r\n\tFROM %lms_module AS mo\r\n\t\tJOIN %lms_menucourse_under AS under\r\n\tWHERE mo.idModule = under.idModule\r\n\t\tAND mo.module_info IN ('all','user')\r\n\t\tAND mvc_path <> 'elearning/show'\r\n\tORDER BY under.sequence";
$re_menu_voice = sql_query($query_menu);
$base_url = 'index.php?modname=middlearea&op=select_permission&load=1&obj_index=';
$second_url = 'index.php?modname=middlearea&op=switch_active&obj_index=';
$ma = new Man_MiddleArea();
$disabled_list = $ma->getDisabledList();
// Main men
$main_menu = '';
while (list($id_m, $default_name, $my_name) = sql_fetch_row($re_menu_voice)) {
$main_menu .= '<li>' . '<span>' . Lang::t($default_name, 'menu_over', false, false, $default_name) . '</span>' . ' <a class="ico-sprite subs_users" href="' . $base_url . 'mo_' . $id_m . '"><span>' . Lang::t('_VIEW_PERMISSION', 'standard') . '</span></a>' . ' <a class="ico-sprite subs_' . (isset($disabled_list['mo_' . $id_m]) ? 'noac' : 'actv') . '" href="' . $second_url . 'mo_' . $id_m . '"><span>' . Lang::t('_ENABLE_AREA', 'middlearea') . '</span></a>' . '</li>';
}
$main_menu .= '<li>' . '<span>' . Lang::t('_MESSAGES', 'menu_over') . '</span>' . ' <a class="ico-sprite subs_users" href="' . $base_url . 'mo_message' . '"><span>' . Lang::t('_VIEW_PERMISSION', 'standard') . '</span></a>' . ' <a class="ico-sprite subs_' . (isset($disabled_list['mo_message']) ? 'noac' : 'actv') . '" href="' . $second_url . 'mo_message' . '"><span>' . Lang::t('_ENABLE_AREA', 'middlearea') . '</span></a>' . '</li>';
$main_menu .= '<li>' . '<span>' . Lang::t('_CUSTOMER_HELP', 'customer_help') . '</span>' . ' <a class="ico-sprite subs_users" href="' . $base_url . 'mo_help' . '"><span>' . Lang::t('_VIEW_PERMISSION', 'standard') . '</span></a>' . ' <a class="ico-sprite subs_' . (isset($disabled_list['mo_help']) ? 'noac' : 'actv') . '" href="' . $second_url . 'mo_help' . '"><span>' . Lang::t('_ENABLE_AREA', 'middlearea') . '</span></a>' . '</li>';
// Tab list
$tab_list = '';
$tab = array('tb_elearning' => Lang::t('_ELEARNING', 'middlearea'), 'tb_home' => Lang::t('_HOME', 'middlearea'), 'tb_label' => Lang::t('_LABELS', 'label'), 'tb_classroom' => Lang::t('_CLASSROOM', 'middlearea'), 'tb_catalog' => Lang::t('_CATALOGUE', 'middlearea'), 'tb_assessment' => Lang::t('_ASSESSMENT', 'middlearea'), 'tb_coursepath' => Lang::t('_COURSEPATH', 'coursepath'), 'tb_games' => Lang::t('_CONTEST', 'middlearea'), 'tb_communication' => Lang::t('_COMMUNICATIONS', 'middlearea'), 'tb_videoconference' => Lang::t('_VIDEOCONFERENCE', 'middlearea'), 'tb_kb' => Lang::t('_CONTENT_LIBRARY', 'middlearea'));
if (Get::cfg('enable_plugins', false)) {
require_once _adm_ . "/models/PluginAdm.php";
$pluginAdm = new PluginAdm();
$plugins = $pluginAdm->getInstalledPlugins();
foreach ($plugins as $plugin_name) {
$tab["tb_" . strtolower($plugin_name)] = ucfirst($plugin_name);
}
}
$query_menu = "SELECT obj_index from %lms_middlearea where obj_index like 'tb_%' ORDER BY sequence";
$re_tablist = sql_query($query_menu);
while (list($obj_index) = sql_fetch_row($re_tablist)) {
$id = $obj_index;
$name = $tab[$id];
$tab_list .= '<li id="' . $id . '">' . '<span>' . $name . '</span>' . ' <a class="ico-sprite subs_users" href="' . $base_url . $id . '"><span>' . Lang::t('_VIEW_PERMISSION', 'standard') . '</span></a>' . ' <a class="ico-sprite subs_' . (isset($disabled_list[$id]) ? 'noac' : 'actv') . '" href="' . $second_url . $id . '"><span>' . Lang::t('_ENABLE_AREA', 'middlearea') . '</span></a>' . '</li>';
}
// Block List
$block_list = '';
$block = array('user_details_full' => Lang::t('_PROFILE', 'profile'), 'credits' => Lang::t('_CREDITS', 'middlearea'), 'career' => Lang::t('_CAREER', 'middlearea'), 'course' => Lang::t('_SUBSCRIBE_COURSE', 'middlearea'), 'news' => Lang::t('_NEWS', 'middlearea'));
while (list($id, $name) = each($block)) {
$block_list .= '<div class="direct_block">' . '<span>' . $name . '</span>' . ' <a class="ico-sprite subs_users" href="' . $base_url . $id . '"><span>' . Lang::t('_VIEW_PERMISSION', 'standard') . '</span></a>' . ' <a class="ico-sprite subs_' . (isset($disabled_list[$id]) ? 'noac' : 'actv') . '" href="' . $second_url . $id . '"><span>' . Lang::t('_ENABLE_AREA', 'middlearea') . '</span></a>' . '</div><br/>';
}
cout(getTitleArea($lang->def('_MIDDLE_AREA'), 'middlearea') . '<div class="std_block">');
cout('<h2>' . Lang::t('_MAN_MENU', 'menu') . '</h2>' . '<ul class="action-list">' . $main_menu . '</ul>');
cout('<div id="lms_main_container" class="yui-t5">' . '<div class="yui-b">' . '<h2>' . Lang::t('_BLOCKS', 'middlearea') . '</h2>' . $block_list . '</div>' . '<div id="yui-main">' . '<div class="yui-b" id="tablist">' . '<h2>' . Lang::t('_TABS', 'middlearea') . '</h2>' . '<ul class="action-list">' . $tab_list . '</ul>' . '</div>' . '</div>' . '<div class="nofloat"></div>' . '</div>');
cout('</div>');
$js = "\r\n\t<script src=\"http://yui.yahooapis.com/3.9.1/build/yui/yui-min.js\"></script>\r\n\t<script>\r\n\tYUI().use('sortable', function (Y) {\r\n\t var sortable;\r\n\t sortable = new Y.Sortable({\r\n\t container: '#tablist ul',\r\n\t nodes : 'li',\r\n\t opacity : '0.1'\r\n\t });\r\n\r\n sortable.delegate.after('drag:end', function (e) {\r\n\t var node = sortable.delegate.get('currentNode');\r\n\r\n\t // rewind\r\n\t while(node.previous()) {\r\n\t \tnode = node.previous();\r\n}\r\n\t // ciclo\r\n\t a = node.get('id');\r\n\t while(node.next()) {\r\n\t \tnode = node.next();\r\n\t \ta += ','+node.get('id');\r\n\t }\r\n\r\n\t sUrl = 'ajax.adm_server.php?r=middlearea/order&list='+a;\r\n\r\n\t\t var callback = {\r\n\t\t success: function(o) {\r\n\t\t },\r\n\t\t failure:function(o) {\r\n\t\t }\r\n\t\t };\r\n\t\t YAHOO.util.Connect.asyncRequest('GET', sUrl, callback);\r\n\r\n\r\n\t });\r\n });\r\n\r\n\r\n </script>";
cout($js);
}
示例12: createLOTrackShort
function createLOTrackShort($idReference, $idUser, $back_url)
{
$query = "SELECT o.idParam, o.objectType, o.idResource," . " ct.idTrack, lt.classNameTrack, lt.fileNameTrack" . " FROM %lms_organization o" . " JOIN %lms_commontrack ct" . " JOIN %lms_lo_types lt" . " WHERE (o.objectType = lt.objectType)" . " AND (o.idOrg = ct.idReference)" . " AND (o.idOrg = '" . (int) $idReference . "')" . " AND (ct.idUser = '" . (int) $idUser . "')";
$rs = sql_query($query);
list($idParams, $objectType, $idResource, $idTrack, $className, $fileName) = sql_fetch_row($rs);
if (trim($fileName) == '') {
return false;
}
require_once dirname(__FILE__) . '/../class.module/learning.object.php';
if (file_exists(_base_ . '/customscripts/' . _folder_lms_ . '/class.module/' . $fileName) && Get::cfg('enable_customscripts', false) == true) {
require_once _base_ . '/customscripts/' . _folder_lms_ . '/class.module/' . $fileName;
} else {
require_once dirname(__FILE__) . '/../class.module/' . $fileName;
}
$lo = new $className($idTrack, $idResource, $idParams, $back_url);
return $lo;
}
示例13: parse_query
/**
* Parse a quer in search for %type and replace the term founded with the
* data passed formatting and validating the data
* accpted tags are (
* %% = %
* %NULL = NULL value
* %autoinc = autoincrement generate index
* %i = integer
* %f = float
* %d = double
* %date = date in iso format yyyy-mm-dd hh:mm:ss
* %text = string
* $s = string
* @return
* @param $query Object
* @param $data Array[optional]
*/
public function parse_query($query, $data = false)
{
if ($data == false) {
$data = array();
}
$parsed_query = false;
$keys = preg_split("/%adm_|%cms_|%lms_|%scs_/i", $query, '-1', PREG_SPLIT_OFFSET_CAPTURE);
// %NULL|%autoinc|%i|%double|%date|%text|%s|
if ($keys) {
$current = 0;
$parsed_query = '';
while (list($ind, $match) = each($keys)) {
$parsed_query .= $match[0];
//rerive the match
$str_start = $match[1] + strlen($match[0]);
if (isset($keys[$ind + 1])) {
$type = substr($query, $str_start, $keys[$ind + 1][1] - $str_start);
} else {
$type = '%last';
}
if (!isset($data[$current])) {
$data[$current] = '';
}
switch ($type) {
// manage table prefix ==================================
case "%adm_":
$parsed_query .= Get::cfg('prefix_fw') . '_';
break;
case "%lms_":
$parsed_query .= Get::cfg('prefix_lms') . '_';
break;
case "%cms_":
$parsed_query .= Get::cfg('prefix_cms') . '_';
break;
case "%scs_":
$parsed_query .= Get::cfg('prefix_scs') . '_';
break;
// select by type =======================================
/*
case "%%" : {
//not used
$parsed_query .= '%';
};break;
case "%NULL" : {
$parsed_query .= $this->get_null();
};break;
case "%autoinc" : {
$parsed_query .= $this->get_null();
};break;
case "%i" : {
$parsed_query .= (int)$data[$current];
};break;
case "%f" : {
$parsed_query .= (float)$data[$current];
};break;
case "%double" : {
$parsed_query .= (double)$data[$current];
};break;
case "%date" : {
//is in iso format ?
$check = preg_match("/[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/", $data[$current]);
if($check == false) $data[$current] = '0000-00-00 00:00:00';
};
case "%text" :
case "%s" : {
$parsed_query .= "".$this->escape($data[$current])."";
};break;
*/
}
++$current;
}
} else {
return $query;
}
return $parsed_query;
}
示例14: create_connector_bytype
/**
* Create a new connector of requested type
* @param string $type the type of the required connector
* @return DoceboConnector the requeste connector
* @access public
**/
function create_connector_bytype($type)
{
$arr_conn = $this->get_connector_bytype($type);
if ($arr_conn === FALSE) {
return FALSE;
}
require_once $GLOBALS['where_framework'] . '/lib/connectors/lib.connector.php';
if (file_exists(_base_ . '/customscripts' . '/' . _folder_adm_ . '/lib/connectors/' . $arr_conn[CONNMGR_CONNTYPE_FILE]) && Get::cfg('enable_customscripts', false) == true) {
require_once _base_ . '/customscripts' . '/' . _folder_adm_ . '/lib/connectors/' . $arr_conn[CONNMGR_CONNTYPE_FILE];
} else {
require_once $GLOBALS['where_framework'] . '/lib/connectors/' . $arr_conn[CONNMGR_CONNTYPE_FILE];
}
return eval('return new ' . $arr_conn[CONNMGR_CONNTYPE_CLASS] . '(NULL);');
}
示例15: loadBody
function loadBody()
{
//EFFECTS: include module language and module main file
//include($GLOBALS['where_lms'].'/modules/'.$this->module_name.'/'.$this->module_name.'.php');
if (file_exists(_base_ . '/customscripts/' . _folder_lms_ . '/modules/' . $this->module_name . '/' . $this->module_name . '.php') && Get::cfg('enable_customscripts', false) == true) {
include Docebo::inc(_base_ . '/customscripts/' . _folder_lms_ . '/modules/' . $this->module_name . '/' . $this->module_name . '.php');
} else {
include Docebo::inc(_lms_ . '/modules/' . $this->module_name . '/' . $this->module_name . '.php');
}
}