Project

General

Profile

Feature #3404 » Laurent_Opprecht_539.patch

Laurent Opprecht, 11/05/2011 17:41

View differences:

php/autoloader.class.php Tue May 10 16:17:58 2011 +0200 → php/autoloader.class.php Wed May 11 17:18:44 2011 +0200
25 25
            'weblcms_manager' => 'weblcms_manager/weblcms_manager.class.php',
26 26
            'course_layout' => 'course/course_layout.class.php',
27 27
            'course_form' => 'course/course_form.class.php',
28
            'course_create_from_template_form' => 'course/course_create_from_template_form.class.php',
28 29
            'course_group' => 'course_group/course_group.class.php',
29 30
            'course_group_form' => 'course_group/course_group_form.class.php',
30 31
            'course_group_subscriptions_form' => 'course_group/course_group_subscriptions_form.class.php',
php/blocks/type/course_menu.class.php Tue May 10 16:17:58 2011 +0200 → php/blocks/type/course_menu.class.php Wed May 11 17:18:44 2011 +0200
52 52
        $html[] = '</div>';
53 53

  
54 54
        $target = $this->get_link_target();
55
        $target = $target ? ' target="' . $target . '"' : '';
55 56

  
56
        $template = '<li class="tool_list_menu" style="background-image: url({$IMG})"><a style="top: -3px; position: relative;" href="{$HREF}" target="' . $target . '">{$TEXT}</a></li>';
57
        $template = '<li class="tool_list_menu" style="background-image: url({$IMG})"><a style="top: -3px; position: relative;" href="{$HREF}" ' . $target . '>{$TEXT}</a></li>';
57 58

  
58 59
        $ADMIN_MENU = $this->display_admin_menu($template);
59 60
        $USER_MENU = SimpleTemplate::all($template, $this->get_edit_course_menu());
......
68 69
        {
69 70
            $menu = $this->get_platform_admin_menu();
70 71
            $result[] = SimpleTemplate::all($template, $menu);
71
            $result[] = '<div style="margin: 10px 0 10px 0; border-bottom: 1px dotted #4271B5; height: 0px;"></div>';
72
            $result[] = '<li style="list-style: none;"><div style="margin: 10px 0 10px 0; border-bottom: 1px dotted #4271B5; height: 0px;"></div></li>';
72 73
        }
73 74
        else
74 75
        {
......
96 97
            $count_direct++;
97 98
        }
98 99
        if ($count_direct)
