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


PHP pushClaroMessage函数代码示例

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


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

示例1: get_request_uri

/**
 * Returns the name of the current script, WITH the querystring portion.
 * this function is necessary because PHP_SELF and REQUEST_URI and SCRIPT_NAME
 * return different things depending on a lot of things like your OS, Web
 * server, and the way PHP is compiled (ie. as a CGI, module, ISAPI, etc.)
 * <b>NOTE:</b> This function returns false if the global variables needed are not set.
 *
 * @since 1.8
 * @return string
 */
function get_request_uri()
{
    if (!empty($_SERVER['REQUEST_URI'])) {
        return $_SERVER['REQUEST_URI'];
    } else {
        if (!empty($_SERVER['PHP_SELF'])) {
            if (!empty($_SERVER['QUERY_STRING'])) {
                return $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'];
            }
            return $_SERVER['PHP_SELF'];
        } elseif (!empty($_SERVER['SCRIPT_NAME'])) {
            if (!empty($_SERVER['QUERY_STRING'])) {
                return $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING'];
            }
            return $_SERVER['SCRIPT_NAME'];
        } elseif (!empty($_SERVER['URL'])) {
            // May help IIS (not well tested)
            if (!empty($_SERVER['QUERY_STRING'])) {
                return $_SERVER['URL'] . '?' . $_SERVER['QUERY_STRING'];
            }
            return $_SERVER['URL'];
        } else {
            pushClaroMessage('Warning: Could not find any of these web server variables: $REQUEST_URI, $PHP_SELF, $SCRIPT_NAME or $URL');
            return false;
        }
    }
}
开发者ID:rhertzog,项目名称:lcs,代码行数:37,代码来源:url.lib.php

示例2: log

 public static function log($message, $type)
 {
     if (claro_debug_mode()) {
         pushClaroMessage($message, $type);
     }
     Claroline::log($type, $message);
 }
开发者ID:rhertzog,项目名称:lcs,代码行数:7,代码来源:console.lib.php

示例3: isAllowedToDownload

 public function isAllowedToDownload($requestedUrl)
 {
     if (!$this->isModuleAllowed()) {
         return false;
     }
     if (claro_is_in_a_course()) {
         if (!claro_is_course_allowed()) {
             pushClaroMessage('course not allowed', 'debug');
             return false;
         } else {
             if (claro_is_in_a_group()) {
                 if (!claro_is_group_allowed()) {
                     pushClaroMessage('group not allowed', 'debug');
                     return false;
                 } else {
                     return true;
                 }
             } else {
                 return $this->isDocumentDownloadableInCourse($requestedUrl);
             }
         }
     } else {
         return false;
     }
 }
开发者ID:rhertzog,项目名称:lcs,代码行数:25,代码来源:downloader.cnr.php

示例4: get_textzone_file_path

 /**
  * Build the file path of a textzone in a given context
  *
  * @param string $key
  * @param array $context specify the context to build the path.
  * @param array $right specify an array of right to specify the file
  * @return file path
  */
 public static function get_textzone_file_path($key, $context = null, $right = null)
 {
     $textZoneFile = null;
     $key .= '.';
     if (!is_null($right) && is_array($right)) {
         foreach ($right as $context => $rightInContext) {
             if (is_array($rightInContext)) {
                 $key .= $context . '_';
                 foreach ($rightInContext as $rightName => $rightValue) {
                     if (is_bool($rightValue)) {
                         $key .= $rightValue ? $rightName : 'not_' . $rightName;
                     } else {
                         $key .= $rightName . '_' . $rightValue;
                     }
                     $key .= '.';
                 }
             }
         }
     }
     if (is_array($context) && array_key_exists(CLARO_CONTEXT_COURSE, $context)) {
         if (is_array($context) && array_key_exists(CLARO_CONTEXT_GROUP, $context)) {
             $textZoneFile = get_conf('coursesRepositorySys') . claro_get_course_group_path($context) . '/textzone/' . $key . 'inc.html';
         } else {
             $textZoneFile = get_conf('coursesRepositorySys') . claro_get_course_path($context[CLARO_CONTEXT_COURSE]) . '/textzone/' . $key . 'inc.html';
         }
     }
     if (is_null($textZoneFile)) {
         $textZoneFile = get_path('rootSys') . 'platform/textzone/' . $key . 'inc.html';
     }
     pushClaroMessage($textZoneFile);
     return $textZoneFile;
 }
