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


PHP language::load_module_translation方法代码示例

本文整理汇总了PHP中language::load_module_translation方法的典型用法代码示例。如果您正苦于以下问题:PHP language::load_module_translation方法的具体用法?PHP language::load_module_translation怎么用?PHP language::load_module_translation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在language的用法示例。


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

示例1: install_module_at_course_creation

/**
 * Install module databases at course creation
 */
function install_module_at_course_creation($moduleLabel, $courseDbName, $language, $courseDirectory)
{
    $sqlPath = get_module_path($moduleLabel) . '/setup/course_install.sql';
    $phpPath = get_module_path($moduleLabel) . '/setup/course_install.php';
    if (file_exists($sqlPath)) {
        if (!execute_sql_at_course_creation($sqlPath, $courseDbName)) {
            return false;
        }
    }
    if (file_exists($phpPath)) {
        // include the language file with all language variables
        language::load_translation($language);
        language::load_locale_settings($language);
        language::load_module_translation($moduleLabel, $language);
        // define tables to use in php install scripts
        $courseDbName = get_conf('courseTablePrefix') . $courseDbName . get_conf('dbGlu');
        $moduleCourseTblList = claro_sql_get_course_tbl($courseDbName);
        /*
         * @todo select database should not be needed if the setup scripts are
         * well written !
         */
        if (!get_conf('singleDbEnabled')) {
            claro_sql_select_db($courseDbName);
        }
        require_once $phpPath;
    }
    return true;
}
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:add_course.lib.inc.php

示例2: uninstall_module

/**
 * Uninstall a specific module to the platform
 *
 * @param integer $moduleId the id of the module to uninstall
 * @return array( backlog, boolean )
 *      backlog object
 *      boolean true if the uninstall process suceeded, false otherwise
 * @todo remove the need of the Backlog and use Exceptions instead
 */
