Beispiel #1
0
 public function __construct()
 {
     parent::__construct();
     $this->setExtensions(array('json-bl'));
     $this->removeState('init');
     $this->addStates(array('init' => array('trigger', 'action', 'value', 'char', 'number', 'comment', 'keyword' => array('', 'type', 'modifier', 'control', 'literal', 'operator'), 'identifier', 'operator')));
     $this->addRules(array('trigger' => array('url-filter-is-case-sensitive', 'url-filter', 'resource-type', 'load-type', 'if-domain', 'unless-domain'), 'action' => array('type', 'selector'), 'value' => new Rule('/(?<=:\\s)"/', '/"(\\n|}|,)/'), 'identifier' => array('trigger', 'action')));
     $this->addMappings(array('trigger' => 'keyword', 'action' => 'keyword', 'value' => 'string'));
 }
Beispiel #2
0
if ($is_viewAllowed || $is_postAllowed) {
    //notification commands should be handled by ajax calls
    if ('exNotify' == $cmd) {
        request_topic_notification($topicId, claro_get_current_user_id());
        $cmd = 'show';
    } elseif ('exdoNotNotify' == $cmd) {
        cancel_topic_notification($topicId, claro_get_current_user_id());
        $cmd = 'show';
    }
}
//load required js and css files
JavaScriptLoader::getInstance()->load('forum');
CssLoader::getInstance()->load('clfrm', 'screen');
// Javascript confirm pop up declaration for header
JavascriptLanguage::getInstance()->addLangVar('Are you sure to delete %name ?');
JavascriptLanguage::getInstance()->addLangVar('Do you really want to sign your contribution ?');
JavascriptLoader::getInstance()->load('forum');
// Prepare display
$out = '';
// Command list
$cmdList = array();
$nameTools = get_lang('Forums');
$pagetype = !empty($editMode) ? $editMode : 'viewtopic';
// The title is put in the $out var at the end of this script
if (claro_is_allowed_to_edit() && $topicId) {
    $out .= '<div style="float: right;">' . "\n" . '<img src=' . get_icon_url('html') . '" alt="" /> <a href="' . claro_htmlspecialchars(Url::Contextualize('export.php?type=HTML&topic=' . $topicId)) . '" target="_blank">' . get_lang('Export to HTML') . '</a>' . "\n" . '<img src="' . get_icon_url('mime/pdf') . '" alt="" /> <a href="' . claro_htmlspecialchars(Url::Contextualize('export.php?type=PDF&topic=' . $topicId)) . '" target="_blank">' . get_lang('Export to PDF') . '</a>' . "\n" . '</div>';
}
if ($topicSettingList) {
    $out .= disp_forum_breadcrumb($pagetype, $forumSettingList['forum_id'], $forumSettingList['forum_name'], $topicSettingList['topic_id'], $topicSettingList['topic_title']);
} else {
    $out .= disp_forum_breadcrumb($pagetype, $forumSettingList['forum_id'], $forumSettingList['forum_name']);
            }
        }
        break;
}
//------------------------------------
// FIND GLOBAL INFO SECTION
//------------------------------------
if (isset($uidToEdit)) {
    // get course user info
    $courseUserProperties = course_user_get_properties($uidToEdit, $cidToEdit);
}
//------------------------------------
// PREPARE DISPLAY
//------------------------------------
// Javascript confirm pop up declaration for header
JavascriptLanguage::getInstance()->addLangVar('Are you sure you want to unregister %name ?');
JavascriptLoader::getInstance()->load('admin');
$displayBackToCU = false;
$displayBackToUC = false;
if ('culist' == $ccfrom) {
    $displayBackToCU = TRUE;
} elseif ('uclist' == $ccfrom) {
    $displayBackToUC = TRUE;
}
$cmd_menu[] = '<a class="claroCmd" href="adminuserunregistered.php' . '?cidToEdit=' . $cidToEdit . '&amp;cmd=UnReg' . '&amp;uidToEdit=' . $uidToEdit . '" ' . ' onclick="return ADMIN.confirmationUnReg(\'' . clean_str_for_javascript(claro_htmlspecialchars($courseUserProperties['firstName']) . ' ' . claro_htmlspecialchars($courseUserProperties['lastName'])) . '\');">' . get_lang('Unsubscribe') . '</a>';
$cmd_menu[] = '<a class="claroCmd" href="admin_profile.php' . '?uidToEdit=' . $uidToEdit . '">' . get_lang('User settings') . '</a>';
//link to go back to list : depend where we come from...
if ($displayBackToCU) {
    $cmd_menu[] = '<a class="claroCmd" href="admincourseusers.php' . '?cidToEdit=' . $cidToEdit . '&amp;uidToEdit=' . $uidToEdit . '">' . get_lang('Back to list') . '</a> ';
} elseif ($displayBackToUC) {
    $cmd_menu[] = '<a class="claroCmd" href="adminusercourses.php' . '?cidToEdit=' . $cidToEdit . '&amp;uidToEdit=' . $uidToEdit . '">' . get_lang('Back to list') . '</a> ';
Beispiel #4
0
    }
    if (claro_is_course_manager()) {
        $cmdList[] = array('img' => 'mail_close', 'name' => get_lang('Messages to selected users'), 'url' => claro_htmlspecialchars(Url::Contextualize(get_path('clarolineRepositoryWeb') . 'messaging/messagescourse.php?from=clann')));
    }
    if ($announcementQty > 0) {
        $cmdList[] = array('img' => 'delete', 'name' => get_lang('Clear up list of announcements'), 'url' => claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=exDeleteAll')), 'params' => array('onclick' => 'return CLANN.confirmationDelAll()'));
    }
}
/**
 *  DISPLAY SECTION
 */