开发者ID:rhertzog,项目名称:lcs,代码行数:40,代码来源:textzone.lib.php

示例5: load_current_module_listeners

/**
 * Load the event listener of the current module 
 */
function load_current_module_listeners()
{
    $claroline = Claroline::getInstance();
    $path = get_module_path(Claroline::getInstance()->currentModuleLabel()) . '/connector/eventlistener.cnr.php';
    if (file_exists($path)) {
        if (claro_debug_mode()) {
            pushClaroMessage('Load listeners for : ' . Claroline::getInstance()->currentModuleLabel(), 'debug');
        }
        include $path;
    } else {
        if (claro_debug_mode()) {
            pushClaroMessage('No listeners for : ' . Claroline::getInstance()->currentModuleLabel(), 'warning');
        }
    }
}
开发者ID:rhertzog,项目名称:lcs,代码行数:18,代码来源:notify.lib.php

示例6: loadModuleManager

 private function loadModuleManager($cidReq = null)
 {
     $toolList = claro_get_main_course_tool_list();
     foreach ($toolList as $tool) {
         if (!is_null($tool['label'])) {
             $file = get_module_path($tool['label']) . '/connector/trackingManager.cnr.php';
             if (file_exists($file)) {
                 require_once $file;
                 if (claro_debug_mode()) {
                     pushClaroMessage('Tracking : ' . $tool['label'] . ' tracking managers loaded', 'debug');
                 }
             }
         }
     }
 }
开发者ID:rhertzog,项目名称:lcs,代码行数:15,代码来源:trackingManagerRegistry.class.php

示例7: __construct

 private function __construct()
 {
     try {
         // initialize the event manager and notification classes
         $this->eventManager = EventManager::getInstance();
         $this->notification = ClaroNotification::getInstance();
         $this->notifier = ClaroNotifier::getInstance();
         // initialize logger
         $this->logger = new Logger();
         $this->moduleLabelStack = array();
         if (isset($GLOBALS['tlabelReq'])) {
             $this->pushModuleLabel($GLOBALS['tlabelReq']);
             pushClaroMessage("Set current module to {$GLOBALS['tlabelReq']}", 'debug');
         }
     } catch (Exception $e) {
         die($e);
     }
 }
开发者ID:rhertzog,项目名称:lcs,代码行数:18,代码来源:claroline.lib.php

示例8: isAllowedToDownload

 public function isAllowedToDownload($requestedUrl)
 {
     $fromCLLNP = isset($_SESSION['fromCLLNP']) && $_SESSION['fromCLLNP'] === true ? true : false;
     // unset CLLNP mode
     unset($_SESSION['fromCLLNP']);
     if (!$fromCLLNP || !$this->isModuleAllowed()) {
         return false;
     }
     if (claro_is_in_a_course()) {
         if (!claro_is_course_allowed()) {
             pushClaroMessage('course not allowed', 'debug');
             return false;
         } else {
             return $this->isDocumentDownloadableInCourse($requestedUrl);
         }
     } else {
         return false;
     }
 }
开发者ID:rhertzog,项目名称:lcs,代码行数:19,代码来源:downloader.cnr.php

示例9: claro_delete_file

/**
 * Delete a file or a directory (and its whole content)
 *
 * @param  - $filePath (String) - the path of file or directory to delete
 * @return - boolean - true if the delete succeed
 *           boolean - false otherwise.
 */
function claro_delete_file($filePath)
{
    if (is_file($filePath)) {
        return unlink($filePath);
    } elseif (is_dir($filePath)) {
        $dirHandle = @opendir($filePath);
        if (!$dirHandle) {
            function_exists('claro_html_debug_backtrace') && pushClaroMessage(claro_html_debug_backtrace());
            return false;
        }
        $removableFileList = array();
        while (false !== ($file = readdir($dirHandle))) {
            if ($file == '.' || $file == '..') {
                continue;
            }
            $removableFileList[] = $filePath . '/' . $file;
        }
        closedir($dirHandle);
        // impossible to test, closedir return void ...
        if (sizeof($removableFileList) > 0) {
            foreach ($removableFileList as $thisFile) {
                if (!claro_delete_file($thisFile)) {
                    return false;
                }
            }
        }
        clearstatcache();
        if (is_writable($filePath)) {
            return @rmdir($filePath);
        } else {
            function_exists('claro_html_debug_backtrace') && pushClaroMessage(claro_html_debug_backtrace());
            return false;
        }
    }
    // end elseif is_dir()
}
开发者ID:rhertzog,项目名称:lcs,代码行数:43,代码来源:fileManage.lib.php

