Browse Source

Adding api_get_cidreq()

jmontoyaa 9 years ago
parent
commit
71347a9bba

+ 1 - 1
main/course_description/index.php

@@ -42,7 +42,7 @@ if (isset($_GET['isStudentView']) && $_GET['isStudentView'] == 'true') {
 }
 
 // interbreadcrumb
-$interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('CourseProgram'));
+$interbreadcrumb[] = array ("url" => "index.php?".api_get_cidreq(), "name" => get_lang('CourseProgram'));
 if ($description_type == 1) $interbreadcrumb[] = array ("url" => "#", "name" => get_lang('GeneralDescription'));
 if ($description_type == 2) $interbreadcrumb[] = array ("url" => "#", "name" => get_lang('Objectives'));
 if ($description_type == 3) $interbreadcrumb[] = array ("url" => "#", "name" => get_lang('Topics'));

+ 2 - 2
main/dropbox/dropbox_functions.inc.php

@@ -189,7 +189,7 @@ function display_move_form($part, $id, $target = array(), $extra_params = array(
     $form = new FormValidator(
         'form1',
         'post',
-        api_get_self().'?view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&'.$extra_params
+        api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&'.$extra_params
     );
     $form->addElement('header', get_lang('MoveFileTo'));
     $form->addElement('hidden', 'id', intval($id));
@@ -499,7 +499,7 @@ function display_addcategory_form($category_name = '', $id = '', $action)
         $text = get_lang('CreateCategory');
     }
 
-    $form = new FormValidator('add_new_category', 'post', api_get_self().'?view='.Security::remove_XSS($_GET['view']));
+    $form = new FormValidator('add_new_category', 'post', api_get_self().'?'.api_get_cidreq().'&view='.Security::remove_XSS($_GET['view']));
     $form->addElement('header', $title);
 
     if (isset($id) AND $id != '') {

+ 5 - 7
main/dropbox/dropbox_init.inc.php

@@ -330,33 +330,31 @@ if ((!$is_allowed_in_course || !$is_course_member) && !api_is_allowed_to_edit(nu
 }
 
 /*	BREADCRUMBS */
-
 if ($view == 'received') {
-	$interbreadcrumb[] = array('url' => '../dropbox/index.php', 'name' => get_lang('Dropbox', ''));
+	$interbreadcrumb[] = array('url' => '../dropbox/index.php?'.api_get_cidreq(), 'name' => get_lang('Dropbox', ''));
 	$nameTools = get_lang('ReceivedFiles');
 
 	if ($action == 'addreceivedcategory') {
-		$interbreadcrumb[] = array('url' => '../dropbox/index.php?view=received', 'name' => get_lang('ReceivedFiles'));
+		$interbreadcrumb[] = array('url' => '../dropbox/index.php?view=received&'.api_get_cidreq(), 'name' => get_lang('ReceivedFiles'));
 		$nameTools = get_lang('AddNewCategory');
 	}
 }
 
 if ($view == 'sent' || empty($view)) {
-	$interbreadcrumb[] = array('url' => '../dropbox/index.php', 'name' => get_lang('Dropbox', ''));
+	$interbreadcrumb[] = array('url' => '../dropbox/index.php?'.api_get_cidreq(), 'name' => get_lang('Dropbox', ''));
 	$nameTools = get_lang('SentFiles');
 
 	if ($action == 'addsentcategory') {
-		$interbreadcrumb[] = array('url' => '../dropbox/index.php?view=sent', 'name' => get_lang('SentFiles'));
+		$interbreadcrumb[] = array('url' => '../dropbox/index.php?view=sent&'.api_get_cidreq(), 'name' => get_lang('SentFiles'));
 		$nameTools = get_lang('AddNewCategory');
 	}
 	if ($action == 'add') {
-		$interbreadcrumb[] = array ('url' => '../dropbox/index.php?view=sent', 'name' => get_lang('SentFiles'));
+		$interbreadcrumb[] = array ('url' => '../dropbox/index.php?view=sent&'.api_get_cidreq(), 'name' => get_lang('SentFiles'));
 		$nameTools = get_lang('UploadNewFile');
 	}
 }
 
 /*	HEADER & TITLE */
-
 if (isset($origin) && $origin == 'learnpath') {
     $htmlHeadXtra[] = $javascript;
 	Display::display_reduced_header($nameTools, 'Dropbox');

+ 142 - 0
src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/TrainingDescription.php

@@ -0,0 +1,142 @@
+<?php
+/* For licensing terms, see /license.txt */
+
+namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar;
+
+/**
+ * TrainingDescription
+ * @package Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar
+ */
+class TrainingDescription extends Basic
+{
+    /**
+     * Get the toolbar config
+     * @return array
+     */
+    public function getConfig()
+    {
+        $config['toolbarGroups'] = array(
+            array('name' => 'document',  'groups' =>array('document', 'doctools')),
+            array('name' => 'clipboard',    'groups' =>array('clipboard', 'undo')),
+            array('name' => 'editing',    'groups' =>array('clipboard', 'undo')),
+            //array('name' => 'forms',    'groups' =>array('clipboard', 'undo', )),
+            '/',
+            array('name' => 'basicstyles',    'groups' =>array('basicstyles', 'cleanup')),
+            array('name' => 'paragraph',    'groups' =>array('list', 'indent', 'blocks', 'align')),
+            array('name' => 'links'),
+            array('name' => 'insert'),
+            '/',
+            array('name' => 'styles'),
+            array('name' => 'colors'),
+            array('name' => 'tools'),
+            array('name' => 'others'),
+            array('name' => 'mode')
+        );
+
+        $config['extraPlugins'] = $this->getPluginsToString();
+
+        //$config['width'] = '100';
+        //$config['height'] = '200';
+        if (api_get_setting('editor.more_buttons_maximized_mode') != 'true') {
+            $config['toolbar'] = $this->getNormalToolbar();
+        } else {
+            $config['toolbar_minToolbar'] = $this->getMinimizedToolbar();
+
+            $config['toolbar_maxToolbar'] = $this->getMaximizedToolbar();
+        }
+        return $config;
+    }
+
+    /**
+     * @return array
+     */
+    public function getConditionalPlugins()
+    {
+        $plugins = array();
+        if (api_get_setting(
+                'document.show_glossary_in_documents'
+            ) == 'ismanual'
+        ) {
+            $plugins[] = 'glossary';
+        }
+
+        return $plugins;
+    }
+
+    /**
+     * Get the toolbar configuration when CKEditor is maximized
+     * @return array
+     */
+    protected function getMaximizedToolbar()
+    {
+        return [
+            ['NewPage', 'Templates', '-', 'Preview', 'Print'],
+            ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord'],
+            ['Undo', 'Redo', '-', 'SelectAll', 'Find', '-', 'RemoveFormat'],
+            ['Link', 'Unlink', 'Anchor', 'Glossary'],
+            [
+                'Image',
+                'Mapping',
+                'Video',
+                'Flash',
+                'Youtube',
+                'Oembed',
+                'Audio',
+                'leaflet',
+                'Smiley',
+                'SpecialChar',
+                'Asciimath',
+                'Asciisvg'
+            ],
+            '/',
+            ['Table', '-', 'CreateDiv'],
+            ['BulletedList', 'NumberedList', 'HorizontalRule', '-', 'Outdent', 'Indent', 'Blockquote'],
+            ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
+            ['Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript', '-', 'TextColor', 'BGColor'],
+            [
+                api_get_setting(
+                    'editor.allow_spellcheck'
+                ) == 'true' ? 'Scayt' : '',
+            ],
+            ['Styles', 'Format', 'Font', 'FontSize'],
+            ['PageBreak', 'ShowBlocks', 'Source'],
+            ['Toolbarswitch'],
+        ];
+    }
+
+    /**
+     * Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
+     * @return array
+     */
+    protected function getNormalToolbar()
+    {
+        return [
+            ['Maximize', '-', 'PasteFromWord', '-', 'Undo', 'Redo'],
+            ['Link', 'Unlink'],
+            ['Image', 'Video', 'Flash', 'Oembed', 'Youtube', 'Audio'],
+            ['Table', 'SpecialChar'],
+            ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'TextColor', 'BGColor', '-', 'Source'],
+            '/',
+            ['Styles', 'Format', 'Font', 'FontSize'],
+            ['Bold', 'Italic', 'Underline'],
+            ['JustifyLeft', 'JustifyCenter', 'JustifyRight']
+        ];
+    }
+
+    /**
+     * Get the toolbar configuration when CKEditor is minimized
+     * @return array
+     */
+    protected function getMinimizedToolbar()
+    {
+        return [
+            ['NewPage', 'Templates', '-', 'PasteFromWord'],
+            ['Undo', 'Redo'],
+            ['Link', 'Unlink', 'Image', 'Video', 'Flash', 'Audio', 'Table', 'Asciimath', 'Asciisvg'],
+            ['BulletedList', 'NumberedList', 'HorizontalRule'],
+            ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
+            ['Format', 'Font', 'FontSize', 'Bold', 'Italic', 'Underline', 'TextColor', 'BGColor'],
+            ['Source', 'Toolbarswitch']
+        ];
+    }
+}