Minor - cosmetic changes

skala
Julio Montoya 13 years ago
parent 0095539f75
commit 8ca3664eac
  1. 32
      composer.lock
  2. 4
      main/css/base.css
  3. 2
      main/exercice/stats.php
  4. 28
      main/inc/global.inc.php
  5. 2
      main/inc/lib/main_api.lib.php
  6. 71
      main/inc/lib/template.lib.php

32
composer.lock generated

@ -11,12 +11,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/chamilo/chash.git", "url": "https://github.com/chamilo/chash.git",
"reference": "f4c4747cd6c9d016dc9da0c67df92817b054de14" "reference": "4d3ad62b395fe7f5ed39fc2eeb0980fb40cbccb7"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/chamilo/chash/zipball/f4c4747cd6c9d016dc9da0c67df92817b054de14", "url": "https://api.github.com/repos/chamilo/chash/zipball/4d3ad62b395fe7f5ed39fc2eeb0980fb40cbccb7",
"reference": "f4c4747cd6c9d016dc9da0c67df92817b054de14", "reference": "4d3ad62b395fe7f5ed39fc2eeb0980fb40cbccb7",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -31,7 +31,7 @@
} }
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
"time": "2013-04-15 07:10:00" "time": "2013-04-16 09:34:42"
}, },
{ {
"name": "dflydev/doctrine-orm-service-provider", "name": "dflydev/doctrine-orm-service-provider",
@ -636,12 +636,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/avalanche123/Imagine.git", "url": "https://github.com/avalanche123/Imagine.git",
"reference": "38c704dfac479c01bcb61341e477fe167bcb7958" "reference": "29325ba55cdd1a20bc8143bc5b5570e2c5c6c441"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/avalanche123/Imagine/zipball/38c704dfac479c01bcb61341e477fe167bcb7958", "url": "https://api.github.com/repos/avalanche123/Imagine/zipball/29325ba55cdd1a20bc8143bc5b5570e2c5c6c441",
"reference": "38c704dfac479c01bcb61341e477fe167bcb7958", "reference": "29325ba55cdd1a20bc8143bc5b5570e2c5c6c441",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -680,7 +680,7 @@
"image manipulation", "image manipulation",
"image processing" "image processing"
], ],
"time": "2013-04-11 19:58:00" "time": "2013-04-15 22:34:20"
}, },
{ {
"name": "jmontoyaa/phpqrcode", "name": "jmontoyaa/phpqrcode",
@ -730,12 +730,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/KnpLabs/KnpMenu.git", "url": "https://github.com/KnpLabs/KnpMenu.git",
"reference": "730bc37232f5f813822acf80edfbd89381ea5971" "reference": "5cf5ab4948d8c573f260e2b612bfc9721da1c892"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/KnpLabs/KnpMenu/zipball/730bc37232f5f813822acf80edfbd89381ea5971", "url": "https://api.github.com/repos/KnpLabs/KnpMenu/zipball/5cf5ab4948d8c573f260e2b612bfc9721da1c892",
"reference": "730bc37232f5f813822acf80edfbd89381ea5971", "reference": "5cf5ab4948d8c573f260e2b612bfc9721da1c892",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -786,7 +786,7 @@
"menu", "menu",
"tree" "tree"
], ],
"time": "2012-12-27 13:04:16" "time": "2013-04-15 14:10:52"
}, },
{ {
"name": "knplabs/knp-snappy", "name": "knplabs/knp-snappy",
@ -1534,12 +1534,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/Form.git", "url": "https://github.com/symfony/Form.git",
"reference": "4ec63437dda78313f60d05c9ba6441290dfa3de1" "reference": "f9d814a79ac38de448eb27512d78c87b147c68a7"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/Form/zipball/4ec63437dda78313f60d05c9ba6441290dfa3de1", "url": "https://api.github.com/repos/symfony/Form/zipball/f9d814a79ac38de448eb27512d78c87b147c68a7",
"reference": "4ec63437dda78313f60d05c9ba6441290dfa3de1", "reference": "f9d814a79ac38de448eb27512d78c87b147c68a7",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1584,7 +1584,7 @@
], ],
"description": "Symfony Form Component", "description": "Symfony Form Component",
"homepage": "http://symfony.com", "homepage": "http://symfony.com",
"time": "2013-04-11 06:50:46" "time": "2013-04-15 11:52:45"
}, },
{ {
"name": "symfony/http-foundation", "name": "symfony/http-foundation",

@ -1014,7 +1014,7 @@ a.personal_agenda:hover, a.personal_agenda:hover {
.message-group-content { .message-group-content {
float: right; float: right;
width: 90%; width: 93%;
line-height: 100%; line-height: 100%;
} }
@ -1412,7 +1412,7 @@ div.attendance-calendar-add div.row div.formw, div.attendance-calendar-edit div.
} }
.message-group-content { .message-group-content {
margin: 5px 0px 8px 0px; margin: 0px 0px 8px 0px;
} }
.message-group-date { .message-group-date {

@ -240,7 +240,7 @@ $tpl = new Template(get_lang('ReportByQuestion'));
//$actions = array(); //$actions = array();
//$actions[]= array(get_lang('Back'), Display::return_icon('back.png', get_lang('Back'), 'exercise_report.php?'.$exercise_id)); //$actions[]= array(get_lang('Back'), Display::return_icon('back.png', get_lang('Back'), 'exercise_report.php?'.$exercise_id));
//$tpl->set_actions($actions); //$tpl->setActions($actions);
$actions = '<a href="exercise_report.php?exerciseId='.intval($_GET['exerciseId']).'">' . Display :: return_icon('back.png', get_lang('GoBackToQuestionList'),'',ICON_SIZE_MEDIUM).'</a>'; $actions = '<a href="exercise_report.php?exerciseId='.intval($_GET['exerciseId']).'">' . Display :: return_icon('back.png', get_lang('GoBackToQuestionList'),'',ICON_SIZE_MEDIUM).'</a>';
$actions = Display::div($actions, array('class'=> 'actions')); $actions = Display::div($actions, array('class'=> 'actions'));

@ -528,19 +528,6 @@ if ($app['debug'] && isset($_configuration['main_database'])) {
}); });
} }
//Default template settings loaded in template.inc.php
$app['template.show_header'] = true;
$app['template.show_footer'] = true;
$app['template.show_learnpath'] = true;
$app['template.hide_global_chat'] = true;
$app['template.load_plugins'] = true;
//Default template style
$app['template_style'] = 'default';
//Default layout
$app['default_layout'] = $app['template_style'].'/layout/layout_1_col.tpl';
//Database constants //Database constants
require_once $libPath.'database.constants.inc.php'; require_once $libPath.'database.constants.inc.php';
require_once $libPath.'events.lib.inc.php'; require_once $libPath.'events.lib.inc.php';
@ -966,6 +953,21 @@ if (empty($default_quota)) {
define('DEFAULT_DOCUMENT_QUOTA', $default_quota); define('DEFAULT_DOCUMENT_QUOTA', $default_quota);
//Default template settings loaded in template.inc.php
$app['template.show_header'] = true;
$app['template.show_footer'] = true;
$app['template.show_learnpath'] = false;
$app['template.hide_global_chat'] = !api_is_global_chat_enabled();
$app['template.load_plugins'] = true;
//Default template style
$app['template_style'] = 'default';
//Default layout
$app['default_layout'] = $app['template_style'].'/layout/layout_1_col.tpl';
//Controller as services definitions //Controller as services definitions
$app['pages.controller'] = $app->share(function () use ($app) { $app['pages.controller'] = $app->share(function () use ($app) {

@ -4485,7 +4485,7 @@ function api_get_access_urls($from = 0, $to = 1000000, $order = 'url', $directio
/** /**
* Gets the access url info in an array * Gets the access url info in an array
* @param id of the access url * @param int id of the access url
* @return array Array with all the info (url, description, active, created_by, tms) from the access_url table * @return array Array with all the info (url, description, active, created_by, tms) from the access_url table
* @author Julio Montoya Armas * @author Julio Montoya Armas
*/ */

@ -10,6 +10,8 @@ use \ChamiloSession as Session;
class Template class Template
{ {
private $app;
public $style = 'default'; //see the template folder public $style = 'default'; //see the template folder
public $preview_theme = null; public $preview_theme = null;
public $theme; // the chamilo theme public_admin, chamilo, chamilo_red, etc public $theme; // the chamilo theme public_admin, chamilo, chamilo_red, etc
@ -26,14 +28,13 @@ class Template
public $jquery_ui_theme; public $jquery_ui_theme;
public $load_plugins = false; /* Loads chamilo plugins */ public $load_plugins = false; /* Loads chamilo plugins */
public $force_plugin_load = true; public $force_plugin_load = true;
public $app;
public $navigation_array; public $navigation_array;
/** /**
* @param null $title * @param string $title
* @param null $app * @param Application $app
*/ */
function __construct($title = null, $app = null) public function __construct($title = null, $app = null)
{ {
if (empty($app)) { if (empty($app)) {
global $app; global $app;
@ -50,13 +51,11 @@ class Template
$show_header = $app['template.show_header']; $show_header = $app['template.show_header'];
$show_footer = $app['template.show_footer']; $show_footer = $app['template.show_footer'];
$show_learnpath = $app['template.show_learnpath']; $show_learnpath = $app['template.show_learnpath'];
$hide_global_chat = $app['template.hide_global_chat'];
$load_plugins = $app['template.load_plugins']; $load_plugins = $app['template.load_plugins'];
//Page title //Page title
$this->title = $title; $this->title = $title;
$this->show_learnpath = $show_learnpath; $this->show_learnpath = $show_learnpath;
$this->hide_global_chat = $hide_global_chat;
$this->load_plugins = $load_plugins; $this->load_plugins = $load_plugins;
// Current themes: cupertino, smoothness, ui-lightness. Find the themes folder in main/inc/lib/javascript/jquery-ui // Current themes: cupertino, smoothness, ui-lightness. Find the themes folder in main/inc/lib/javascript/jquery-ui
@ -103,11 +102,23 @@ class Template
} }
} }
/**
* Get icon path
* @param string $image
* @param int $size
* @return string
*/
public static function get_icon_path($image, $size = ICON_SIZE_SMALL) public static function get_icon_path($image, $size = ICON_SIZE_SMALL)
{ {
return Display:: return_icon($image, '', array(), $size, false, true); return Display:: return_icon($image, '', array(), $size, false, true);
} }
/**
* Format date
* @param string $timestamp
* @param string $format
* @return string
*/
public static function format_date($timestamp, $format = null) public static function format_date($timestamp, $format = null)
{ {
return api_format_date($timestamp, $format); return api_format_date($timestamp, $format);
@ -126,11 +137,13 @@ class Template
$this->assign('help_content', $help); $this->assign('help_content', $help);
} }
/* /**
* Use template system to parse the actions menu * Use template system to parse the actions menu
* @todo finish it! * @todo finish it!
* */ * @param array $actions
function set_actions($actions) *
**/
public function setActions($actions)
{ {
$action_string = ''; $action_string = '';
if (!empty($actions)) { if (!empty($actions)) {
@ -144,7 +157,7 @@ class Template
/** /**
* Shortcut to display a 1 col layout (index.php) * Shortcut to display a 1 col layout (index.php)
* */ * */
function display_one_col_template() public function display_one_col_template()
{ {
$tpl = $this->get_template('layout/layout_1_col.tpl'); $tpl = $this->get_template('layout/layout_1_col.tpl');
$this->display($tpl); $this->display($tpl);
@ -153,7 +166,7 @@ class Template
/** /**
* Shortcut to display a 2 col layout (userportal.php) * Shortcut to display a 2 col layout (userportal.php)
* */ * */
function display_two_col_template() public function display_two_col_template()
{ {
$tpl = $this->get_template('layout/layout_2_col.tpl'); $tpl = $this->get_template('layout/layout_2_col.tpl');
$this->display($tpl); $this->display($tpl);
@ -162,7 +175,7 @@ class Template
/** /**
* Displays an empty template * Displays an empty template
*/ */
function display_blank_template() public function display_blank_template()
{ {
$tpl = $this->get_template('layout/blank.tpl'); $tpl = $this->get_template('layout/blank.tpl');
$this->display($tpl); $this->display($tpl);
@ -171,7 +184,7 @@ class Template
/** /**
* Displays an empty template * Displays an empty template
*/ */
function display_no_layout_template() public function display_no_layout_template()
{ {
$tpl = $this->get_template('layout/no_layout.tpl'); $tpl = $this->get_template('layout/no_layout.tpl');
$this->display($tpl); $this->display($tpl);
@ -181,7 +194,7 @@ class Template
* Sets the footer visibility * Sets the footer visibility
* @param bool true if we show the footer * @param bool true if we show the footer
*/ */
function setFooter($status) public function setFooter($status)
{ {
$this->show_footer = $status; $this->show_footer = $status;
$this->assign('show_footer', $status); $this->assign('show_footer', $status);
@ -191,7 +204,7 @@ class Template
* Sets the header visibility * Sets the header visibility
* @param bool true if we show the header * @param bool true if we show the header
*/ */
function setHeader($status) public function setHeader($status)
{ {
$this->show_header = $status; $this->show_header = $status;
$this->assign('show_header', $status); $this->assign('show_header', $status);
@ -237,7 +250,7 @@ class Template
$this->assign('show_course_navigation_menu', $show_course_navigation_menu); $this->assign('show_course_navigation_menu', $show_course_navigation_menu);
} }
function get_template($name) public function get_template($name)
{ {
return $this->app['template_style'].'/'.$name; return $this->app['template_style'].'/'.$name;
} }
@ -314,7 +327,7 @@ class Template
/** /**
* Set theme, include CSS files */ * Set theme, include CSS files */
function set_css_files() private function set_css_files()
{ {
global $disable_js_and_css_files; global $disable_js_and_css_files;
$css = array(); $css = array();
@ -393,7 +406,7 @@ class Template
$this->assign('logo', $logo); $this->assign('logo', $logo);
} }
function set_js_files() private function set_js_files()
{ {
global $disable_js_and_css_files, $htmlHeadXtra; global $disable_js_and_css_files, $htmlHeadXtra;
//JS files //JS files
@ -409,10 +422,9 @@ class Template
if (api_is_global_chat_enabled()) { if (api_is_global_chat_enabled()) {
//Do not include the global chat in LP //Do not include the global chat in LP
if ($this->show_learnpath == false && $this->show_footer == true && $this->hide_global_chat == false) { if ($this->show_learnpath == false && $this->show_footer == true && $this->app['template.hide_global_chat'] == false) {
//$js_files[] = 'chat/js/chat.js'; $js_files[] = 'chat/js/chat.js';
} }
$js_files[] = 'chat/js/chat.js';
} }
if (api_get_setting('accessibility_font_resize') == 'true') { if (api_get_setting('accessibility_font_resize') == 'true') {
@ -600,12 +612,10 @@ class Template
} }
/** /**
* Set footer parameteres * Set footer parameters
*/ */
private function setFooterParameters() private function setFooterParameters()
{ {
global $_configuration;
//Show admin data //Show admin data
//$this->assign('show_administrator_data', api_get_setting('show_administrator_data')); //$this->assign('show_administrator_data', api_get_setting('show_administrator_data'));
@ -683,19 +693,19 @@ class Template
$this->display($tpl); $this->display($tpl);
} }
function show_footer_template() public function show_footer_template()
{ {
$tpl = $this->get_template('layout/show_footer.tpl'); $tpl = $this->get_template('layout/show_footer.tpl');
$this->display($tpl); $this->display($tpl);
} }
function manage_display($content) public function manage_display($content)
{ {
//$this->assign('content', $content); //$this->assign('content', $content);
} }
/* Sets the plugin content in a template variable */ /* Sets the plugin content in a template variable */
function set_plugin_region($plugin_region) private function set_plugin_region($plugin_region)
{ {
if (!empty($plugin_region)) { if (!empty($plugin_region)) {
$region_content = $this->plugin->load_region($plugin_region, $this, $this->force_plugin_load); $region_content = $this->plugin->load_region($plugin_region, $this, $this->force_plugin_load);
@ -1231,7 +1241,12 @@ class Template
return $return; return $return;
} }
function returnBreadcrumb($interbreadcrumb) /**
* Return breadcrumb
* @param array $interbreadcrumb
* @return string
*/
public function returnBreadcrumb($interbreadcrumb)
{ {
$session_id = api_get_session_id(); $session_id = api_get_session_id();
$session_name = api_get_session_name($session_id); $session_name = api_get_session_name($session_id);

Loading…
Cancel
Save