示例10: object_unregister_class_from_course

/**
 * helper to unregister a class (and recursively unregister all its subclasses) from a course
 * @param Claro_Class $claroClass
 * @param Claro_Course $courseObj
 * @param Claro_BatchRegistrationResult $result
 * @return Claro_BatchRegistrationResult
 * @since Claroline 1.11.9
 */
function object_unregister_class_from_course($claroClass, $courseObj, $result)
{
    if ($claroClass->isRegisteredToCourse($courseObj->courseId)) {
        $classUserIdList = $claroClass->getClassUserList()->getClassUserIdList();
        $courseBatchRegistretion = new Claro_BatchCourseRegistration($courseObj);
        $courseBatchRegistretion->removeUserIdListFromCourse($classUserIdList, $claroClass);
        if ($claroClass->hasSubclasses()) {
            pushClaroMessage("Class has subclass", 'debug');
            // recursion !
            foreach ($claroClass->getSubClassesIterator() as $subClass) {
                pushClaroMessage("Process subclass{$subClass->getName()}", 'debug');
                $result = object_unregister_class_from_course($subClass, $courseObj, $result);
            }
        } else {
            pushClaroMessage("Class has no subclass", 'debug');
        }
        $claroClass->unregisterFromCourse($courseObj->courseId);
        return $result;
    } else {
        return $result;
    }
}
开发者ID:rhertzog,项目名称:lcs,代码行数:30,代码来源:class.lib.php

示例11: claro_is_course_admin

/**
 * Return the right of the current user
 *
 * @author Christophe Gesche <moosh@claroline.net>
 * @return boolean
 */
function claro_is_course_admin()
{
    pushClaroMessage('use claro_is_course_manager() instead of claro_is_course_admin()', 'code review');
    return claro_is_course_manager();
}
开发者ID:rhertzog,项目名称:lcs,代码行数:11,代码来源:init.lib.php

示例12: generate_module_names_translation_cache

function generate_module_names_translation_cache()
{
    $cacheRepositorySys = get_path('rootSys') . get_conf('cacheRepository', 'tmp/cache/');
    $moduleLangCache = $cacheRepositorySys . 'module_lang_cache';
    if (!file_exists($moduleLangCache)) {
        claro_mkdir($moduleLangCache, CLARO_FILE_PERMISSIONS, true);
    }
    $tbl = claro_sql_get_main_tbl();
    $sql = "SELECT `name`, `label`\n              FROM `" . $tbl['module'] . "`\n             WHERE activation = 'activated'";
    $module_list = claro_sql_query_fetch_all($sql);
    $langVars = array();
    foreach ($module_list as $module) {
        $langPath = get_module_path($module['label']) . '/lang/';
        if (file_exists($langPath)) {
            $it = new DirectoryIterator($langPath);
            foreach ($it as $file) {
                if ($file->isFile() && preg_match('/^lang_\\w+.php$/', $file->getFilename())) {
                    $langName = str_replace('lang_', '', $file->getFilename());
                    $langName = str_replace('.php', '', $langName);
                    if ($langName != 'english') {
                        pushClaroMessage($langName . ':' . $module['label'], 'debug');
                        $_lang = array();
                        ob_start();
                        include $file->getPathname();
                        ob_end_clean();
                        if (!isset($langVars[$langName])) {
                            $langVars[$langName] = '';
                        }
                        if (isset($_lang[$module['name']])) {
                            $langVars[$langName] .= '$_lang[\'' . $module['name'] . '\'] = \'' . str_replace("'", "\\'", $_lang[$module['name']]) . '\';' . "\n";
                        }
                    }
                }
            }
        }
    }
    foreach ($langVars as $lgnNm => $contents) {
        $langFile = $moduleLangCache . '/' . $lgnNm . '.lang.php';
        if (file_exists($langFile)) {
            unlink($langFile);
        }
        file_put_contents($langFile, "<?php\n" . $contents);
    }
}
开发者ID:rhertzog,项目名称:lcs,代码行数:44,代码来源:manage.lib.php

