Using $app['template'] instead of new Template

skala
Julio Montoya 12 years ago
parent 893f6afce3
commit b46d2ad26d
  1. 3
      main/admin/change_user_session.php
  2. 3
      main/admin/class_list.php
  3. 3
      main/admin/configure_plugin.php
  4. 3
      main/admin/course_add.php
  5. 3
      main/admin/course_list.php
  6. 33
      main/admin/event_controller.php
  7. 3
      main/admin/skills.php
  8. 3
      main/admin/skills_profile.php
  9. 3
      main/admin/skills_wheel.php
  10. 4
      main/admin/user_add.php
  11. 3
      main/admin/user_edit.php
  12. 3
      main/admin/user_list.php
  13. 3
      main/auth/my_progress.php
  14. 3
      main/auth/unsubscribe_account.php
  15. 3
      main/calendar/agenda_js.php
  16. 4
      main/course_home/course_home.php
  17. 3
      main/document/document_quota.php
  18. 3
      main/exercice/stats.php
  19. 2
      main/messages/inbox.php
  20. 5
      main/messages/new_message.php
  21. 4
      main/messages/outbox.php
  22. 4
      main/messages/view_message.php
  23. 4
      main/mySpace/company_reports.php
  24. 3
      main/mySpace/company_reports_resumed.php
  25. 1
      main/newscorm/lp_impress.php
  26. 3
      main/social/friends.php
  27. 2
      main/social/group_add.php
  28. 4
      main/social/group_edit.php
  29. 4
      main/social/group_invitation.php
  30. 5
      main/social/group_members.php
  31. 4
      main/social/group_topics.php
  32. 3
      main/social/group_waiting_list.php
  33. 3
      main/social/groups.php
  34. 4
      main/social/home.php
  35. 3
      main/social/invitations.php
  36. 3
      main/social/myfiles.php
  37. 3
      main/social/profile.php
  38. 3
      main/social/search.php
  39. 4
      main/social/skills_ranking.php
  40. 3
      main/social/skills_tree.php
  41. 5
      main/social/skills_wheel.php
  42. 4
      main/timeline/view.php
  43. 12
      main/work/view.php
  44. 4
      plugin/bbb/listing.php
  45. 4
      plugin/bbb/start.php