99
        {
100
        {            
101
            $HREF = $this->get_course_action_url(WeblcmsManager :: ACTION_CREATE_COURSE_FROM_TEMPLATE);
102
            $TEXT = htmlspecialchars(Translation :: get('QuickCourseCreate'));
103
            $IMG = Theme :: get_common_image_path() . 'action_quick_create.png';
104
            $result[] = compact('HREF', 'TEXT', 'IMG');
105
            
100 106
            $HREF = $this->get_course_action_url(WeblcmsManager :: ACTION_CREATE_COURSE);
101 107
            $TEXT = htmlspecialchars(Translation :: get('CourseCreate'));
102 108
            $IMG = Theme :: get_common_image_path() . 'action_create.png';
......
140 146
    function get_platform_admin_menu()
141 147
    {
142 148
        $result = array();
149
        
150
        $HREF = $this->get_course_action_url(WeblcmsManager :: ACTION_CREATE_COURSE_FROM_TEMPLATE);
151
        $TEXT = htmlspecialchars(Translation :: get('QuickCourseCreate'));
152
        $IMG = Theme :: get_common_image_path() . 'action_quick_create.png';
153
        $result[] = compact('HREF', 'TEXT', 'IMG');
143 154

  
144 155
        $HREF = $this->get_course_action_url(WeblcmsManager :: ACTION_CREATE_COURSE);
145 156
        $TEXT = htmlspecialchars(Translation :: get('CourseCreate'));
php/install/course_settings.xml Tue May 10 16:17:58 2011 +0200 → php/install/course_settings.xml Wed May 11 17:18:44 2011 +0200
5 5
		<property name="language" type="text" length="255" fixed="true" default="en" />
6 6
		<property name="visibility" type="boolean" default="1" />
7 7
		<property name="access" type="boolean" default="1" />
8
		<property name="template" type="boolean" default="0" />
8 9
		<property name="max_number_of_members" type="integer" default="0" />
9 10
	</properties>
10 11
	<index name="course_id" type="primary">
php/lib/course/common_form.class.php Tue May 10 16:17:58 2011 +0200 → php/lib/course/common_form.class.php Wed May 11 17:18:44 2011 +0200
127 127
            $object = $object->get_settings();
128 128
        $object->set_language($values[CourseSettings :: PROPERTY_LANGUAGE]);
129 129
        $object->set_visibility($this->parse_checkbox_value($values[CourseSettings :: PROPERTY_VISIBILITY]));
130
        $object->set_template($this->parse_checkbox_value($values[CourseSettings :: PROPERTY_TEMPLATE]));
130 131
        $object->set_access($this->parse_checkbox_value($values[CourseSettings :: PROPERTY_ACCESS]));
131 132
        if ($values[self :: UNLIMITED_MEMBERS])
132 133
            $members = 0;
......
314 315
            $settings = $this->object->get_course_type()->get_settings();
315 316
        $defaults[CourseSettings :: PROPERTY_LANGUAGE] = ! is_null($settings->get_language()) ? $settings->get_language() : LocalSetting :: get('platform_language');
316 317
        $defaults[CourseSettings :: PROPERTY_VISIBILITY] = ! is_null($settings->get_visibility()) ? $settings->get_visibility() : 1;
318
        $defaults[CourseSettings :: PROPERTY_TEMPLATE] = ! is_null($settings->get_template()) ? $settings->get_template() : 0;
317 319
        $defaults[CourseSettings :: PROPERTY_ACCESS] = ! is_null($settings->get_access()) ? $settings->get_access() : 1;
318 320
        $defaults[CourseSettings :: PROPERTY_MAX_NUMBER_OF_MEMBERS] = $settings->get_max_number_of_members();
319 321
        $defaults[self :: UNLIMITED_MEMBERS] = ($settings->get_max_number_of_members() == 0) ? 1 : 0;
php/lib/course/course.class.php Tue May 10 16:17:58 2011 +0200 → php/lib/course/course.class.php Wed May 11 17:18:44 2011 +0200
61 61
    private $rights;
62 62
    private $request;
63 63
    private $course_type = false;
64
    private $sections = false;
64 65

  
65 66
    function __construct($defaultProperties = array(), $optionalProperties = array())
66 67
    {
......
143 144
            $udm = UserDataManager :: get_instance();
144 145
            $user = $udm->retrieve_user($titular_id);
145 146
            return $user->get_lastname() . ' ' . $user->get_firstname();
146
        }
147
        else
147
        } else
148 148
        {
149 149
            return null;
150 150
        }
......
277 277
        return $this->course_type;
278 278
    }
279 279

  
280
    function get_course_sections()
281
    {
282
        if ($this->sections === false)
283
        {
284
            $result = array();
285
            $dm = WeblcmsDataManager :: get_instance();
286
            $condition = new EqualityCondition(CourseSection :: PROPERTY_COURSE_CODE, $this->get_id());
287
            $course_sections = $dm->retrieve_course_sections($condition);
288
            $result = $course_sections->as_array();
289
            if (empty($result))
290
            {
291
                $result = $this->default_course_sections();
292
            }
293
            $this->set_course_sections($result);
294
        }
295
        return $this->sections;
296
    }
297

  
298
    function set_course_sections($value)
299
    {
300
        $this->sections = $value;
301
        $this->sections = $this->sections ? $this->sections : array();
302
//        foreach ($this->sections as $section)
303
//        {
304
//            $section->set_course_code($this->get_id());
305
//        }
306
    }
307

  
308
    function default_course_sections()
309
    {
310
        $sections = array();
311
        $sections[] = array('name' => Translation :: get('SectionTools'), 'type' => 1, 'order' => 1);
312
        $sections[] = array('name' => Translation :: get('SectionLinks'), 'type' => 2, 'order' => 2);
313
        $sections[] = array('name' => Translation :: get('SectionDisabled'), 'type' => 0, 'order' => 3);
314
        $sections[] = array('name' => Translation :: get('SectionCourseAdministration'), 'type' => 3, 'order' => 4);
315

  
316
        $result = array();
317
        foreach ($sections as $section)
318
        {
319
            $course_section = new CourseSection();
320
            $course_section->set_course_code($this->get_id());
321
            $course_section->set_name($section['name']);
322
            $course_section->set_type($section['type']);
323
            $course_section->set_visible(true);
324
            $result[] = $course_section;
325
//            if (!$course_section->create())
326
//            {
327
//                return false;
328
//            }
329
        }
330
        return $result;
331

  
332
//        return true;
333
    }
334

  
280 335
    /**
281 336
     * Sets the course type id of this course object
282 337
     * @param int $type The course type id
......
444 499
            return $this->get_course_type()->get_settings()->get_access();
445 500
    }
446 501

  
502
    function get_template()
503
    {
504
            return $this->get_settings()->get_template();
505
    }
506

  
447 507
    function get_max_number_of_members()
448 508
    {
449 509
        if (!$this->get_max_number_of_members_fixed())
......
511 571
            $this->get_settings()->set_access($this->get_course_type()->get_settings()->get_access());
512 572
    }
513 573

  
574
    function set_template($value)
575
    {
576
        $this->get_settings()->set_template($value);
577
    }
578

  
514 579
    function get_max_number_of_members_fixed()
515 580
    {
516 581
        if (!is_null($this->get_course_type()))
......
1009 1074
            return false;
1010 1075
        }
1011 1076

  
1012
        if (!$this->initialize_course_sections())
1013
        {
1014
            return false;
1015
        }
1016

  
1017 1077
        if (!$this->create_location())
1018 1078
        {
1019 1079
            return false;
1020 1080
        }
1021 1081

  
1022
        if (!$this->tools)
1082
        $sections = $this->get_course_sections();
1083
        foreach ($sections as $section)
1023 1084
        {
1024
            $course_type_id = $this->get_course_type_id();
1025
            if (!empty($course_type_id))
1085
            $section->set_course_code($this->get_id());
1086
            if (!$section->create())
1026 1087
            {
1027
                $this->tools = CourseModule :: convert_tools($this->get_course_type()->get_tools(), $this->get_id(), true);
1028
            }
1029
            else
1030
            {
1031
                $this->tools = CourseModule :: convert_tools(WeblcmsDataManager :: get_tools('basic'), $this->get_id());
1032
            }
1033
        }
1034
        else
1035
        {
1036
            foreach ($this->tools as $tool)
1037
            {
1038
                $tool->set_course_code($this->get_id());
1088
                return false;
1039 1089
            }
1040 1090
        }
1041 1091

  
1042
        if (!$wdm->create_course_modules($this->tools, $this->get_id()))
1092
        //check if sections created the tools. If it is the case no need 
1093
        //to create them anymore
1094
        $tools = $wdm->retrieve_course_modules_by_course($this);
1095
        
1096
        if ($tools->is_empty())
1043 1097
        {
1044
            return false;
1098
            if (!$this->tools)
1099
            {
1100
                $course_type_id = $this->get_course_type_id();
1101
                if (!empty($course_type_id))
1102
                {
1103
                    $this->tools = CourseModule :: convert_tools($this->get_course_type()->get_tools(), $this->get_id(), true);
1104
                } else
1105
                {
1106
                    $this->tools = CourseModule :: convert_tools(WeblcmsDataManager :: get_tools('basic'), $this->get_id());
1107
                }
1108
            } else
1109
            {
1110
                foreach ($this->tools as $tool)
1111
                {
1112
                    $tool->set_course_code($this->get_id());
1113
                }
1114
            }
1115

  
1116
            if (!$wdm->create_course_modules($this->tools, $this->get_id()))
1117
            {
1118
                return false;
1119
            }
1045 1120
        }
1046 1121

  
1047 1122
        foreach ($this->tools as $tool)
......
1053 1128
                $dropbox->create_dropbox($this->get_id());
1054 1129
            }
1055 1130
        }
1056
        
1131

  
1057 1132
        if (!$this->create_root_course_group())
1058 1133
        {
1059 1134
            return false;
......
1081 1156
            return false;
1082 1157
        }
1083 1158

  
1084
        return WeblcmsRights::get_instance()-> create_subtree_root_location($this->get_id(), WeblcmsRights :: TREE_TYPE_COURSE);
1159
        return WeblcmsRights::get_instance()->create_subtree_root_location($this->get_id(), WeblcmsRights :: TREE_TYPE_COURSE);
1085 1160
    }
1086 1161

  
1087 1162
    function delete()
......
1100 1175
    }
1101 1176

  
1102 1177
    private $is_course_admin_cache;
1178

  
1103 1179
    /**
1104 1180
     * Checks whether the given user is a course admin in this course
1105 1181
     * @param int $user_id
......
1189 1265
        return Utilities :: get_classname_from_namespace(self :: CLASS_NAME, true);
1190 1266
    }
1191 1267

  
1192
    function initialize_course_sections()
1193
    {
1194
        $sections = array();
1195
        $sections[] = array('name' => Translation :: get('SectionTools'), 'type' => 1, 'order' => 1);
1196
        $sections[] = array('name' => Translation :: get('SectionLinks'), 'type' => 2, 'order' => 2);
1197
        $sections[] = array('name' => Translation :: get('SectionDisabled'), 'type' => 0, 'order' => 3);
1198
        $sections[] = array('name' => Translation :: get('SectionCourseAdministration'), 'type' => 3, 'order' => 4);
1199

  
1200
        foreach ($sections as $section)
1201
        {
1202
            $course_section = new CourseSection();
1203
            $course_section->set_course_code($this->get_id());
1204
            $course_section->set_name($section['name']);
1205
            $course_section->set_type($section['type']);
1206
            $course_section->set_visible(true);
1207
            if (!$course_section->create())
1208
            {
1209
                return false;
1210
            }
1211
        }
1212

  
1213
        return true;
1214
    }
1215

  
1216 1268
    function create_root_course_group()
1217 1269
    {
1218 1270
        $group = new CourseGroup();
......
1397 1449
    function update()
1398 1450
    {
1399 1451
        $course_group = $this->get_data_manager()->retrieve_course_group_root($this->get_id());
1400
        if($course_group->get_name() != $this->get_name())
1452
        if ($course_group->get_name() != $this->get_name())
1401 1453
        {
1402 1454
            $course_group->set_name($this->get_name());
1403 1455
            $course_group->update();
......
1406 1458
        return parent :: update();
1407 1459
    }
1408 1460

  
1461
    /**
1462
     * Clone the structure of the Course object.
1463
     * Does not clone/add publications
1464
     */
1465
    public function __clone()
1466
    {
1467

  
1468
        $settings = clone($this->get_settings());
1469
        $this->set_settings($settings);
1470

  
1471
        $layout = clone($this->get_layout_settings());
1472
        $this->set_layout_settings($layout);
1473

  
1474
        $rights = clone($this->get_rights());
1475
        $this->set_rights($rights);
1476

  
1477
        $sections = Utilities::clone_array($this->get_course_sections());
1478
        $this->set_course_sections($sections);
1479

  
1480
//        $wdm = WeblcmsDataManager :: get_instance();
1481
//        $tools = $wdm->retrieve_course_modules_by_course($this)->as_array();
1482
//        $tools = Utilities::clone_array($tools);
1483
//        
1484
////        $tools = array();
1485
////        foreach ($sections as $section)
1486
////        {
1487
////            $tools = array_merge($tools, $section->get_tools());
1488
////        }
1489
//
1490
//        $this->set_tools($tools);
1491

  
1492
        //set it to null only after cloning children
1493
        $this->set_id(null);
1494
    }
1495

  
1409 1496
}
1410 1497

  
1411 1498
?>
/dev/null Thu Jan 01 00:00:00 1970 +0000 → php/lib/course/course_create_from_template_form.class.php Wed May 11 17:18:44 2011 +0200
1
<?php
2

  
3
namespace application\weblcms;
4

  
5
use common\libraries\ResourceManager;
6
use common\libraries\Toolbar;
7
use common\libraries\ToolbarItem;
8
use common\libraries\SortableTableFromArray;
9
use admin\AdminDataManager;
10
use common\libraries\DynamicFormTabsRenderer;
11
use common\libraries\DynamicFormTab;
12
use user\User;
13
use user\UserDataManager;
14
use common\libraries\Display;
15
use common\libraries\PlatformSetting;
16
use common\libraries\Theme;
17
use common\libraries\AndCondition;
18
use common\libraries\EqualityCondition;
19
use common\libraries\Request;
20
use common\libraries\Path;
21
use common\libraries\Translation;
22
use common\libraries\Utilities;
23
use common\libraries\InequalityCondition;
24
use common\libraries\NotCondition;
25

  
26
/**
27
 * @package application.lib.weblcms.course
28
 */