示例13: load_module_translation

 public static function load_module_translation($moduleLabel = null, $language = null)
 {
     global $_lang;
     $moduleLabel = is_null($moduleLabel) ? get_current_module_label() : $moduleLabel;
     // In a module
     if (!empty($moduleLabel)) {
         $module_path = get_module_path($moduleLabel);
         $language = is_null($language) ? language::current_language() : $language;
         // load english by default if exists
         if (file_exists($module_path . '/lang/lang_english.php')) {
             /* FIXME : DEPRECATED !!!!! */
             $mod_lang = array();
             include $module_path . '/lang/lang_english.php';
             $_lang = array_merge($_lang, $mod_lang);
             if (claro_debug_mode()) {
                 pushClaroMessage(__FUNCTION__ . "::" . $moduleLabel . '::' . 'English lang file loaded', 'debug');
             }
         } else {
             // no language file to load
             if (claro_debug_mode()) {
                 pushClaroMessage(__FUNCTION__ . "::" . $moduleLabel . '::' . 'English lang file  not found', 'debug');
             }
         }
         // load requested language if exists
         if ($language != 'english' && file_exists($module_path . '/lang/lang_' . $language . '.php')) {
             /* FIXME : CODE DUPLICATION see 263-274 !!!!! */
             /* FIXME : DEPRECATED !!!!! */
             $mod_lang = array();
             include $module_path . '/lang/lang_' . $language . '.php';
             $_lang = array_merge($_lang, $mod_lang);
             if (claro_debug_mode()) {
                 pushClaroMessage(__FUNCTION__ . "::" . $moduleLabel . '::' . ucfirst($language) . ' lang file loaded', 'debug');
             }
         } elseif ($language != 'english') {
             // no language file to load
             if (claro_debug_mode()) {
                 pushClaroMessage(__FUNCTION__ . "::" . $moduleLabel . '::' . ucfirst($language) . ' lang file  not found', 'debug');
             }
         } else {
             // nothing to do
         }
     } else {
         // Not in a module
     }
 }
开发者ID:rhertzog,项目名称:lcs,代码行数:45,代码来源:language.lib.php

示例14: claro_disp_duration

/**
 * convert a duration in seconds to a human readable duration
 * @author Sebastien Piraux <pir@cerdecam.be>
 * @param integer duration time in seconds to convert to a human readable duration
 */
function claro_disp_duration($duration)
{
    pushClaroMessage((function_exists('claro_html_debug_backtrace') ? claro_html_debug_backtrace() : 'claro_html_debug_backtrace() not defined') . 'claro_ disp _duration() is deprecated , use claro_ html _duration()', 'error');
    return claro_html_duration($duration);
}
开发者ID:rhertzog,项目名称:lcs,代码行数:10,代码来源:html.lib.php

示例15: google_translation

function google_translation($from, $to, $string)
{
    $string = urlencode($string);
    ### recherche la source chez google avec le mot à traduire: $q
    pushClaroMessage(__LINE__ . '<pre>"http://translate.google.com/translate_t?text=$string&langpair=$from|$to&hl=fr&ie=UTF-8&oe=UTF-8" =' . var_export("http://translate.google.com/translate_t?text={$string}&langpair={$from}|{$to}&hl=fr&ie=UTF-8&oe=UTF-8", 1) . '</pre>', 'dbg');
    $source = implode('', file("http://translate.google.com/translate_t?text={$string}&langpair={$from}|{$to}&hl=fr&ie=UTF-8&oe=UTF-8"));
    ### decoupage de $source au debut
    $source = strstr($source, '<div id=result_box dir=ltr>');
    ### decoupage de $source à la fin
    $fin_source = strstr($source, '</div>');
    ### supprimer $fin_source de la chaine $source
    $proposition = str_replace("{$fin_source}", "", $source);
    $proposition = str_replace("<div id=result_box dir=ltr>", "", $proposition);
    ### affichage du resultat
    return $proposition;
}
开发者ID:rhertzog,项目名称:lcs,代码行数:16,代码来源:language.lib.php


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