@ -81,8 +81,7 @@ $(document).ready(function() {
</script>';
$tpl = new Template();
$tpl = $app['template'];
$tpl->assign('message', $message);
$tpl->assign('content', $content);
$tpl->display_one_col_template();

@ -123,7 +123,8 @@ $actions .= Display::url(Display::return_icon('add.png', get_lang('Add'), array(
$actions .= Display::url(Display::return_icon('import_csv.png', get_lang('AddUsersToAClass'), array(), ICON_SIZE_MEDIUM), 'class_user_import.php');
$actions .= Display::url(Display::return_icon('import_csv.png', get_lang('ImportClassListCSV'), array(), ICON_SIZE_MEDIUM), 'class_import.php');
$tpl = new Template($tool_name);
$app['title'] = $tool_name;
$tpl = $app['template'];
$tpl->assign('content', $content);
$tpl->assign('actions', $actions);
$tpl->assign('message', $message);

@ -61,7 +61,8 @@ if (isset($form)) {
$message = Display::return_message(get_lang('Updated'), 'success');
}
}
$tpl = new Template($tool_name);
$app['title'] = $tool_name;
$tpl = $app['template'];
$tpl->assign('actions', $actions);
$tpl->assign('message', $message);
$tpl->assign('content', $content);

@ -156,6 +156,7 @@ if ($form->validate()) {
// Display the form.
$content = $form->return_form();
$tpl = new Template($tool_name);
$tpl = $app['template'];
$app['title'] = $tool_name;
$tpl->assign('content', $content);
$tpl->display_one_col_template();

@ -278,7 +278,8 @@ if (isset ($_GET['search']) && $_GET['search'] == 'advanced') {
$content .= $table->return_table();
}
$tpl = new Template($tool_name);
$app['title'] = $tool_name;
$tpl = $app['template'];
$tpl->assign('actions', $actions);
$tpl->assign('message', $message);
$tpl->assign('content', $content);

@ -19,26 +19,26 @@ if (api_get_setting('activate_email_template') != 'true') {
class eventController { // extends Controller {
public function showAction() {
}
public function newAction() {
}
public function addAction() {
}
public function listingAction() {
$event_email_template = new EventEmailTemplate();
return $event_email_template->display();
return $event_email_template->display();
}
public function deleteAction($id) {
$event_email_template = new EventEmailTemplate();
return $event_email_template->delete($id);
}
return $event_email_template->delete($id);
}
}
$event_controller = new eventController();
@ -67,7 +67,7 @@ switch ($action) {
//jqgrid will use this URL to do the selects
$url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_event_email_template';
//The order is important you need to check the the $column variable in the model.ajax.php file
//The order is important you need to check the the $column variable in the model.ajax.php file
$columns = array(get_lang('Subject'), get_lang('EventTypeName'), get_lang('Language'), get_lang('Status'), get_lang('Actions'));
//Column config
@ -78,23 +78,24 @@ $column_model = array(
array('name'=>'language_id', 'index'=>'language_id', 'width'=>'80', 'align'=>'left'),
array('name'=>'activated', 'index'=>'activated', 'width'=>'80', 'align'=>'left'),
array('name'=>'actions', 'index'=>'actions', 'width'=>'100')
);
//Autowidth
);
//Autowidth
$extra_params['autowidth'] = 'true';
//height auto
//height auto
$extra_params['height'] = 'auto';
$htmlHeadXtra[] = api_get_jqgrid_js();
$htmlHeadXtra[] = '<script>
$(function() {
'.Display::grid_js('event_email_template', $url,$columns,$column_model,$extra_params, array(), $action_links,true).'
'.Display::grid_js('event_email_template', $url,$columns,$column_model,$extra_params, array(), $action_links,true).'
});
</script>';
$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Events'));
$tpl = new Template($tool_name);
$app['title'] = $tool_name;
$tpl = $app['template'];
$tpl->assign('actions', $actions);
$tpl->assign('message', $message);
$tpl->assign('content', $content);

@ -33,8 +33,7 @@ $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);
$tpl = $app['template'];
$tpl->assign('url', $url);
$tpl->assign('html', $html);

@ -30,7 +30,8 @@ $skill_rel_user = new SkillRelUser();
$url = api_get_path(WEB_AJAX_PATH).'skill.ajax.php';
$tpl = new Template(get_lang('Skills'));
$tpl['title'] = get_lang('Skills');
$tpl = $app['template'];
$form = new FormValidator('profile_search');

@ -27,8 +27,7 @@ $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();
$tpl = $app['template'];
$load_user = 0;
if (isset($_GET['load_user'])) {

@ -416,8 +416,8 @@ if (!empty($message)) {
}
$content = $form->return_form();
$tpl = new Template($tool_name);
//$tpl->assign('actions', $actions);
$app['title'] = $tool_name;
$tpl = $app['template'];
$tpl->assign('message', $message);
$tpl->assign('content', $content);
$tpl->display_one_col_template();

@ -492,7 +492,8 @@ if ($image == '') {
// Display form
$content .= $form->return_form();
$tpl = new Template($tool_name);
$app['title'] = $tool_name;
$tpl = $app['template'];
$tpl->assign('message', $message);
$tpl->assign('content', $content);
$tpl->display_one_col_template();

@ -887,7 +887,8 @@ if ($table->get_total_number_of_items() == 0) {
}
}
$tpl = new Template($tool_name);
$app['title'] = $tool_name;
$tpl = $app['template'];
$tpl->assign('actions', $actions);
$tpl->assign('message', $message);

@ -108,7 +108,8 @@ if (empty($content)) {
$message = Display::return_message(get_lang('NoDataAvailable'), 'warning');
}
$tpl = new Template($tool_name);
$app['title'] = $tool_name;
$tpl = $app['template'];
$tpl->assign('message', $message);
$tpl->assign('content', $content);

@ -25,7 +25,8 @@ if ($form->validate()) {
}
}
$tpl = new Template($tool_name);
$app['title'] = $tool_name;
$tpl = $app['template'];
$tpl->assign('actions', $actions);
$tpl->assign('message', $message);
$tpl->assign('content', $content);

@ -57,7 +57,8 @@ if (!empty($group_id)) {
$interbreadcrumb[] = array ("url"=>"../group/group_space.php?gidReq=".$group_id, "name"=> get_lang('GroupSpace').' '.$group_properties['name']);
}
$tpl = new Template(get_lang('Agenda'));
$app['title'] = get_lang('Agenda');
$tpl = $app['template'];
$tpl->assign('use_google_calendar', 0);

@ -254,10 +254,6 @@ if (api_get_setting('homepage_view') == 'activity' || api_get_setting('homepage_
require 'vertical_activity.php';
}
$content = '<div id="course_tools">'.$content.'</div>';
//$tpl = new Template(null);
//$tpl->assign('message', $show_message);
//$tpl->assign('content', $content);
//$tpl->display_one_col_template();
Session::erase('_gid');
return array('content' => $content, 'message' => $show_message);

@ -136,7 +136,8 @@ $(document).ready(function(){
});
</script>";
$tpl = new Template($tool_name);
$app['title'] = $tool_name;
$tpl = $app['template'];
$content = Display::page_subheader(get_lang('ShowCourseQuotaUse')).'<div id="chart1"></div>';
$tpl->assign('content', $content);
$tpl->display_one_col_template();

@ -236,7 +236,8 @@ $content .= $table->toHtml();
$interbreadcrumb[] = array ("url" => "exercice.php?gradebook=$gradebook", "name" => get_lang('Exercices'));
$interbreadcrumb[] = array ("url" => "admin.php?exerciseId=$exercise_id","name" => $objExercise->name);
$tpl = new Template(get_lang('ReportByQuestion'));
$app['title'] = get_lang('ReportByQuestion');
$tpl = $app['template'];
//$actions = array();
//$actions[]= array(get_lang('Back'), Display::return_icon('back.png', get_lang('Back'), 'exercise_report.php?'.$exercise_id));

@ -167,7 +167,7 @@ if (api_get_setting('allow_social_tool') == 'true') {
$social_right_content .= '</div>';
}
$tpl = new Template(null);
$tpl = $app['template'];
if (api_get_setting('allow_social_tool') == 'true') {
$tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_right_content', $social_right_content);

@ -218,7 +218,7 @@ function manage_form($default, $select_from_user_list = null, $sent_to = null) {
$form->addElement('style_submit_button','compose',api_xml_http_response_encode(get_lang('SendMessage')),'class="save"');
$form->setRequiredNote('<span class="form_required">*</span> <small>'.get_lang('ThisFieldIsRequired').'</small>');
if (!empty($group_id) && !empty($message_id)) {
$message_info = MessageManager::get_message_by_id($message_id);
$default['title'] = get_lang('MailSubjectReplyShort')." ".$message_info['title'];
@ -353,8 +353,9 @@ if (!isset($_POST['compose'])) {
if (api_get_setting('allow_social_tool') == 'true') {
$social_right_content .= '</div>';
}
$app['title'] = get_lang('ComposeMessage');
$tpl = $app['template'];
$tpl = new Template(get_lang('ComposeMessage'));
if (api_get_setting('allow_social_tool') == 'true') {
$tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_right_content', $social_right_content);

@ -150,7 +150,9 @@ if (api_get_setting('allow_social_tool') == 'true') {
$social_right_content .= '</div>';
}
$tpl = new Template(get_lang('ComposeMessage'));
$app['title'] = get_lang('ComposeMessage');
$tpl = $app['template'];
if (api_get_setting('allow_social_tool') == 'true') {
$tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_left_menu', $social_left_menu);

@ -78,7 +78,9 @@ if (!empty($message)) {
}
$tpl = new Template(get_lang('View'));
$app['title'] = get_lang('View');
$tpl = $app['template'];
if (api_get_setting('allow_social_tool') == 'true') {
$tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_right_content', $social_right_content);

@ -74,6 +74,8 @@ $(function() {
</script>';
$content = Display::grid_html('user_course_report');
$tpl = new Template($tool_name);
$app['title'] = $tool_name;
$tpl = $app['template'];
$tpl->assign('content', $content);
$tpl->display_one_col_template();

@ -58,6 +58,7 @@ $(function() {
</script>';
$content = Display::grid_html('user_course_report');
$tpl = new Template($tool_name);
$app['title'] = $tool_name;
$tpl = $app['template'];
$tpl->assign('content', $content);
$tpl->display_one_col_template();

@ -83,7 +83,6 @@ foreach ($list as $toc) {
}
//Setting the template
//$tpl = new Template($tool_name, false, false, true);
$app['template']->assign('html', $html);
$content = $app['template']->fetch('default/learnpath/impress.tpl');
$app['template']->assign('content', $content);

@ -140,7 +140,8 @@ if (count($friends) == 0) {
$social_right_content .= '</div>';
$tpl = new Template(get_lang('Social'));
$app['title'] = get_lang('Social');
$tpl = $app['template'];
$tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_right_content', $social_right_content);

@ -46,7 +46,7 @@ $social_right_content = '<div class="span9">';
$social_right_content .= $form->return_form();
$social_right_content .= '</div>';
$tpl = new Template();
$tpl = $app['template'];
$tpl->set_help('Groups');
$tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_right_content', $social_right_content);

@ -67,7 +67,9 @@ $social_right_content = '<div class="span9">';
$social_right_content .= $form->return_form();
$social_right_content .= '</div>';
$tpl = new Template($tool_name);
$app['title'] = $tool_name;
$tpl = $app['template'];
$tpl->set_help('Groups');
$tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_right_content', $social_right_content);

@ -512,7 +512,9 @@ function makepost(select) {
$social_right_content = Display::div($social_right_content, array('class' => 'span9'));
$tpl = new Template($tool_name);
$app['title'] = $tool_name;
$tpl = $app['template'];
$tpl->set_help('Groups');
$tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_right_content', $social_right_content);

@ -120,7 +120,10 @@ if (count($new_member_list) > 0) {
}
$social_right_content = '<div class="span9">'.$social_right_content.'</div>';
$tpl = new Template(get_lang('Social'));
$app['title'] = get_lang('Social');
$tpl = $app['template'];
$tpl->set_help('Groups');
$tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_right_content', $social_right_content);

@ -192,7 +192,9 @@ if (!empty($show_message)) {
$social_right_content .= MessageManager::display_message_for_group($group_id, $topic_id, $is_member, $message_id);
$social_right_content = '<div class="span9">'.$social_right_content.'</div>';
$tpl = new Template(get_lang('Social'));
$app['title'] = get_lang('Social');
$tpl = $app['template'];
$tpl->set_help('Groups');
$tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_right_content', $social_right_content);

@ -103,7 +103,8 @@ if (count($new_member_list) > 0) {
}
$social_right_content .= '</div>';
$tpl = new Template();
$tpl = $app['template'];
$tpl->set_help('Groups');
$tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_right_content', $social_right_content);

@ -533,7 +533,8 @@ if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'show_message' && isset
$show_message = Display::return_message(get_lang('Deleted'), 'success');
}
$tpl = new Template();
$tpl = $app['template'];
$tpl->set_help('Groups');
$tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_right_content', $social_right_content);

@ -163,7 +163,9 @@ $social_right_content .= '
}
$social_right_content .= '</div>';
$tpl = new Template(get_lang('SocialNetwork'));
$app['title'] = get_lang('SocialNetwork');
$tpl = $app['template'];
$tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_right_content', $social_right_content);
$social_layout = $tpl->get_template('layout/social_layout.tpl');

@ -188,7 +188,8 @@ if (count($pending_invitations) > 0) {
$social_right_content = Display::div($social_right_content, array('class' => 'span9'));
$tpl = new Template(null);
$tpl = $app['template'];
$tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_right_content', $social_right_content);

@ -103,8 +103,9 @@ $social_right_content = '<div class="span9">';
$social_right_content .= '<iframe name="fileManager" id="fileManager" src="'.api_get_path(WEB_PATH).'main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/ajaxfilemanager.php?editor=stand_alone" scrolling="no" noresize="noresize" frameborder="no" style="height:480px; width:100%; float:left"></iframe>';
$social_right_content .= '</div>';
$app['title'] = get_lang('Social');
$tpl = $app['template'];
$tpl = new Template();
$tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_right_content', $social_right_content);

@ -670,8 +670,9 @@ if ($show_full_profile) {
$social_right_content .= MessageManager::generate_message_form('send_message');
$social_right_content .= MessageManager::generate_invitation_form('send_invitation');
$app['title'] = get_lang('Social');
$tpl = $app['template'];
$tpl = new Template(get_lang('Social'));
$tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_right_content', $social_right_content);
$social_layout = $tpl->get_template('layout/social_layout.tpl');

@ -112,8 +112,9 @@ if ($query !='') {
$social_right_content .= Display::return_sortable_grid('mygroups', array(), $grid_groups, array('hide_navigation'=>true, 'per_page' => 5), $query_vars, false, $visibility);
}
$app['title'] = $tool_name;
$tpl = $app['template'];
$tpl = new Template($tool_name);
$tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_right_content', $social_right_content);

@ -50,8 +50,8 @@ $jqgrid = Display::grid_js('skill_ranking', $url,$columns,$column_model,$extra_p
$content = Display::grid_html('skill_ranking');
$tpl = new Template($tool_name);
$app['title'] = $tool_name;
$tpl = $app['template'];
$tpl->assign('actions', $actions);
$tpl->assign('message', $message);

@ -31,8 +31,7 @@ $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();
$tpl = $app['template'];
$tpl->assign('url', $url);
$tpl->assign('skill_visualizer', $skill_visualizer);

@ -27,9 +27,7 @@ $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();
$tpl = $app['template'];
$load_user = api_get_user_id();
@ -42,7 +40,6 @@ if (isset($_GET['skill_id'])) {
$url = api_get_path(WEB_AJAX_PATH)."skill.ajax.php?a=get_skills_tree_json&load_user=$load_user";
$tpl->assign('wheel_url', $url);
$url = api_get_path(WEB_AJAX_PATH).'skill.ajax.php?1=1';
$tpl->assign('url', $url);

@ -31,7 +31,9 @@ $htmlHeadXtra[] = '
</script>';
$content = '<div class="timeline-example"><div id="timeline"></div></div>';
$tpl = new Template($tool_name);
$app['title'] = $tool_name;
$tpl = $app['template'];
$tpl->assign('actions', $actions);
$tpl->assign('message', $message);
$tpl->assign('content', $content);

@ -20,17 +20,17 @@ $course_info = api_get_course_info();
if (user_is_author($id) || $course_info['show_score'] == 0 && $work['active'] == 1 && $work['accepted'] == 1) {
$url_dir = 'work.php?&id=' . $my_folder_data['id'];
$interbreadcrumb[] = array ('url' => $url_dir,'name' => $my_folder_data['title']);
$interbreadcrumb[] = array ('url' => '#','name' => $work['title']);
$interbreadcrumb[] = array ('url' => $url_dir,'name' => $my_folder_data['title']);
$interbreadcrumb[] = array ('url' => '#','name' => $work['title']);
if (($course_info['show_score'] == 0 && $work['active'] == 1 && $work['accepted'] == 1) || api_is_allowed_to_edit() || ($work['user_id'] == api_get_user_id() && $work['active'] == 1 && $work['accepted'] == 1)) {
$tpl = new Template();
$tpl = $app['template'];
$tpl->assign('work', $work);
$template = $tpl->get_template('work/view.tpl');
$template = $tpl->get_template('work/view.tpl');
$content = $tpl->fetch($template);
$tpl->assign('content', $content);
$tpl->display_one_col_template();
$tpl->display_one_col_template();
} else {
api_not_allowed();
api_not_allowed();
}
}

@ -11,7 +11,8 @@ $course_plugin = 'bbb'; //needed in order to load the plugin lang variables
require_once dirname(__FILE__).'/config.php';
$plugin = BBBPlugin::create();
$tool_name = $plugin->get_lang('Videoconference');
$tpl = new Template($tool_name);
$tpl = $app['template'];
$bbb = new bbb();
$action = isset($_GET['action']) ? $_GET['action'] : null;
@ -90,7 +91,6 @@ $tpl->assign('users_online', $users_online);
$tpl->assign('bbb_status', $status);
$tpl->assign('show_join_button', $show_join_button);
//$tpl->assign('actions', $actions);
$tpl->assign('message', $message);
$listing_tpl = 'bbb/listing.tpl';
$content = $tpl->fetch($listing_tpl);

@ -10,7 +10,9 @@
$course_plugin = 'bbb'; //needed in order to load the plugin lang variables
require_once dirname(__FILE__).'/config.php';
$tool_name = get_lang('Videoconference');
$tpl = new Template($tool_name);
$app['title'] = $tool_name;
$tpl = $app['template'];
$bbb = new bbb();
if ($bbb->plugin_enabled) {

Loading…
Cancel
Save