29
require_once Path :: get_admin_path() . 'settings/settings_admin_connector.class.php';
30
require_once dirname(__FILE__) . '/course.class.php';
31
require_once dirname(__FILE__) . '/common_form.class.php';
32
require_once dirname(__FILE__) . '/rights_tree_renderer.class.php';
33
require_once dirname(__FILE__) . '/../category_manager/course_category.class.php';
34

  
35
class CourseCreateFromTemplateForm extends CommonForm
36
{
37

  
38
    private $user;
39

  
40
    function __construct($course, $user, $action, $parent)
41
    {
42
        $this->user = $user;
43

  
44
        parent :: __construct(CommonForm :: TYPE_CREATE, $course, $action, $parent, 'course_settings', 'post');
45
        $this->addElement('html', ResourceManager :: get_instance()->get_resource_html(Path :: get(WEB_APP_PATH) . 'weblcms/resources/javascript/course_form.js'));
46
    }
47

  
48
    public function get_course()
49
    {
50
        return $this->object;
51
    }
52

  
53
    function build_basic_form()
54
    {
55
        $this->addElement('category', Translation :: get('CourseSettings'));
56

  
57
        $this->addElement('hidden', Course :: PROPERTY_ID, '', array('class' => 'course_id'));
58

  
59
        $this->addElement('text', Course :: PROPERTY_NAME, Translation :: get('Title'), array("size" => "50"));
60
        $this->addRule(Course :: PROPERTY_NAME, Translation :: get('ThisFieldIsRequired', null, Utilities :: COMMON_LIBRARIES), 'required');
61

  
62
        $this->addElement('text', Course :: PROPERTY_VISUAL, Translation :: get('VisualCode'), array("size" => "50"));
63

  
64
        //categories
65

  
66
        $this->get_categories(0);
67
        if (count($this->categories) > 0)
68
        {
69
            $this->addElement('select', Course :: PROPERTY_CATEGORY, Translation :: get('Category', null, Utilities :: COMMON_LIBRARIES), $this->categories);
70
        } else
71
        {
72
            $category_name = Translation :: get('NoCategories');
73
            $this->addElement('static', 'Category_Static', Translation :: get('Category', null, Utilities :: COMMON_LIBRARIES), $category_name);
74
            $this->addElement('hidden', Course :: PROPERTY_CATEGORY, 0);
75
        }
76

  
77
        $this->addElement('select', Course :: PROPERTY_TITULAR, Translation :: get('Teacher'), $this->get_teachers());
78
        $this->addRule(Course :: PROPERTY_TITULAR, Translation :: get('ThisFieldIsRequired', null, Utilities :: COMMON_LIBRARIES), 'required');
79

  
80
        //visibility
81

  
82
        $visibility_disabled = $this->object->get_visibility_fixed();
83
        $attr_array = array();
84
        if ($visibility_disabled)
85
        {
86
            $attr_array = array('disabled' => 'disabled');
87
        }
88
        $this->addElement('checkbox', CourseSettings :: PROPERTY_VISIBILITY, Translation :: get('CourseTypeVisibility'), '', $attr_array);
89

  
90
        $access_disabled = $this->object->get_access_fixed();
91

  
92
        //Accessibility
93
        if ($access_disabled)
94
        {
95
            $access = $this->object->get_access();
96
            if ($access)
97
                $access_name = Translation :: get('Open', null, Utilities :: COMMON_LIBRARIES);
98
            else
99
                $access_name = Translation :: get('Closed', null, Utilities :: COMMON_LIBRARIES);
100
            $this->addElement('static', 'static_member', Translation :: get('CourseTypeAccess'), $access_name);
101
            $this->addElement('hidden', CourseTypeSettings :: PROPERTY_ACCESS, $access);
102
        }
103
        else
104
        {
105
            $choices = array();
106
            $choices[] = $this->createElement('radio', CourseTypeSettings :: PROPERTY_ACCESS, '', Translation :: get('Open', null, Utilities :: COMMON_LIBRARIES), 1);
107
            $choices[] = $this->createElement('radio', CourseTypeSettings :: PROPERTY_ACCESS, '', Translation :: get('Closed', null, Utilities :: COMMON_LIBRARIES), 0);
108
            $this->addGroup($choices, 'access_choices', Translation :: get('CourseTypeAccess'), '<br />', false);
109
        }
110

  
111
        $this->addElement('category');
112

  
113
        $this->addElement('category', Translation :: get('Templates'));
114

  
115
        $this->addElement('select', 'template_id', Translation :: get('Template', null, Utilities :: COMMON_LIBRARIES), $this->get_templates(), array('size' => 6, 'style'=> 'min-width:200px;'), array());
116

  
117
        $this->addElement('category');
118

  
119
        $this->addElement('category', Translation :: get('ExternalWebsite'));
120
        $this->addElement('text', Course :: PROPERTY_EXTERNAL_NAME, Translation :: get('ExternalName'), array("size" => "50"));
121
        $this->addElement('text', Course :: PROPERTY_EXTERNAL_URL, Translation :: get('ExternalUrl'), array("size" => "50"));
122
        $this->addRule(Course :: PROPERTY_EXTERNAL_URL, Translation :: get('IncorrectUrl'), 'url');
123
        $this->addElement('category');
124
    }
125

  
126
    function build_general_settings_form()
127
    {
128
        
129
    }
130

  
131
    function build_layout_form()
132
    {
133
        
134
    }
135

  
136
    function build_tools_form()
137
    {
138
        
139
    }
140

  
141
    function build_rights_form()
142
    {
143
        
144
    }
145

  
146
    function fill_tools($tools)
147
    {
148
        
149
    }
150

  
151
    function update()
152
    {
153
        
154
    }
155

  
156
    private $categories;
157
    private $level = 1;
158

  
159
    function get_categories($parent_id)
160
    {
161
        $wdm = WeblcmsDataManager :: get_instance();
162
        $categories = $wdm->retrieve_course_categories(new EqualityCondition(CourseCategory :: PROPERTY_PARENT, $parent_id));
163

  
164
        while ($category = $categories->next_result())
165
        {
166
            $this->categories[$category->get_id()] = str_repeat('--', $this->level) . ' ' . $category->get_name();
167
            $this->level++;
168
            $this->get_categories($category->get_id());
169
            $this->level--;
170
        }
171
    }
172

  
173
    private $_templates = null;
174

  
175
    function get_templates()
176
    {
177
        if (is_null($this->_templates))
178
        {
179
            $result = array();
180
            $wdm = WeblcmsDataManager :: get_instance();
181
            
182
            //public templates
183
            $conditions = array();
184
            $conditions[] = new EqualityCondition(CourseSettings::PROPERTY_TEMPLATE, true, CourseSettings::get_table_name());
185
//            $conditions[] = new EqualityCondition(CourseSettings::PROPERTY_ACCESS, true, CourseSettings::get_table_name());
186
            $conditions[] = new EqualityCondition(CourseSettings::PROPERTY_VISIBILITY, true, CourseSettings::get_table_name());
187
            $conditions[] = new NotCondition(new EqualityCondition(Course::PROPERTY_TITULAR, $this->user->get_id()));
188
            $conditions[] = new InequalityCondition(Course::PROPERTY_EXPIRATION_DATE, InequalityCondition::LESS_THAN_OR_EQUAL, time());
189
            $condition = new AndCondition($conditions);
190

  
191
            $templates = $wdm->retrieve_courses($condition);
192
            if (! $templates->is_empty())
193
            {
194
                while ($template = $templates->next_result())
195
                {
196
                    $result[$template->get_id()] = $template->get_name();
197
                }
198
            }
199

  
200
            //user templates
201
            $conditions = array();
202
            $conditions[] = new EqualityCondition(CourseSettings::PROPERTY_TEMPLATE, true, CourseSettings::get_table_name());
203
            $conditions[] = new EqualityCondition(Course::PROPERTY_TITULAR, $this->user->get_id());
204
            $conditions[] = new InequalityCondition(Course::PROPERTY_EXPIRATION_DATE, InequalityCondition::LESS_THAN_OR_EQUAL, time());
205
            $condition = new AndCondition($conditions);
206

  
207
            $templates = $wdm->retrieve_courses($condition);
208
            while ($template = $templates->next_result())
209
            {
210
                $result[$template->get_id()] = $template->get_name();
211
            }
212
            
213
            if(empty($result)){            
214
                $result[0] = '(' . Translation::get('none') . ')';
215
            }
216

  
217
            $this->_templates = $result;
218
        }
219
        return $this->_templates;
220
    }
221

  
222
    private $_teachers = null;
223

  
224
    function get_teachers()
225
    {
226
        if (!is_null($this->_teachers))
227
        {
228
            return $this->_teachers;
229
        }
230

  
231
        $result = array();
232
        if ($this->user->is_platform_admin())
233
        {
234

  
235
            $udm = UserDataManager :: get_instance();
236

  
237
            $users = $udm->retrieve_users(new EqualityCondition(User :: PROPERTY_STATUS, 1));
238
            while ($user = $users->next_result())
239
            {
240
                $result[$user->get_id()] = $user->get_lastname() . '&nbsp;' . $user->get_firstname();
241
            }
242
        } else
243
        {
244
            $user = $this->user;
245
            $result[$user->get_id()] = $user->get_lastname() . '&nbsp;' . $user->get_firstname();
246
        }
247

  
248
        return $this->_teachers = $result;
249
    }
250

  
251
    function create()
252
    {
253
        $values = $this->exportValues();
254
        $template_id = $values['template_id'];
255
        $wdm = WeblcmsDataManager :: get_instance();
256
        $template = $wdm->retrieve_course($template_id);
257
        $template = $template ? $template : $wdm->retrieve_empty_course();
258

  
259
        $course = clone($template);
260
        $this->object = $course;
261
        $this->fill_general_settings($course);
262
        $course->create();
263

  
264
        $condition = new EqualityCondition(ContentObjectPublication :: PROPERTY_COURSE_ID, $template->get_id());
265
        $publications = $wdm->retrieve_content_object_publications($condition)->as_array();
266
        foreach ($publications as $publication)
267
        {
268
            $parent = $publication->get_category_id();
269

  
270
            $publication->set_id(null);
271
            $publication->set_course_id($course->get_id());
272
            $publication->set_category_id(0);
273
            $result = $publication->create();
274
        }
275

  
276
        $course_subscribe_rights = $this->fill_subscribe_rights();
277
        foreach ($course_subscribe_rights as $right)
278
        {
279
            if (!$right->create())
280
            {
281
                return false;
282
            }
283
        }
284

  
285
        $course_unsubscribe_rights = $this->fill_unsubscribe_rights();
286
        foreach ($course_unsubscribe_rights as $right)
287
        {
288
            if (!$right->create())
289
            {
290
                return false;
291
            }
292
        }
293

  
294
        $user_id = $course->get_titular();
295
        return $wdm->subscribe_user_to_course($course, '1', '1', $user_id);
296
    }
297

  
298
    function fill_general_settings()
299
    {
300
        $course = $this->object;
301
        $values = $this->exportValues();
302

  
303
        $visual_code = isset($values[Course :: PROPERTY_VISUAL]) ? $values[Course :: PROPERTY_VISUAL] : strtoupper(uniqid());
304
        $course->set_visual($visual_code);
305

  
306

  
307
        if ($course->get_category() != $values[Course :: PROPERTY_CATEGORY])
308
        {
309
            if ($values[Course :: PROPERTY_CATEGORY])
310
            {
311
                $new_parent_id = WeblcmsRights :: get_instance()->get_weblcms_location_by_identifier_from_courses_subtree(WeblcmsRights :: TYPE_CATEGORY, $values[Course :: PROPERTY_CATEGORY], $course->get_id());
312
            } else
313
            {
314
                $new_parent_id = WeblcmsRights :: get_instance()->get_courses_subtree_root_id($course->get_id());
315
            }
316

  
317
            $location = WeblcmsRights :: get_instance()->get_weblcms_location_by_identifier_from_courses_subtree(WeblcmsRights :: TYPE_COURSE, $course->get_id(), $course->get_id());
318
            if ($location)
319
            {
320
                $location->move($new_parent_id);
321
            }
322
        }
323

  
324
        $course->set_name($values[Course :: PROPERTY_NAME]);
325
        $course->set_category($values[Course :: PROPERTY_CATEGORY]);
326
        $course->set_titular($values[Course :: PROPERTY_TITULAR]);
327
        $course->set_external_name($values[Course :: PROPERTY_EXTERNAL_NAME]);
328
        $course->set_external_url($values[Course :: PROPERTY_EXTERNAL_URL]);
329
        $course->set_template(false);
330
        return $course;
331
    }
332

  
333
    /**
334
     * Sets default values. Traditionally, you will want to extend this method
335
     * so it sets default for your learning object type's additional
336
     * properties.
337
     * @param array $defaults Default values for this form's parameters.
338
     */
339
    function setDefaults($defaults = array())
340
    {
341
        $course = $this->object;
342
        $defaults[Course :: PROPERTY_ID] = $course->get_id();
343
        $defaults[Course :: PROPERTY_COURSE_TYPE_ID] = $this->course_type_id;
344
        $defaults[Course :: PROPERTY_VISUAL] = $course->get_visual();
345
        $defaults[Course :: PROPERTY_TITULAR] = !is_null($course->get_titular()) ? $course->get_titular() : $this->user->get_id();
346
        $defaults[Course :: PROPERTY_NAME] = $course->get_name();
347
        $defaults[Course :: PROPERTY_CATEGORY] = $course->get_category();
348
        $defaults[Course :: PROPERTY_EXTERNAL_NAME] = $course->get_external_name();
349
        $defaults[Course :: PROPERTY_EXTERNAL_URL] = $course->get_external_url();
350
        $template_key = reset(array_keys($this->get_templates()));
351
        $defaults['template_id'] = $template_key;
352

  
353
        parent :: setDefaults($defaults);
354
    }
355

  
356
    function can_user_create()
357
    {
358
        $course_type = $this->object->get_course_type();
359
        if (!is_null($course_type) && !empty($course_type))
360
        {
361
            return $course_type->can_user_create($this->user);
362
        } else
363
        {
364
            return CourseTypeGroupCreationRight :: CREATE_NONE;
365
        }
366
    }
367

  
368
}
369

  
370
?>
php/lib/course/course_form.class.php Tue May 10 16:17:58 2011 +0200 → php/lib/course/course_form.class.php Wed May 11 17:18:44 2011 +0200
289 289
            $attr_array = array('disabled' => 'disabled');
