Fixing PHP warnings due some changes in the Template class

skala
Julio Montoya 13 years ago
parent 06a111a552
commit 7eb8b9fc90
  1. 8
      main/admin/configure_plugin.php
  2. 3
      main/admin/skills.php
  3. 3
      main/admin/skills_wheel.php
  4. 24
      main/inc/lib/display.lib.php
  5. 13
      main/inc/lib/main_api.lib.php
  6. 1
      main/inc/lib/template.lib.php
  7. 15
      main/newscorm/lp_impress.php
  8. 4
      main/social/skills_tree.php
  9. 3
      main/social/skills_wheel.php

@ -33,7 +33,7 @@ global $_configuration;
$content = null;
if (isset($plugin_info['settings_form'])) {
$form = $plugin_info['settings_form'];
$form = $plugin_info['settings_form'];
if (isset($form)) {
//We override the form attributes
$attributes = array('action'=>api_get_self().'?name='.$plugin_name, 'method'=>'POST');
@ -48,7 +48,7 @@ if (isset($plugin_info['settings_form'])) {
if (isset($form)) {
if ($form->validate()) {
$values = $form->exportValues();
//api_delete_category_settings_by_subkey($plugin_name);
$access_url_id = api_get_current_access_url_id();
api_delete_settings_params(array('category = ? AND access_url = ? AND subkey = ? AND type = ? and variable <> ?' =>
@ -56,12 +56,12 @@ if (isset($form)) {
foreach ($values as $key => $value) {
$key = Database::escape_string($plugin_name.'_'.$key);
api_add_setting($value, $key, $plugin_name, 'setting', 'Plugins', $plugin_name, null, null, null, $_configuration['access_url'], 1);
}
$message = Display::return_message(get_lang('Updated'), 'success');
}
}
$tpl = new Template($tool_name, true, true, false, true, false);
$tpl = new Template($tool_name);
$tpl->assign('actions', $actions);
$tpl->assign('message', $message);
$tpl->assign('content', $content);

@ -33,7 +33,8 @@ $skill_visualizer = new SkillVisualizer($tree, $type);
$html = $skill_visualizer->return_html();
$url = api_get_path(WEB_AJAX_PATH).'skill.ajax.php?1=1';
$tpl = new Template(null, false, false);
//$tpl = new Template(null, false, false);
$tpl = new Template(null);
$tpl->assign('url', $url);
$tpl->assign('html', $html);

@ -27,7 +27,8 @@ $htmlHeadXtra[] = api_get_js('d3/jquery.xcolor.js');
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/tag/jquery.fcbkcomplete.js" type="text/javascript" language="javascript"></script>';
$htmlHeadXtra[] = '<link href="'.api_get_path(WEB_LIBRARY_PATH).'javascript/tag/style.css" rel="stylesheet" type="text/css" />';
$tpl = new Template(null, false, false);
//$tpl = new Template(null, false, false);
$tpl = new Template();
$load_user = 0;
if (isset($_GET['load_user'])) {

@ -49,24 +49,32 @@ class Display {
* Displays the reduced page header (without banner)
*/
public static function display_reduced_header() {
global $show_learnpath, $tool_name;
self::$global_template = new Template($tool_name, false, false, $show_learnpath);
global $show_learnpath, $tool_name, $app;
$app['template.show_header'] = false;
$app['template.show_footer'] = false;
$app['template.show_learnpath'] = $show_learnpath;
self::$global_template = new Template($tool_name);
echo self::$global_template ->show_header_template();
}
public static function display_no_header() {
global $tool_name;
global $tool_name, $app, $show_learnpath;
$disable_js_and_css_files = true;
self::$global_template = new Template($tool_name, false, false, $show_learnpath);
//echo self::$global_template->show_header_template();
$app['template.show_header'] = false;
$app['template.show_footer'] = false;
$app['template.show_learnpath'] = $show_learnpath;
self::$global_template = new Template($tool_name);
}
/**
* Displays the reduced page header (without banner)
*/
public static function set_header() {
global $show_learnpath;
self::$global_template = new Template($tool_name, false, false, $show_learnpath);
global $tool_name, $show_learnpath, $app;
$app['template.show_header'] = false;
$app['template.show_footer'] = false;
$app['template.show_learnpath'] = $show_learnpath;
self::$global_template = new Template($tool_name);
}
/**
@ -1474,4 +1482,4 @@ class Display {
}
return $html;
}
} //end class Display
} //end class Display

@ -2900,12 +2900,17 @@ function api_is_anonymous($user_id = null, $db_check = false) {
* @todo use templates to customize the not found page
*/
function api_not_found($print_headers = false) {
global $app;
$origin = isset($_GET['origin']) ? $_GET['origin'] : '';
$show_headers = 0;
if ((!headers_sent() || $print_headers) && $origin != 'learnpath') {
$show_headers = 1;
}
$tpl = new Template(null, $show_headers, $show_headers);
//$tpl = new Template(null, $show_headers, $show_headers);
$app['template.show_header'] = $show_headers;
$app['template.show_footer'] = $show_headers;
$tpl = new Template(null);
$msg = get_lang('NotFound');
$tpl->assign('content', $msg);
$tpl->display_one_col_template();
@ -2923,6 +2928,7 @@ function api_not_found($print_headers = false) {
* @version dokeos 1.8, August 2006
*/
function api_not_allowed($print_headers = false, $message = null) {
global $app;
if (api_get_setting('sso_authentication') === 'true') {
global $osso;
if ($osso) {
@ -2962,7 +2968,10 @@ function api_not_allowed($print_headers = false, $message = null) {
$show_headers = 1;
}
$tpl = new Template(null, $show_headers, $show_headers);
$app['template.show_header'] = $show_headers;
$app['template.show_footer'] = $show_headers;
$tpl = new Template();
$tpl->assign('content', $msg);
if (($user_id!=0 && !api_is_anonymous()) && (!isset($course) || $course == -1) && empty($_GET['cidReq'])) {

@ -32,7 +32,6 @@ class Template {
public $app;
function __construct($title = null, $app = null) {
if (empty($app)) {
global $app;
$this->app = $app;

@ -20,8 +20,8 @@ $show_learnpath = true;
api_protect_course_script();
/*
* Only activate impress if you're the admin
/*
* Only activate impress if you're the admin
*/
if (!api_is_platform_admin()) {
@ -30,10 +30,10 @@ if (!api_is_platform_admin()) {
$lp_id = intval($_GET['lp_id']);
// Check if the learning path is visible for student - (LP requisites)
// Check if the learning path is visible for student - (LP requisites)
if (!api_is_allowed_to_edit(null, true) && !learnpath::is_lp_visible_for_student($lp_id, api_get_user_id())) {
api_not_allowed();
}
}
//Checking visibility (eye icon)
$visibility = api_get_item_visibility(api_get_course_info(), TOOL_LEARNPATH, $lp_id, $action, api_get_user_id(), api_get_session_id());
@ -65,17 +65,18 @@ foreach ($list as $toc) {
//data-x="850" data-y="3000" data-rotate="90" data-scale="5"
$html .= '<div id="step-'.$step.'" class="step slide" data-x="'.$x.'" data-y="-1500" >';
$html .= '<h2>'.$toc['title'].'</h2>';
$src = $_SESSION['oLP']->get_link('http', $toc['id']);
//just showing the src in a iframe ...
$html .= '<iframe border="0" frameborder="0" style="width:100%;height:600px" src="'.$src.'"></iframe>';
$html .= "</div>\n";
$step ++;
}
//Setting the template
$tpl = new Template($tool_name, false, false, true);
//$tpl = new Template($tool_name, false, false, true);
$tpl = new Template($tool_name);
$tpl->assign('html', $html);
$content = $tpl->fetch('default/learnpath/impress.tpl');
$tpl->assign('content', $content);

@ -32,7 +32,9 @@ $type = 'read'; //edit
$tree = $skill->get_skills_tree(api_get_user_id(), null, true);
$skill_visualizer = new SkillVisualizer($tree, $type);
$url = api_get_path(WEB_AJAX_PATH).'skill.ajax.php?1=1';
$tpl = new Template(null, false, false);
//$tpl = new Template(null, false, false);
$tpl = new Template();
$tpl->assign('url', $url);
$tpl->assign('skill_visualizer', $skill_visualizer);

@ -28,7 +28,8 @@ $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/tag
$htmlHeadXtra[] = '<link href="'.api_get_path(WEB_LIBRARY_PATH).'javascript/tag/style.css" rel="stylesheet" type="text/css" />';
$tpl = new Template(null, false, false);
//$tpl = new Template(null, false, false);
$tpl = new Template();
$load_user = api_get_user_id();

Loading…
Cancel
Save