$nameTools = get_lang('Announcements');
$noQUERY_STRING = true;
// Javascript confirm pop up declaration for header
JavascriptLanguage::getInstance()->addLangVar('Are you sure you want to delete all the announcements ?');
JavascriptLanguage::getInstance()->addLangVar('Are you sure to delete %name ?');
JavascriptLoader::getInstance()->load('announcements');
$output = '';
if (!empty($subTitle)) {
    $titleParts = array('mainTitle' => $nameTools, 'subTitle' => $subTitle);
} else {
    $titleParts = $nameTools;
}
Claroline::getDisplay()->body->appendContent(claro_html_tool_title($titleParts, null, $cmdList));
Claroline::getDisplay()->body->appendContent($dialogBox->render());
/**
 * FORM TO FILL OR MODIFY AN ANNOUNCEMENT
 */
if ($displayForm) {
    // DISPLAY ADD ANNOUNCEMENT COMMAND
    // Ressource linker
Beispiel #5
0
$fileList = $fileLister->get_result_list();
/* > > > > > > END: COMMON TO TEACHERS AND STUDENTS < < < < < < <*/
/*= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
                                    DISPLAY
  = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
if ($docView == 'image') {
    $noQUERY_STRING = true;
    $claroBodyOnload[] = "CLDOC.zoomOut();";
}
$nameTools = get_lang("Documents and Links");
// Used for the breadcrumb when one need to add a parameter after the filename
$_SERVER['QUERY_STRING'] = '';
// Display (3 view modes: image, thumbnails or files)
JavascriptLanguage::getInstance()->addLangVar('Are you sure to delete %name ?');
JavascriptLanguage::getInstance()->addLangVar('Click to zoom out');
JavascriptLanguage::getInstance()->addLangVar('Click to zoom in');
JavascriptLoader::getInstance()->load('documents');
$out = '';
$dspCurDirName = claro_htmlspecialchars($curDirName);
$dspCurDirPath = claro_htmlspecialchars($curDirPath);
$cmdCurDirPath = rawurlencode($curDirPath);
$cmdParentDir = rawurlencode($parentDir);
// Define toot title and subtitle
$titleElement['mainTitle'] = get_lang("Documents and Links");
if (claro_is_in_a_group() && claro_is_group_allowed()) {
    $titleElement['supraTitle'] = claro_get_current_group_data('name');
}
// Get image list from file list
if (($docView == 'image' || $docView == 'thumbnails') && isset($fileList)) {
    $imageList = get_image_list($fileList, $is_allowedToEdit);
}
Beispiel #6
0
 /**
  * Render the HTML page header
  * @return  string
  */
 public function render()
 {
     $this->_globalVarsCompat();
     $this->addInlineJavascript(JavascriptLanguage::getInstance()->buildJavascript());
     $titlePage = '';
     if (empty($this->_toolName) && !empty($this->_nameTools)) {
         $titlePage .= $this->_nameTools . ' - ';
     } elseif (!empty($this->_toolName)) {
         $titlePage .= $this->_toolName . ' - ';
     }
     if (claro_is_in_a_course() && claro_get_current_course_data('officialCode') != '') {
         $titlePage .= claro_get_current_course_data('officialCode') . ' - ';
     }
     $titlePage .= get_conf('siteName');
     $this->assign('pageTitle', $titlePage);
     if (true === get_conf('warnSessionLost', true) && claro_get_current_user_id()) {
         $this->assign('warnSessionLost', "function claro_session_loss_countdown(sessionLifeTime){\n    var chrono = setTimeout('claro_warn_of_session_loss()', sessionLifeTime * 1000);\n}\n\nfunction claro_warn_of_session_loss() {\n    alert('" . clean_str_for_javascript(get_lang('WARNING ! You have just lost your session on the server.') . "\n" . get_lang('Copy any text you are currently writing and paste it outside the browser')) . "');\n}\n");
     } else {
         $this->assign('warnSessionLost', '');
     }
     $htmlXtraHeaders = '';
     if (!empty($this->_htmlXtraHeaders)) {
         $htmlXtraHeaders .= implode("\n", $this->_htmlXtraHeaders);
     }
     $this->assign('htmlScriptDefinedHeaders', $htmlXtraHeaders);
     return parent::render() . "\n";
 }
Beispiel #7
0
 public static function getInstance()
 {
     if (!self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Beispiel #8
0
//OLD TOOLS ;
$old_tool_array = array('CLANN', 'CLCAL', 'CLFRM', 'CLCHT', 'CLDOC', 'CLDSC', 'CLUSR', 'CLLNP', 'CLQWZ', 'CLWRK', 'CLWIKI', 'CLLNK', 'CLGRP');
//UNDEACTIVABLE    TOOLS array
$undeactivable_tool_array = get_not_deactivable_tool_list();
//NONUNINSTALABLE TOOLS array
$nonuninstalable_tool_array = get_not_uninstallable_tool_list();
//SQL table name
$tbl_name = claro_sql_get_main_tbl();
$tbl_module = $tbl_name['module'];
$tbl_dock = $tbl_name['dock'];
$tbl_course_tool = $tbl_name['tool'];
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Administration'), get_path('rootAdminWeb'));
$dialogBox = new DialogBox();
$nameTools = get_lang('Modules');
// Javascript confirm pop up declaration for header
JavascriptLanguage::getInstance()->addLangVar('Are you sure you want to uninstall the module %name ?');
JavascriptLoader::getInstance()->load('admin');
//CONFIG and DEVMOD vars :
//TODO remove pagination
$modulePerPage = 1000;
$typeLabel[''] = get_lang('No name');
$typeLabel['tool'] = get_lang('Tools');
$typeLabel['applet'] = get_lang('Applets');
$typeLabel['crsmanage'] = get_lang('Course management tools');
$typeLabel['admin'] = get_lang('Administration tools');
//$typeLabel['lang']    = get_lang('Language packs');
//$typeLabel['theme']   = get_lang('Themes');
//$typeLabel['extauth'] = get_lang('External authentication drivers');
$moduleTypeList = get_available_module_types();
$cmd = isset($_REQUEST['cmd']) ? $_REQUEST['cmd'] : null;
$module_id = isset($_REQUEST['module_id']) ? $_REQUEST['module_id'] : null;
Beispiel #9
0
    <script type="text/javascript">
        linkerFrontend.base_url = "<?php 
echo rtrim(get_path('url'), '/');
?>
/claroline/backends/linker.php";
        linkerFrontend.deleteIconUrl = "<?php 
echo get_icon_url('delete');
?>
";
        linkerFrontend.invisibleIconUrl = "<?php 
echo get_icon_url('invisible');
?>
";     
    </script>
    <?php 
echo JavascriptLanguage::getInstance()->buildJavascript();
?>
	<?php 
echo link_to_css(get_conf('claro_stylesheet') . '/main.css', 'screen, projection, tv');
?>
    <link rel="stylesheet" type="text/css" href="<?php 
echo rtrim(get_path('rootWeb'), '/');
?>
/web/css/classic/main.css" media="screen, projection, tv" />
</head>
<body>

<form onsubmit="DocumentsDialog.insert();return false;" action="#">
	<div>
		<fieldset>
			<legend><?php 
Beispiel #10
0
 public static function renderLinkerBlock($backendUrl = null)
 {
     if (empty($backendUrl)) {
         $backendUrl = get_path('clarolineRepositoryWeb') . 'backends/linker.php';
     }
     self::init();
     // Init Client Side Linker
     self::initUserAgent();
     JavascriptLanguage::getInstance()->addLangVar('Attach');
     JavascriptLanguage::getInstance()->addLangVar('Delete');
     JavascriptLanguage::getInstance()->addLangVar('The resource is invisible. Are you sure that you want to attach this resource ?');
     // init linkerFronted
     ClaroHeader::getInstance()->addInlineJavascript('linkerFrontend.base_url = "' . $backendUrl . '";' . "\n" . 'linkerFrontend.deleteIconUrl = "' . get_icon_url('delete') . '";' . "\n" . 'linkerFrontend.invisibleIconUrl = "' . get_icon_url('invisible') . '"; ' . "\n");
     return '<div id="lnk_panel">' . "\n" . '<div id="lnk_selected_resources"></div>' . "\n" . '<p id="lnk_toggle">' . "\n" . '<a href="#" id="lnk_show_browser" class="attach">' . get_lang('Attach an existing resource') . '</a>' . "\n" . '<a href="#" id="lnk_hide_browser">' . get_lang('Close') . '</a>' . "\n" . '</p>' . "\n" . '<div id="lnk_browser">' . "\n" . '<div id="lnk_ajax_loading"><img src="' . get_icon_url('loading') . '" alt="" /></div>' . "\n" . '<h4 id="lnk_location"></h4>' . "\n" . '<div id="lnk_back_link"></div>' . '<div id="lnk_resources"></div>' . "\n" . '</div>' . "\n" . '<div id="lnk_hidden_fields"></div>' . "\n" . '</div>' . "\n\n";
 }