290 290
        }
291 291
        $this->addElement('checkbox', CourseSettings :: PROPERTY_VISIBILITY, Translation :: get('CourseTypeVisibility'), '', $attr_array);
292
        $this->addElement('checkbox', CourseSettings :: PROPERTY_TEMPLATE, Translation :: get('CourseTemplate'));
292 293

  
293 294
        $access_disabled = $this->object->get_access_fixed();
294 295
        //Accessibility
php/lib/course/course_layout.class.php Tue May 10 16:17:58 2011 +0200 → php/lib/course/course_layout.class.php Wed May 11 17:18:44 2011 +0200
245 245
    {
246 246
        return Utilities :: get_classname_from_namespace(self :: CLASS_NAME, true);
247 247
    }
248
    
249
    public function __clone(){
250
        $this->set_course_id(null);
251
    }
248 252
}
php/lib/course/course_module.class.php Tue May 10 16:17:58 2011 +0200 → php/lib/course/course_module.class.php Wed May 11 17:18:44 2011 +0200
170 170
            return false;
171 171
        }
172 172

  
173
        return WeblcmsRights :: get_instance()->create_location_in_courses_subtree(WeblcmsRights :: TYPE_COURSE_MODULE, $this->get_id(), WeblcmsRights :: get_instance()->get_courses_subtree_root_id($this->get_course_code()), $this->get_course_code());