function uninstall_module($moduleId, $deleteModuleData = true)
{
    $success = true;
    $backlog = new Backlog();
    //first thing to do : deactivate the module
    // deactivate_module($moduleId);
    $moduleInfo = get_module_info($moduleId);
    if ($moduleInfo['type'] == 'tool' && $moduleId) {
        // 2- delete the module in the cours_tool table, used for every course creation
        list($backlog2, $success2) = unregister_module_from_courses($moduleId);
        if ($success2) {
            $backlog->success(get_lang('Module uninstalled in all courses'));
        } else {
            $backlog->append($backlog2);
        }
    }
    //Needed tables and vars
    $tbl = claro_sql_get_main_tbl();
    $backlog = new Backlog();
    // 0- find info about the module to uninstall
    $sql = "SELECT `label`\n              FROM `" . $tbl['module'] . "`\n             WHERE `id` = " . (int) $moduleId;
    $module = claro_sql_query_get_single_row($sql);
    if ($module == false) {
        $backlog->failure(get_lang("No module to uninstall"));
        $success = false;
    } else {
        // 1- Include the local 'uninstall.sql' and 'uninstall.php' file of the module if they exist
        // call uninstall.php first in case it requires module database schema to run
        if (isset($uninstallPhpScript)) {
            unset($uninstallPhpScript);
        }
        $uninstallPhpScript = get_module_path($module['label']) . '/setup/uninstall.php';
        if (file_exists($uninstallPhpScript)) {
            language::load_translation();
            language::load_locale_settings();
            language::load_module_translation($module['label']);
            load_module_config($module['label']);
            require $uninstallPhpScript;
            $backlog->info(get_lang('Module uninstallation script called'));
        }
        if (isset($uninstallSqlScript)) {
            unset($uninstallSqlScript);
        }
        $uninstallSqlScript = get_module_path($module['label']) . '/setup/uninstall.sql';
        if ($deleteModuleData && file_exists($uninstallSqlScript)) {
            $sql = file_get_contents($uninstallSqlScript);
            if (!empty($sql)) {
                $sql = str_replace('__CL_MAIN__', get_conf('mainTblPrefix'), $sql);
                if (false !== claro_sql_multi_query($sql)) {
                    $backlog->success(get_lang('Database uninstallation succeeded'));
                } else {
                    $backlog->failure(get_lang('Database uninstallation failed'));
                    $success = false;
                }
            }
        } elseif (!$deleteModuleData && file_exists($uninstallSqlScript)) {
            $backlog->info(get_lang('Database uninstallation skipped'));
        }
        // 2- delete related files and folders
        $modulePath = get_module_path($module['label']);
        if (file_exists($modulePath)) {
            if (claro_delete_file($modulePath)) {
                $backlog->success(get_lang('Delete scripts of the module'));
            } else {
                $backlog->failure(get_lang('Error while deleting the scripts of the module'));
                $success = false;
            }
        }
        //  delete the module in the cours_tool table, used for every course creation
        //retrieve this module_id first
        $sql = "SELECT id as tool_id FROM `" . $tbl['tool'] . "`\n                WHERE claro_label = '" . $module['label'] . "'";
        $tool_to_delete = claro_sql_query_get_single_row($sql);
        $tool_id = $tool_to_delete['tool_id'];
        $sql = "DELETE FROM `" . $tbl['tool'] . "`\n                WHERE claro_label = '" . $module['label'] . "'\n            ";
        claro_sql_query($sql);
        // 3- delete related entries in main DB
        $sql = "DELETE FROM `" . $tbl['module'] . "`\n                WHERE `id` = " . (int) $moduleId;
        claro_sql_query($sql);
        $sql = "DELETE FROM `" . $tbl['module_info'] . "`\n                WHERE `module_id` = " . (int) $moduleId;
        claro_sql_query($sql);
        $sql = "DELETE FROM `" . $tbl['module_contexts'] . "`\n                WHERE `module_id` = " . (int) $moduleId;
        claro_sql_query($sql);
        // 4-Manage right - Delete read action
        $action = new RightToolAction();
        $action->setName('read');
        $action->setToolId($tool_id);
        $action->delete();
        // Manage right - Delete edit action
        $action = new RightToolAction();
        $action->setName('edit');
        $action->setToolId($tool_id);
//.........这里部分代码省略.........
开发者ID:rhertzog,项目名称:lcs,代码行数:101,代码来源:manage.lib.php

示例3: get_lang

// Claroline's administration menu
$menu['AdminClaroline'][] = '<a href="http://www.claroline.net/index.php?plugin=formidable&controller=forms&frm_action=preview&form=o4x38v">' . get_lang('Register my campus') . '</a>';
$menu['AdminClaroline'][] = '<a href="http://forum.claroline.net/">' . get_lang('Support forum') . '</a>';
$menu['AdminClaroline'][] = '<a href="clarolinenews.php">' . get_lang('Claroline.net news') . '</a>';
// Technical's administration menu
$menu['AdminTechnical'][] = '<a href="technical/phpInfo.php">' . get_lang('System Info') . '</a>';
$menu['AdminTechnical'][] = '<a href="technical/files_stats.php">' . get_lang('Files statistics') . '</a>';
$menu['AdminTechnical'][] = '<a href="../tracking/platform_report.php">' . get_lang('Platform statistics') . '</a>';
$menu['AdminTechnical'][] = '<a href="campusProblem.php">' . get_lang('Scan technical fault') . '</a>';
$menu['AdminTechnical'][] = '<a href="upgrade/index.php">' . get_lang('Upgrade') . '</a>';
// Communication's administration menu
$menu['Communication'][] = '<a href="../messaging/admin.php">' . get_lang('Internal messaging') . '</a>';
$adminModuleList = get_admin_module_list(true);
if (count($adminModuleList) > 0) {
    foreach ($adminModuleList as $module) {
        language::load_module_translation($module['label']);
        $menu['ExtraTools'][] = '<a href="' . get_module_entry_url($module['label']) . '">' . get_lang($module['name']) . '</a>';
    }
}
// Deal with interbreadcrumbs and title variable
$nameTools = get_lang('Administration');
// No sense because not allowed with claro_is_platform_admin(),
// but claro_is_platform_admin() should be later replaced by
// get_user_property ('can view admin menu')
$is_allowedToAdmin = claro_is_platform_admin();
// Is our installation system accessible ?
if (file_exists('../install/index.php') && !file_exists('../install/.htaccess')) {
    // If yes, warn the administrator
    $dialogBox->warning(get_block('blockWarningRemoveInstallDirectory'));
}
$register_globals_value = ini_get('register_globals');
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:index.php

示例4: __construct

 public function __construct()
 {
     // HACK : force loading translation here to avoid having to rewrite the kernel !
     language::load_translation();
     language::load_locale_settings();
     language::load_module_translation();
     $this->header = ClaroHeader::getInstance();
 }
开发者ID:rhertzog,项目名称:lcs,代码行数:8,代码来源:display.lib.php

示例5: install_module_script_in_course

/**
 * Execute module initialization script in the given course
 * @param string $moduleLabel
 * @param string $courseId
 */
function install_module_script_in_course($moduleLabel, $courseId)
{
    $phpPath = get_module_path($moduleLabel) . '/setup/course_install.php';
    if (file_exists($phpPath)) {
        $courseDirectory = claro_get_current_course_data('path');
        $moduleCourseTblList = $courseTbl = claro_sql_get_course_tbl();
        // include the language file with all language variables
        language::load_translation();
        language::load_locale_settings();
        language::load_module_translation($moduleLabel);
        load_module_config($moduleLabel);
        require_once $phpPath;
    }
}
开发者ID:rhertzog,项目名称:lcs,代码行数:19,代码来源:module.lib.php

示例6: claro_disp_auth_form

// post kernel access check
if (claro_is_in_a_course()) {
    if (!(basename(php_self()) == 'courses.php' && isset($_REQUEST['cmd']) && $_REQUEST['cmd'] == 'exReg')) {
        if (!claro_is_course_allowed()) {
            if (!claro_is_user_authenticated()) {
                claro_disp_auth_form();
            } else {
                if (claro_get_current_course_data('access') == 'private' && !claro_is_course_member()) {
                    claro_die(get_lang("You have to be enroled to this course to access its contents") . '<br /><a href="' . claro_htmlspecialchars(get_path('clarolineRepositoryWeb') . 'auth/courses.php?cmd=exReg&course=' . claro_get_current_course_id()) . '">' . claro_html_icon('enroll') . ' ' . '<b>' . get_lang('Enrolment') . '</b>' . '</a>');
                } else {
                    claro_die(get_lang("Not allowed!"));
                }
            }
        }
    }
}
// group_space.php?registration=1&selfReg=1
if (claro_is_in_a_group()) {
    if (!(basename(php_self()) == 'group_space.php' && isset($_REQUEST['registration']) && $_REQUEST['registration'] == '1')) {
        if (!claro_is_group_allowed()) {
            if (!claro_is_user_authenticated()) {
                claro_disp_auth_form();
            } else {
                claro_die(get_lang("Not allowed!"));
            }
        }
    }
}
// FORCE reloading current module translation here
language::load_module_translation();
开发者ID:rhertzog,项目名称:lcs,代码行数:30,代码来源:claro_init_global.inc.php


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