173
        $course_id = $this->get_course_code();
174
        $store = WeblcmsRights :: get_instance();
175
        $root_id = $store->get_courses_subtree_root_id($course_id);
176
        $result = $store->create_location_in_courses_subtree(WeblcmsRights :: TYPE_COURSE_MODULE, $this->get_id(), $root_id, $course_id);
177
        return $result;
174 178
    }
175 179

  
176 180
    function delete()
......
185 189
        }
186 190
        return parent :: delete();
187 191
    }
192
    
193
    public function __clone(){
194
        $this->set_id(null);
195
        $this->set_course_code(null);
196
        $this->set_section(null);
197
    }
188 198
}
189 199

  
190 200
?>
php/lib/course/course_rights.class.php Tue May 10 16:17:58 2011 +0200 → php/lib/course/course_rights.class.php Wed May 11 17:18:44 2011 +0200
243 243
        else
244 244
            return 0;
245 245
    }
246
    
247
    public function __clone(){
248
        $this->set_course_id(null);
249
    }
246 250
}
247 251
?>
php/lib/course/course_section.class.php Tue May 10 16:17:58 2011 +0200 → php/lib/course/course_section.class.php Wed May 11 17:18:44 2011 +0200
25 25
    const PROPERTY_VISIBLE = 'visible';
26 26
    const PROPERTY_DISPLAY_ORDER = 'display_order';
27 27

  
28
    /**
29
     * Get the default properties of all courses.
30
     * @return array The property names.
28
    /**
29
     * Get the default properties of all courses.
30
     * @return array The property names.
31 31
     */
32 32
    static function get_default_property_names($extended_property_names = array())
33 33
    {
34 34
        return parent :: get_default_property_names(array(self :: PROPERTY_COURSE_CODE, self :: PROPERTY_NAME, self :: PROPERTY_TYPE, self :: PROPERTY_VISIBLE, self :: PROPERTY_DISPLAY_ORDER));
35 35
    }
36
    
37
    private $tools = null;
38
    
39
    public function get_tools(){
40
        if(is_null($this->tools)){
41
            $wdm = WeblcmsDataManager :: get_instance();
42
            $tools = $wdm->retrieve_course_modules_by_section($this);
43
            $tools = $tools->as_array();
44
            $this->tools = empty($tools) ? array() : $tools;
45
        }
46
        return $this->tools;
47
    }
48
    
49
    public function set_tools($value){
50
        $this->tools = $value;
51
    }
36 52

  
37
    /**
38
     * inherited
53
    /**
54
     * inherited
39 55
     */
40 56
    function get_data_manager()
41 57
    {
......
100 116
        $sort = $wdm->retrieve_max_sort_value(self :: get_table_name(), self :: PROPERTY_DISPLAY_ORDER, $condition);
101 117
        $this->set_display_order($sort + 1);
102 118

  
103
        return $wdm->create_course_section($this);
119
        $result = $wdm->create_course_section($this);
120
        
121
        if($result){            
122
            foreach($this->tools as $tool){
123
                $tool->set_course_code($this->get_course_code());
124
                $tool->set_section($this->get_id());
125
                if(! $tool->create()){
126
                    return false;
127
                }
128
            }
129
        }
130
        
131
        return $result;
104 132
    }
105 133

  
106 134
    static function get_table_name()
107 135
    {
108 136
        return Utilities :: get_classname_from_namespace(self :: CLASS_NAME, true);
109 137
    }
138
    
139
    public function __clone(){
140
        $tools = $this->get_tools();
141
        $tools = Utilities::clone_array($tools);
142
        $this->set_tools($tools);        
143
        $this->set_course_code(null);
144
    }
110 145
}
111 146
?>
php/lib/course/course_settings.class.php Tue May 10 16:17:58 2011 +0200 → php/lib/course/course_settings.class.php Wed May 11 17:18:44 2011 +0200
18 18
    const PROPERTY_COURSE_ID = 'course_id';
19 19
    const PROPERTY_LANGUAGE = 'language';
20 20
    const PROPERTY_VISIBILITY = 'visibility';
21
    const PROPERTY_TEMPLATE = 'template';
21 22
    const PROPERTY_ACCESS = 'access';
22 23
    const PROPERTY_MAX_NUMBER_OF_MEMBERS = 'max_number_of_members';
23 24

  
......
32 33
    {
33 34
        if (empty($extended_property_names))
34 35
            $extended_property_names = array(self :: PROPERTY_COURSE_ID);
35
        return array_merge($extended_property_names, array(self :: PROPERTY_LANGUAGE, self :: PROPERTY_VISIBILITY, self :: PROPERTY_ACCESS, self :: PROPERTY_MAX_NUMBER_OF_MEMBERS));
36
        return array_merge($extended_property_names, array(self :: PROPERTY_LANGUAGE, self :: PROPERTY_VISIBILITY, self :: PROPERTY_ACCESS, self :: PROPERTY_TEMPLATE, self :: PROPERTY_MAX_NUMBER_OF_MEMBERS));
36 37
    }
37 38

  
38 39
    /**
......
71 72
    }
72 73

  
73 74
    /**
75
     * Returns true if this course is a template. False otherwise.
76
     * @return bool 
77
     */
78
    function get_template()
79
    {
80
        return $this->get_default_property(self :: PROPERTY_TEMPLATE);
81
    }
82

  
83
    /**
74 84
     * Returns the acces of this course object
75 85
     * @return boolean the acces Code
76 86
     */
......
116 126
    }
117 127

  
118 128
    /**
129
     * Set if this course is template or note.
130
     * @param bool $value
131
     */
132
    function set_template($value)
133
    {
134
        $this->set_default_property(self :: PROPERTY_TEMPLATE, $value);
135
    }
136

  
137
    /**
119 138
     * Sets the access of this course object
120 139
     * @param Boolean $access the access
121 140
     */
......
225 244
//        $wdm = WeblcmsDataManager :: get_instance();
226 245
//        return $wdm->is_course_type_admin($this, $user->get_id());
227 246
//    }
247
    
248
    public function __clone(){
249
        $this->set_course_id(null);
250
    }
228 251
}
229 252
?>
php/lib/data_manager/mdb2.class.php Tue May 10 16:17:58 2011 +0200 → php/lib/data_manager/mdb2.class.php Wed May 11 17:18:44 2011 +0200
849 849
        $condition = new AndCondition($conditions);
850 850
        return $this->retrieve_object(CourseModule :: get_table_name(), $condition, array(), CourseModule :: CLASS_NAME);
851 851
    }
852

  
852
   
853
    function retrieve_course_modules_by_course($course)
854
    {
855
        $id = is_object($course) ? $course->get_id() : $course;
856
        $condition = new EqualityCondition(CourseModule :: PROPERTY_COURSE_CODE, $id);
857
        return $this->retrieve_objects(CourseModule :: get_table_name(), $condition, array(), CourseModule :: CLASS_NAME);
858
    }
859
   
860
    function retrieve_course_modules_by_section($section)
861
    {
862
        $id = is_object($section) ? $section->get_id() : $section;
863
        $condition = new EqualityCondition(CourseModule :: PROPERTY_SECTION, $id);
864
        return $this->retrieve_objects(CourseModule :: get_table_name(), $condition, array(), CourseModule :: CLASS_NAME);
865
    }
866
    
853 867
    function retrieve_course_settings($id)
854 868
    {
855 869
        $condition = new EqualityCondition(CourseSettings :: PROPERTY_COURSE_ID, $id);
php/lib/weblcms_data_manager.interface.php Tue May 10 16:17:58 2011 +0200 → php/lib/weblcms_data_manager.interface.php Wed May 11 17:18:44 2011 +0200
494 494
     * @return array The list of available course modules
495 495
     */
496 496
    /*    function get_course_modules($course_code); */
497
    
498
    
497 499

  
498 500
    /**
499 501
     * Gets all course modules
......
501 503
     */
502 504
    function get_all_course_modules();
503 505

  
506

  
507
    function retrieve_course($course_code);
508
        
504 509
    /**
505 510
     * Retrieves a single course from persistent storage.
506 511
     * @param string $course_code The alphanumerical identifier of the course.
507 512
     * @return Course The course.
508 513
     */
509
    function retrieve_course($course_code);
514
    function retrieve_course_by_visual_code($visual_code);
510 515

  
511 516
    function retrieve_empty_course();
512 517

  
513 518
    function retrieve_course_module($course_module_id);
519
    
520
    /**
521
     * @return ResultSet
522
     */
523
    function retrieve_course_modules_by_course($course);
524
    
525
    /**
526
     * @return ResultSet
527
     */
528
    function retrieve_course_modules_by_section($section);
514 529

  
515 530
    function retrieve_course_settings($course_code);
516 531

  
......
546 561
     * @param array $order_by
547 562
     * @param int $offset
548 563
     * @param int $max_objects
549
     * @return CourseResultSet
564
     * @return ResultSet
550 565
     */
551 566
    function retrieve_courses($condition = null, $offset = null, $count = null, $order_property = null);
552

  
567
    
553 568
    /**
554 569
     * Retrieve a series of courses for a specific user + the relation
555 570
     * @param Condition $condition
556 571
     * @param array $order_by
557 572
     * @param int $offset
558 573
     * @param int $max_objects
559
     * @return CourseResultSet
574
     * @return ResultSet
560 575
     */
561 576
    function retrieve_user_courses($condition = null, $offset = null, $count = null, $order_property = null);
562 577

  
......
823 838

  
824 839
    function count_course_sections($conditions = null);
825 840

  
841
    /**
842
     * @return ResultSet
843
     */
826 844
    function retrieve_course_sections($condition = null, $offset = null, $count = null, $order_property = null);
827 845

  
828 846
    //function count_new_publications_from_course($course, $user);
/dev/null Thu Jan 01 00:00:00 1970 +0000 → php/lib/weblcms_manager/component/course_creator_from_template.class.php Wed May 11 17:18:44 2011 +0200
1
<?php
2

  
3
namespace application\weblcms;
4

  
5
use common\libraries\Header;
6
use admin\AdminManager;
7
use common\libraries\Redirect;
8
use common\libraries\Display;
9
use common\libraries\DynamicTabsRenderer;
10
use common\libraries\Breadcrumb;
11
use common\libraries\BreadcrumbTrail;
12
use common\libraries\EqualityCondition;
13
use common\libraries\Request;
14
use common\libraries\DelegateComponent;
15
use common\libraries\Translation;
16
use common\libraries\Utilities;
17

  
18
/**
19
 * Create a course from a template. I.e. duplicate the course.
20
 */
21
class WeblcmsManagerCourseCreatorFromTemplateComponent extends WeblcmsManager implements DelegateComponent
22
{
23

  
24
    /**
25
     * Runs this component and displays its output.
26
     */
27
    function run()
28
    {
29
        $this->check_access();
30

  
31
        if ($this->get_user()->is_platform_admin())
32
        {
33
            Header :: set_section('admin');
34
        }
35

  
36
        $trail = BreadcrumbTrail :: get_instance();
37

  
38
        $course = $this->get_course();
39
        $url = $this->get_url();
40
        $form = new CourseCreateFromTemplateForm($course, $this->get_user(), $url, $this);
41

  
42
        if ($form->validate())
43
        {
44
            $visual_code = $form->exportValue(Course :: PROPERTY_VISUAL);
45
            if (WebLcmsDataManager :: get_instance()->retrieve_course_by_visual_code($visual_code))
46
            {
47
                $this->display_header($trail, false, true);
48
                $this->display_error_message(Translation :: get('CourseCodeAlreadyExists'));
49
                $form->display();
50
                $this->display_footer();
51
            } else
52
            {
53
                $success = $form->create();
54
                $course = $form->get_course();
55
                $array_filter = array(WeblcmsManager :: PARAM_COURSE);
56
                $array_type = array();
57
                if ($success === true)
58
                {
59
                    $array_type['go'] = WeblcmsManager :: ACTION_VIEW_COURSE;
60
                    $array_type['course'] = $course->get_id();
61
                    $array_filter = array();
62
                } else if ($success instanceof Course)//?? what's that
63
                {
64
                    $array_type['course'] = $course->get_id();
65
                    $array_type['go'] = WeblcmsManager :: ACTION_COURSE_CREATE_REQUEST_CREATOR;
66
                    $array_filter = null;
67
                } else
68
                {
69
                    $array_type['go'] = WeblcmsManager :: ACTION_VIEW_WEBLCMS_HOME;
70
                }
71
                $this->redirect(Translation :: get($success ? 'CourseSaved' : 'CourseNotSaved'), ($success ? false : true), $array_type, $array_filter);
72
            }
73
        } else
74
        {
75
            $this->display_header();
76
            echo '<div class="clear"></div><br />';
77
            echo '<div id="form_container">';
78
            $form->display();
79
            echo '</div>';
80
            $this->display_footer();
81
        }
82
    }
83

  
84
    function check_access()
85
    {
86
        $authorize = $this->get_user()->is_teacher() || $this->get_user()->is_platform_admin();
87

  
88
        if (!$authorize)
89
        {
90
            $this->display_error_page(Translation :: get('NotAllowed', null, Utilities:: COMMON_LIBRARIES));
91
            exit();
92
        }
93
    }
94

  
95
    function add_additional_breadcrumbs(BreadcrumbTrail $breadcrumbtrail)
96
    {
97
        $breadcrumbtrail->add_help('weblcms_course_creator');
98

  
99
        if ($this->get_user()->is_platform_admin())
100
        {
101
            $breadcrumbtrail->add(new Breadcrumb(Redirect :: get_link(AdminManager :: APPLICATION_NAME, array(AdminManager :: PARAM_ACTION => AdminManager :: ACTION_ADMIN_BROWSER), array(), false, Redirect :: TYPE_CORE), Translation :: get('TypeName', null, 'admin')));
102
            $breadcrumbtrail->add(new Breadcrumb(Redirect :: get_link(AdminManager :: APPLICATION_NAME, array(AdminManager :: PARAM_ACTION => AdminManager :: ACTION_ADMIN_BROWSER, DynamicTabsRenderer :: PARAM_SELECTED_TAB => WeblcmsManager :: APPLICATION_NAME), array(), false, Redirect :: TYPE_CORE), Translation :: get('Courses')));
103
        }
104

  
105
        $course = $this->get_course();
106
        $id = $course->get_id();
107

  
108
        if (!$id)
109
        {
110
            $breadcrumbtrail->add(new Breadcrumb($this->get_url(), Translation :: get('Create', null, Utilities:: COMMON_LIBRARIES)));
111
        } else
112
        {
113
            $breadcrumbtrail->add(new Breadcrumb($this->get_url(array(WeblcmsManager :: PARAM_ACTION => WeblcmsManager :: ACTION_ADMIN_COURSE_BROWSER), array(WeblcmsManager :: PARAM_COURSE, WeblcmsManager :: PARAM_TOOL)), Translation :: get('CourseList')));
114
            $breadcrumbtrail->add(new Breadcrumb($this->get_url(), Translation :: get('Update', null, Utilities:: COMMON_LIBRARIES)));
115
        }
116
    }
117

  
118
    function get_additional_parameters()
119
    {
120
        return array(self :: PARAM_COURSE);
121
    }
122

  
123
}
124

  
125
?>
php/lib/weblcms_manager/component/home.class.php Tue May 10 16:17:58 2011 +0200 → php/lib/weblcms_manager/component/home.class.php Wed May 11 17:18:44 2011 +0200
180 180
    {
181 181
        $html = array();
182 182
        $img_path = htmlspecialchars(Theme :: get_common_image_path());
183
        $html[] = '<li class="tool_list_menu" style="background-image: url(' . $img_path . 'action_quick_create.png)"><a style="top: -3px; position: relative;" href="' . htmlspecialchars($this->get_url(array(Application :: PARAM_ACTION => WeblcmsManager :: ACTION_CREATE_COURSE_FROM_TEMPLATE))) . '">' . htmlspecialchars(Translation :: get('QuickCourseCreate')) . '</a></li>';
183 184
        $html[] = '<li class="tool_list_menu" style="background-image: url(' . $img_path . 'action_create.png)"><a style="top: -3px; position: relative;" href="' . htmlspecialchars($this->get_url(array(Application :: PARAM_ACTION => WeblcmsManager :: ACTION_CREATE_COURSE))) . '">' . htmlspecialchars(Translation :: get('CourseCreate')) . '</a></li>';
184 185
        $html[] = '<li class="tool_list_menu" style="background-image: url(' . $img_path . 'action_browser.png)"><a style="top: -3px; position: relative;" href="' . htmlspecialchars($this->get_url(array(Application :: PARAM_ACTION => WeblcmsManager :: ACTION_ADMIN_COURSE_BROWSER))) . '">' . htmlspecialchars(Translation :: get('CourseList')) . '</a></li>';
185 186
        $html[] = '<li class="tool_list_menu" style="background-image: url(' . $img_path . 'action_browser.png)"><a style="top: -3px; position: relative;" href="' . htmlspecialchars($this->get_url(array(Application :: PARAM_ACTION => WeblcmsManager :: ACTION_ADMIN_REQUEST_BROWSER))) . '">' . htmlspecialchars(Translation :: get('RequestList')) . '</a></li>';
php/lib/weblcms_manager/weblcms_manager.class.php Tue May 10 16:17:58 2011 +0200 → php/lib/weblcms_manager/weblcms_manager.class.php Wed May 11 17:18:44 2011 +0200
115 115
    const ACTION_VIEW_WEBLCMS_HOME = 'home';
116 116
    const ACTION_VIEW_COURSE = 'course_viewer';
117 117
    const ACTION_CREATE_COURSE = 'course_creator';
118
    const ACTION_CREATE_COURSE_FROM_TEMPLATE = 'course_creator_from_template';
118 119
    const ACTION_IMPORT_COURSES = 'course_importer';
119 120
    const ACTION_IMPORT_COURSE_USERS = 'course_user_importer';
120 121
    const ACTION_DELETE_COURSE = 'course_deleter';
......
1655 1656
                Application :: PARAM_ACTION => WeblcmsManager :: ACTION_ADMIN_COURSE_BROWSER)));
1656 1657
        $links[] = new DynamicAction(Translation :: get('CreateCourse'), Translation :: get('CreateDescription'), Theme :: get_image_path() . 'admin/add.png', Redirect :: get_link(self :: APPLICATION_NAME, array(
1657 1658
                Application :: PARAM_ACTION => WeblcmsManager :: ACTION_CREATE_COURSE)));
1659
//        $links[] = new DynamicAction(Translation :: get('CreateCourse'), Translation :: get('CreateDescription'), Theme :: get_image_path() . 'admin/add.png', Redirect :: get_link(self :: APPLICATION_NAME, array(
1660
//                Application :: PARAM_ACTION => WeblcmsManager :: ACTION_CREATE_COURSE_FROM_TEMPLATE)));
1658 1661
        $links[] = new DynamicAction(Translation :: get('Import'), Translation :: get('ImportDescription'), Theme :: get_image_path() . 'admin/import.png', Redirect :: get_link(self :: APPLICATION_NAME, array(
1659 1662
                Application :: PARAM_ACTION => WeblcmsManager :: ACTION_IMPORT_COURSES)));
1660 1663
        $links[] = new DynamicAction(Translation :: get('RequestList'), Translation :: get('RequestDescription'), Theme :: get_image_path() . 'admin/list.png', Redirect :: get_link(self :: APPLICATION_NAME, array(
resources/i18n/en.i18n Tue May 10 16:17:58 2011 +0200 → resources/i18n/en.i18n Wed May 11 17:18:44 2011 +0200
440 440
QuestionDetails = "Question details"
441 441
SubmittedBy = "Submitted by"
442 442
Actions = "Actions"
443
ViewProgressUsers = "View progress users"
443
ViewProgressUsers = "View progress users"
444
QuickCourseCreate = "Quick course"
resources/i18n/fr.i18n Tue May 10 16:17:58 2011 +0200 → resources/i18n/fr.i18n Wed May 11 17:18:44 2011 +0200
392 392
open_and_closed_seperated = "Ouvert et fermé séparés"
393 393
open_only = "Ouvert seulement"
394 394
toCourse = "Pour sûr"
395
wasNotFoundInTheDatabase = "Pas trouvé dans la base de données"
395
wasNotFoundInTheDatabase = "Pas trouvé dans la base de données"
396
QuickCourseCreate="Cours-minute"
    (1-1/1)