/**
* The mform class for creating and editing a calendar
- *
+ *
* @copyright 2009 Sam Hemelryk
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$mon = optional_param('cal_m', 0, PARAM_INT);
$yr = optional_param('cal_y', 0, PARAM_INT);
if ($courseid = optional_param('course', 0, PARAM_INT)) {
- $course = $DB->get_record('course', array('id'=>$courseid));
+ $course = $DB->get_record('course', array('id'=>$courseid));
} else {
$course = NULL;
}
}
if ($event->modulename == 'assignment'){
// TODO: rewrite this hack somehow
- if (!calendar_edit_event_allowed($event)){ // cannot manage entries, eg. student
+ if (!calendar_edit_event_allowed($event)){ // cannot manage entries, eg. student
if (!$assignment = $DB->get_record('assignment', array('id'=>$event->instance))) {
// print_error("invalidid", 'assignment');
continue;
if (isset($event->cssclass)) {
echo '<td class="description '.$event->cssclass.'">';
} else {
- echo '<td class="description">';
+ echo '<td class="description">';
}
-
+
echo $event->description;
if (calendar_edit_event_allowed($event) && $showactions) {
echo '<div class="commands">';
} else {
$content .= '<td style="width: 11px;"><img src="'.$OUTPUT->old_icon_url('t/show') . '" class="iconsmall" alt="'.get_string('hide').'" title="'.get_string('tt_showcourse', 'calendar').'" style="cursor:pointer" onclick="location.href='."'".CALENDAR_URL.'set.php?var=showcourses'.$getvars."'".'" /></td>';
$content .= '<td><a href="'.CALENDAR_URL.'set.php?var=showcourses'.$getvars.'" title="'.get_string('tt_showcourse', 'calendar').'">'.get_string('course', 'calendar').'</a></td>'."\n";
-
+
}
if ($course !== null) {
// speedup hack for calendar related blocks
$SESSION->cal_courses_shown = array($course->id => $course);
- } else {
+ } else {
$SESSION->cal_courses_shown = calendar_get_default_courses(true);
}
if(empty($SESSION->cal_users_shown)) {
$SESSION->cal_courses_shown = intval($SESSION->cal_courses_shown);
}
if($courseeventsfrom === NULL) {
- $courseeventsfrom = $SESSION->cal_courses_shown;
+ $courseeventsfrom = $SESSION->cal_courses_shown;
}
-
+
// MDL-9059, $courseeventsfrom can be an int, or an array of ints, or an array of course objects
// convert all to array of objects
// we probably should do some clean up and make sure that session is set to use the proper form
foreach ($courseeventsfrom as $i=>$courseid) { // TODO: this seems wrong, the array is often constructed as [courseid] => 1 ???
if (is_int($courseid)) {
$courseeventsfrom[$i] = $DB->get_record('course', array('id'=>$courseid));
- }
- }
+ }
+ }
}
if($groupeventsfrom === NULL) {
$courserecord = $courseeventsfrom[$courseid];
} else {
$courserecord = $DB->get_record('course', array('id'=>$courseid));
- }
+ }
$courserecord = $DB->get_record('course', array('id'=>$courseid));
if ($courserecord->groupmode != NOGROUPS || !$courserecord->groupmodeforce) {
$groupids[] = $courseid;
if(has_capability('moodle/calendar:manageentries', $coursecontext)) {
$allowed->courses = array($course->id => 1);
-
+
if($course->groupmode != NOGROUPS || !$course->groupmodeforce) {
$allowed->groups = groups_get_all_groups($SESSION->cal_course_referer);
}
/**
* Return the number of repeat events there are in this events series
- *
+ *
* @return int
*/
public function count_repeats() {
$DB->set_field('event', 'description', $this->properties->description, array('id'=>$this->properties->id));
}
-
+
// Log the event entry.
add_to_log($this->properties->courseid, 'calendar', 'add', 'event.php?action=edit&id='.$this->properties->id, $this->properties->name);
} else {
$draftiddescription = 0;
}
-
+
// Structure the description field as the editor requires
$properties->description = array('text'=>$properties->description, 'format'=>$properties->format, 'itemid'=>$draftiddescription);
}
$options[CALENDAR_TF_12] = get_string('timeformat_12', 'calendar');
$options[CALENDAR_TF_24] = get_string('timeformat_24', 'calendar');
$select = html_select::make($options, "timeformat", $prefs->timeformat, false);
- $select->nothingvalue = '';
+ $select->nothingvalue = '';
echo $OUTPUT->select($select);
?>
<p><?php print_string('explain_timeformat', 'calendar'); ?></p>
$options[5] = get_string('friday', 'calendar');
$options[6] = get_string('saturday', 'calendar');
$select = html_select::make($options, 'startwday', $prefs->startwday, false);
- $select->nothingvalue = '';
+ $select->nothingvalue = '';
echo $OUTPUT->select($select);
?>
<p><?php print_string('explain_startwday', 'calendar'); ?></p>
$options[$i] = $i;
}
$select = html_select::make($options, "maxevents", $prefs->maxevents, false);
- $select->nothingvalue = '';
+ $select->nothingvalue = '';
echo $OUTPUT->select($select);
?>
<p><?php print_string('explain_maxevents', 'calendar'); ?></p>
$options[$i] = $i;
}
$select = html_select::make($options, "lookahead", $prefs->lookahead, false);
- $select->nothingvalue = '';
+ $select->nothingvalue = '';
echo $OUTPUT->select($select);
?>
<p><?php print_string('explain_lookahead', 'calendar'); ?></p>
<tr>
<th scope="row"><?php print_string('pref_persistflt', 'calendar')?>:</th>
<td>
- <?php
+ <?php
$select = html_select::make(array(0 => get_string('no'), 1 => get_string('yes')), 'persistflt', $prefs->persistflt, false);
- $select->nothingvalue = '';
+ $select->nothingvalue = '';
echo $OUTPUT->select($select);
?>
<p><?php print_string('explain_persistflt', 'calendar'); ?></p>
}
}
}
-
+
// Extract information: events vs. time
calendar_events_by_day($events, $m, $y, $eventsbyday, $durationbyday, $typesbyday, $courses);
echo "</table>\n"; // Tabular display of days ends
- // OK, now for the filtering display
- echo '<div class="filters"><table><tr>';
-
- // Global events
- if($SESSION->cal_show_global) {
- echo '<td class="event_global" style="width: 8px;"></td><td><strong>'.get_string('globalevents', 'calendar').':</strong> ';
- echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showglobal&'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
- }
- else {
- echo '<td style="width: 8px;"></td><td><strong>'.get_string('globalevents', 'calendar').':</strong> ';
- echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showglobal&'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
- }
-
- // Course events
- if(!empty($SESSION->cal_show_course)) {
- echo '<td class="event_course" style="width: 8px;"></td><td><strong>'.get_string('courseevents', 'calendar').':</strong> ';
- echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showcourses&'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
- }
- else {
- echo '<td style="width: 8px;"></td><td><strong>'.get_string('courseevents', 'calendar').':</strong> ';
- echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showcourses&'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
- }
-
- echo "</tr>\n";
-
+ // OK, now for the filtering display
+ echo '<div class="filters"><table><tr>';
+
+ // Global events
+ if($SESSION->cal_show_global) {
+ echo '<td class="event_global" style="width: 8px;"></td><td><strong>'.get_string('globalevents', 'calendar').':</strong> ';
+ echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showglobal&'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
+ }
+ else {
+ echo '<td style="width: 8px;"></td><td><strong>'.get_string('globalevents', 'calendar').':</strong> ';
+ echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showglobal&'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
+ }
+
+ // Course events
+ if(!empty($SESSION->cal_show_course)) {
+ echo '<td class="event_course" style="width: 8px;"></td><td><strong>'.get_string('courseevents', 'calendar').':</strong> ';
+ echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showcourses&'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
+ }
+ else {
+ echo '<td style="width: 8px;"></td><td><strong>'.get_string('courseevents', 'calendar').':</strong> ';
+ echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showcourses&'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
+ }
+
+ echo "</tr>\n";
+
if(!empty($USER->id) && !has_capability('moodle/legacy:guest', get_context_instance(CONTEXT_SYSTEM), 0, false)) {
- echo '<tr>';
- // Group events
- if($SESSION->cal_show_groups) {
- echo '<td class="event_group" style="width: 8px;"></td><td><strong>'.get_string('groupevents', 'calendar').':</strong> ';
- echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showgroups&'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
- }
- else {
- echo '<td style="width: 8px;"></td><td><strong>'.get_string('groupevents', 'calendar').':</strong> ';
- echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showgroups&'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
- }
- // User events
- if($SESSION->cal_show_user) {
- echo '<td class="event_user" style="width: 8px;"></td><td><strong>'.get_string('userevents', 'calendar').':</strong> ';
- echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showuser&'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
- }
- else {
- echo '<td style="width: 8px;"></td><td><strong>'.get_string('userevents', 'calendar').':</strong> ';
- echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showuser&'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
- }
- echo "</tr>\n";
- }
-
+ echo '<tr>';
+ // Group events
+ if($SESSION->cal_show_groups) {
+ echo '<td class="event_group" style="width: 8px;"></td><td><strong>'.get_string('groupevents', 'calendar').':</strong> ';
+ echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showgroups&'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
+ }
+ else {
+ echo '<td style="width: 8px;"></td><td><strong>'.get_string('groupevents', 'calendar').':</strong> ';
+ echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showgroups&'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
+ }
+ // User events
+ if($SESSION->cal_show_user) {
+ echo '<td class="event_user" style="width: 8px;"></td><td><strong>'.get_string('userevents', 'calendar').':</strong> ';
+ echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showuser&'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
+ }
+ else {
+ echo '<td style="width: 8px;"></td><td><strong>'.get_string('userevents', 'calendar').':</strong> ';
+ echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showuser&'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
+ }
+ echo "</tr>\n";
+ }
+
echo '</table></div>';
}
// Check the reload-forcing
var changeDetector=document.getElementById('completion_dynamic_change');
if(changeDetector.value==1) {
- changeDetector.value=0;
+ changeDetector.value=0;
window.location.reload();
- return;
+ return;
}
var toggles=YAHOO.util.Dom.getElementsByClassName('togglecompletion', 'form');
completion_init_toggle(toggles[i]);
}
}
-}
+}
function completion_init_toggle(form) {
// Store all necessary references for easy access
switch(inputs[i].name) {
case 'id' : form.cmid=inputs[i].value; break;
case 'completionstate' : form.otherState=inputs[i].value; break;
- }
+ }
if(inputs[i].type=='image') {
form.image=inputs[i];
}
function completion_toggle(e) {
YAHOO.util.Event.preventDefault(e);
- // By setting completion_wwwroot you can cause it to use absolute path
+ // By setting completion_wwwroot you can cause it to use absolute path
// otherwise script assumes it is called from somewhere in /course
var target = moodle_cfg.wwwroot + '/course/togglecompletion.php';
YAHOO.util.Connect.asyncRequest('POST',target,
-<?php //$Id$
+<?php
require_once($CFG->libdir.'/formslib.php');
require_once($CFG->libdir.'/questionlib.php');
return $errors;
}
}
-?>
+
echo $OUTPUT->footer();
-?>
\ No newline at end of file
$coursecontext = null;
$context = $categorycontext;
}
-
+
/// form definition with new course defaults
//--------------------------------------------------------------------------------
$mform->addElement('header','general', get_string('general', 'form'));
$mform->setConstants('idnumber', $course->idnumber);
}
-
+
$mform->addElement('editor','summary_editor', get_string('summary'), null, $editoroptions);
$mform->setHelpButton('summary_editor', array('text2', get_string('helptext')), true);
$mform->setType('summary_editor', PARAM_RAW);
return $errors;
}
}
-?>
+
$mform->display();
echo $OUTPUT->footer();
-?>
+
-<?php
+<?php
require_once ($CFG->dirroot.'/course/moodleform_mod.php');
class editcategory_form extends moodleform {
$this->add_action_buttons(true, $strsubmit);
}
-}
-?>
+}
+
-<?php //$Id$
+<?php
require_once($CFG->libdir.'/formslib.php');
/// Easy!
-?>
\ No newline at end of file
}
$activities = get_array_of_activities($id);
-
+
foreach ($activities as $activity) {
if (empty($type)) {
$module = array('id' => $activity->id, 'courseid' => $id, 'name' => $activity->name, 'type' => $activity->mod);
}
-?>
+
To create a new course format, make another folder in here.
-If you want a basic format, you only need to write the 'standard files' listed
-below.
+If you want a basic format, you only need to write the 'standard files' listed
+below.
If you want to store information in the database for your format, or control
access to features of your format, you need some of the optional files too.
-All names below assume that your format is called 'yourformat'.
+All names below assume that your format is called 'yourformat'.
Standard files
--------------
-* yourformat/format.php
+* yourformat/format.php
- Code that actually displays the course view page. See existing formats for
+ Code that actually displays the course view page. See existing formats for
examples.
-
-* yourformat/config.php
- Configuration file, mainly controlling default blocks for the format.
+* yourformat/config.php
+
+ Configuration file, mainly controlling default blocks for the format.
See existing formats for examples.
-
+
* yourformat/lang/en_utf8/format_yourformat.php
Language file containing basic language strings for your format. Here
is a minimal language file:
-
+
<?php
$string['formatyourformat']='Your format'; // Name to display for format
$string['nameyourformat']='section'; // Name of a section within your format
The first string is used in the dropdown menu of course settings. The second
is used when editing an activity within a course of your format.
-
- Note that existing formats store their language strings in the main
+
+ Note that existing formats store their language strings in the main
moodle.php, which you can also do, but this separate file is recommended
for contributed formats.
-
+
You can also store other strings in this file if you wish. They can be
accessed as follows, for example to get the section name:
-
+
get_string('nameyourformat','format_yourformat');
-
+
Of course you can have other folders as well as just English if you want
to provide multiple languages.
-
-
+
+
Optional files (database access)
--------------------------------
Database table definitions. Use your format name at the start of the table
names to increase the chance that they are unique.
-
+
* yourformat/db/upgrade.php
Database upgrade instructions. Similar to other upgrade.php files, so look
- at those for modules etc. if you want to see.
-
+ at those for modules etc. if you want to see.
+
The function must look like:
-
- function xmldb_format_yourformat_upgrade($oldversion) {
+
+ function xmldb_format_yourformat_upgrade($oldversion) {
...
-
+
* yourformat/version.php
Required if you use database tables.
$plugin->requires = 2006092801; // Required Moodle version
?>
-
+
Optional files (backup)
-----------------------
function yourformat_backup_format_data($bf,$preferences) {
...
-
+
* yourformat/restorelib.php
Similar to restore code for other plugins. Must have a function:
-
+
function yourformat_restore_format_data($restore,$data) {
...
-
+
($data is the xmlized data underneath FORMATDATA in the backup XML file.
Do print_object($data); while testing to see how it looks.)
-
-
-Optional file (capabilities)
+
+
+Optional file (capabilities)
----------------------------
-
+
If this file exists, Moodle refreshes your format's capabilities
(checks that they are all included in the database) whenever you increase
the version in yourformat/version.php.
-
+
* yourformat/db/access.php
- Contains capability entries similar to other access.php files.
-
+ Contains capability entries similar to other access.php files.
+
The array definition must look like:
-
- $format_yourformat_capabilities = array(
+
+ $format_yourformat_capabilities = array(
...
-
- Format names must look like:
-
+
+ Format names must look like:
+
format/yourformat:specialpower
-
+
Capability definitions in your language file must look like:
-
+
$string['yourformat:specialpower']='Revolutionise the world';
-
-
+
+
Optional file (styles)
----------------------
-<?php //$Id$
+<?php
//
// Optional course format configuration file
//
// The default blocks layout for this course format:
$format['defaultblocks'] = ':news_items,recent_activity,calendar_upcoming';
-?>
+
-<?php // $Id$
+<?php
// format.php - course format featuring single activity
// included from view.php
$moduleformat = $module.'_course_format_display';
if (function_exists($moduleformat)) {
$moduleformat($USER,$course);
- } else {
+ } else {
echo $OUTPUT->notification('The module '. $module. ' does not support single activity course format');
}
-<?php //$Id$
+<?php
//
// Optional course format configuration file
//
// The default blocks layout for this course format:
$format['defaultblocks'] = ':search_forums,calendar_upcoming,social_activities,recent_activity,admin,course_list';
-?>
+
-<?php // $Id$
+<?php
// format.php - course format featuring social forum
// included from view.php
$CFG->ajaxcapable = true;
$CFG->ajaxtestedbrowsers = array('MSIE' => 6.0, 'Gecko' => 20061111);
-?>
+
//
// Optional course format configuration file
//
-// This file contains any specific configuration settings for the
+// This file contains any specific configuration settings for the
// format.
//
// The default blocks layout for this course format:
$format['defaultblocks'] = ':search_forums,news_items,calendar_upcoming,recent_activity';
//
-?>
\ No newline at end of file
// Included from "view.php"
/**
* Evaluation topics format for course display - NO layout tables, for accessibility, etc.
- *
- * A duplicate course format to enable the Moodle development team to evaluate
- * CSS for the multi-column layout in place of layout tables.
+ *
+ * A duplicate course format to enable the Moodle development team to evaluate
+ * CSS for the multi-column layout in place of layout tables.
* Less risk for the Moodle 1.6 beta release.
* 1. Straight copy of topics/format.php
* 2. Replace <table> and <td> with DIVs; inline styles.
* 3. Reorder columns so that in linear view content is first then blocks;
* styles to maintain original graphical (side by side) view.
*
- * Target: 3-column graphical view using relative widths for pixel screen sizes
+ * Target: 3-column graphical view using relative widths for pixel screen sizes
* 800x600, 1024x768... on IE6, Firefox. Below 800 columns will shift downwards.
- *
+ *
* http://www.maxdesign.com.au/presentation/em/ Ideal length for content.
* http://www.svendtofte.com/code/max_width_in_ie/ Max width in IE.
*
* @copyright © 2006 The Open University
* @author N.D.Freear@open.ac.uk, and others.
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
- * @package
+ * @package
*/
//TODO (nfreear): Accessibility: evaluation, lang/en_utf8/moodle.php: $string['formattopicscss']
function callback_topics_request_key() {
return 'topic';
}
-?>
+
$CFG->ajaxcapable = true;
$CFG->ajaxtestedbrowsers = array('MSIE' => 6.0, 'Gecko' => 20061111);
-?>
+
//
// Optional course format configuration file
//
-// This file contains any specific configuration settings for the
+// This file contains any specific configuration settings for the
// format.
//
// The default blocks layout for this course format:
$format['defaultblocks'] = ':search_forums,news_items,calendar_upcoming,recent_activity';
//
-?>
\ No newline at end of file
-<?php // $Id$
+<?php
// Display the whole course as "weeks" made of of modules
// Included from "view.php"
/**
* Evaluation weekly format for course display - NO layout tables, for accessibility, etc.
- *
- * A duplicate course format to enable the Moodle development team to evaluate
- * CSS for the multi-column layout in place of layout tables.
+ *
+ * A duplicate course format to enable the Moodle development team to evaluate
+ * CSS for the multi-column layout in place of layout tables.
* Less risk for the Moodle 1.6 beta release.
* 1. Straight copy of weeks/format.php
* 2. Replace <table> and <td> with DIVs; inline styles.
* 3. Reorder columns so that in linear view content is first then blocks;
* styles to maintain original graphical (side by side) view.
*
- * Target: 3-column graphical view using relative widths for pixel screen sizes
+ * Target: 3-column graphical view using relative widths for pixel screen sizes
* 800x600, 1024x768... on IE6, Firefox. Below 800 columns will shift downwards.
- *
+ *
* http://www.maxdesign.com.au/presentation/em/ Ideal length for content.
* http://www.svendtofte.com/code/max_width_in_ie/ Max width in IE.
*
* @copyright © 2006 The Open University
* @author N.D.Freear@open.ac.uk, and others.
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
- * @package
+ * @package
*/
//TODO (nfreear): Accessibility: evaluation, lang/en_utf8/moodle.php: $string['formatweekscss']
// Note, 'right side' is BEFORE content.
echo '<li id="section-0" class="section main" >';
echo '<div class="left side"> </div>';
- echo '<div class="right side" > </div>';
+ echo '<div class="right side" > </div>';
echo '<div class="content">';
-
+
echo '<div class="summary">';
$coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
' class="icon edit" alt="'.$streditsummary.'" /></a></p>';
}
echo '</div>';
-
+
print_section($course, $thissection, $mods, $modnamesused);
if ($PAGE->user_is_editing()) {
// Note, 'right side' is BEFORE content.
echo '<div class="right side">';
-
+
if ($displaysection == $section) {
echo '<a href="view.php?id='.$course->id.'&week=0#section-'.$section.'" title="'.$strshowallweeks.'">'.
'<img src="'.$OUTPUT->old_icon_url('i/all') . '" class="icon wkall" alt="'.$strshowallweeks.'" /></a><br />';
function callback_weeks_request_key() {
return 'week';
}
-?>
+
}
echo $OUTPUT->footer();
-?>
+
-<?php // $Id$
+<?php
require_once($CFG->libdir.'/formslib.php');
}
}
-?>
+
echo $OUTPUT->footer();
-?>
\ No newline at end of file
-<?php // $Id$
+<?php
if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
if (!empty($table)) {
echo $OUTPUT->table($table);
}
-?>
+
-<?php // $Id$
+<?php
require_once($CFG->libdir.'/formslib.php');
}
}
}
-?>
+
return $data;
}
-?>
\ No newline at end of file
echo '</p>';
-?>
\ No newline at end of file
onFocus="getElementById('studentform').add.disabled=true;
getElementById('studentform').remove.disabled=false;
getElementById('studentform').addselect.selectedIndex=-1;">
- <?php
+ <?php
foreach ($alreadycourses as $course) {
echo "<option value=\"$course->id\">".course_format_name($course,60)."</option>\n";
}
getElementById('studentform').remove.disabled=true;
getElementById('studentform').removeselect.selectedIndex=-1;">
<?php
-
+
if (!empty($searchcourses)) {
echo "<optgroup label=\"$strsearchresults (" . count($searchcourses) . ")\">\n";
foreach ($searchcourses as $course) {
</select>
<br />
<label for="searchtext" class="accesshide"><?php p($strsearch) ?></label>
- <input type="text" name="searchtext" id="searchtext" size="30" value="<?php p($searchtext) ?>"
+ <input type="text" name="searchtext" id="searchtext" size="30" value="<?php p($searchtext) ?>"
onFocus ="getElementById('studentform').add.disabled=true;
getElementById('studentform').remove.disabled=true;
getElementById('studentform').removeselect.selectedIndex=-1;
echo $OUTPUT->footer();
-?>
+
-<?php // $Id$
+<?php
/// Displays external information about a course
echo $OUTPUT->footer();
-?>
+
if (strpos($jump, $CFG->wwwroot) === 0) { // Anything on this site
redirect(new moodle_url(urldecode($jump)));
-} else if (preg_match('/^[a-z]+\.php\?/', $jump)) {
+} else if (preg_match('/^[a-z]+\.php\?/', $jump)) {
redirect(new moodle_url(urldecode($jump)));
}
redirect(new moodle_url($_SERVER['HTTP_REFERER'])); // Return to sender, just in case
}
-?>
\ No newline at end of file
echo "<td class=\"cell c2\">\n";
$link = html_link::make("/iplookup/index.php?ip=$log->ip&user=$log->userid", $log->ip);
$link->add_action(new popup_action('click', $link->url, 'iplookup', array('height' => 440, 'width' => 700)));
- echo $OUTPUT->link($link);
+ echo $OUTPUT->link($link);
echo "</td>\n";
$fullname = fullname($log, has_capability('moodle/site:viewfullnames', get_context_instance(CONTEXT_COURSE, $course->id)));
echo "<td class=\"cell c3\">\n";
} else {
$link = html_link::make(make_log_url($log->module,$log->url), $displayaction);
$link->add_action(new popup_action('click', $link->url, 'fromloglive'), array('height' => 440, 'width' => 700));
- echo $OUTPUT->link($link);
+ echo $OUTPUT->link($link);
}
echo "</td>\n";;
echo "<td class=\"cell c5\">{$log->info}</td>\n";
echo "<td class=\"r$row c2\" >\n";
$link = html_link::make("/iplookup/index.php?ip=$log->ip&user=$log->userid", $log->ip);
$link->add_action(new popup_action('click', $link->url, 'iplookup', array('height' => 400, 'width' => 700)));
- echo $OUTPUT->link($link);
+ echo $OUTPUT->link($link);
echo "</td>\n";
$fullname = fullname($log, has_capability('moodle/site:viewfullnames', get_context_instance(CONTEXT_COURSE, $course->id)));
echo "<td class=\"r$row c3\" >\n";
if (!empty($resources)) {
$select = html_select::make_popup_form($popupurl, 'add', $resources, "ressection$section", null);
$select->nothinglabel = $straddresource;
- $select->set_help_icon('resource/types', $straddresource);
+ $select->set_help_icon('resource/types', $straddresource);
$output .= $OUTPUT->select($select);
}
if (!empty($activities)) {
$select = html_select::make_popup_form($popupurl, 'add', $activities, "section$section", null);
$select->nothinglabel = $straddactivity;
- $select->set_help_icon('mods', $straddactivity);
+ $select->set_help_icon('mods', $straddactivity);
$output .= $OUTPUT->select($select);
}
$link = html_link::make('/course/info.php?id='.$course->id, '<img alt="'.$strsummary.'" src="'.$OUTPUT->old_icon_url('i/info') . '" />');
$link->add_action(new popup_action('click', $link->url, 'courseinfo', array('height' => 400, 'width' => 500)));
$link->title = $strsummary;
- echo $OUTPUT->link($link);
+ echo $OUTPUT->link($link);
} else {
echo '<img alt="" style="width:18px;height:16px;" src="'.$OUTPUT->old_icon_url('spacer') . '" />';
}
// Notify the admin if required.
if ($CFG->courserequestnotify) {
$users = get_users_from_config($CFG->courserequestnotify, 'moodle/site:approvecourse');
-
+
$a = new stdClass;
$a->link = "$CFG->wwwroot/course/pending.php";
$a->user = fullname($USER);
-<?php // $Id$
+<?php
// Allows a teacher/admin to login as another user (in stealth mode)
require_once('../config.php');
notice($strloggedinas, "$CFG->wwwroot/course/view.php?id=$course->id");
-?>
+
print_error('unknowaction');
}
-?>
+
$currenttab = 'update';
require($CFG->dirroot.'/'.$CFG->admin.'/roles/tabs.php');
}
-
+
$helpicon = new moodle_help_icon();
$helpicon->page = 'mods';
$helpicon->text = $pageheading;
$helpicon->module = $module->name;
echo $OUTPUT->heading_with_help($helpicon, $OUTPUT->mod_icon_url('icon', $module->name));
-
+
$mform->display();
-
+
echo $OUTPUT->footer();
}
-<?php //$Id$
+<?php
require_once ($CFG->libdir.'/formslib.php');
if (!empty($CFG->enablecompletion) or !empty($CFG->enableavailability)) {
require_once($CFG->libdir.'/completionlib.php');
} else {
$this->context = get_context_instance(CONTEXT_COURSE, $course->id);
}
-
+
// Guess module name
$matches = array();
if (!preg_match('/^mod_([^_]+)_mod_form$/', get_class($this), $matches)) {
get_string('completedwarningtext', 'completion', $completedcount)),
'unlockcompletion');
$mform->setHelpButton('completedwarning', array('completionlocked', get_string('help_completionlocked', 'completion'), 'completion'));
-
+
$freeze = true;
}
- }
+ }
if ($freeze) {
$mform->freeze('completion');
$mform->freeze('completionusegrade');
}
$mform->freeze($this->_customcompletionelements);
- }
+ }
}
// Availability conditions
$errors['cmidnumber'] = get_string('idnumbertaken');
}
}
-
+
// Completion: Don't let them choose automatic completion without turning
// on some conditions
if (array_key_exists('completion', $data) && $data['completion']==COMPLETION_TRACKING_AUTOMATIC) {
}
// Conditions: Don't let them set dates which make no sense
- if (array_key_exists('availablefrom', $data) &&
- $data['availablefrom'] && $data['availableuntil'] &&
+ if (array_key_exists('availablefrom', $data) &&
+ $data['availablefrom'] && $data['availableuntil'] &&
$data['availablefrom'] > $data['availableuntil']) {
$errors['availablefrom'] = get_string('badavailabledates', 'condition');
}
-
+
return $errors;
}
$default_values = (array)$default_values;
}
- $this->data_preprocessing($default_values);
+ $this->data_preprocessing($default_values);
parent::set_data($default_values);
}
$grouparray[] =& $mform->createElement('static', '', '','% '.get_string('grade_upto','condition').' ');
$grouparray[] =& $mform->createElement('text', 'conditiongrademax','',array('size'=>3));
$grouparray[] =& $mform->createElement('static', '', '','%');
- $mform->setType('conditiongrademin',PARAM_FLOAT);
- $mform->setType('conditiongrademax',PARAM_FLOAT);
- $group = $mform->createElement('group','conditiongradegroup',
+ $mform->setType('conditiongrademin',PARAM_FLOAT);
+ $mform->setType('conditiongrademax',PARAM_FLOAT);
+ $group = $mform->createElement('group','conditiongradegroup',
get_string('gradecondition', 'condition'),$grouparray);
// Get version with condition info and store it so we don't ask
// twice
- if(!empty($this->_cm)) {
+ if(!empty($this->_cm)) {
$ci = new condition_info($this->_cm, CONDITION_MISSING_EXTRATABLE);
$this->_cm = $ci->get_full_course_module();
$count = count($this->_cm->conditionsgrade)+1;
COMPLETION_COMPLETE_PASS=>get_string('completion_pass','condition'),
COMPLETION_COMPLETE_FAIL=>get_string('completion_fail','condition'));
- $grouparray = array();
+ $grouparray = array();
$grouparray[] =& $mform->createElement('select','conditionsourcecmid','',$completionoptions);
$grouparray[] =& $mform->createElement('select','conditionrequiredcompletion','',$completionvalues);
- $group = $mform->createElement('group','conditioncompletiongroup',
+ $group = $mform->createElement('group','conditioncompletiongroup',
get_string('completioncondition', 'condition'),$grouparray);
$count = empty($this->_cm) ? 1 : count($this->_cm->conditionscompletion)+1;
$mform->setHelpButton('conditioncompletiongroup[0]', array('completioncondition', get_string('help_completioncondition', 'condition'), 'condition'));
}
- // Do we display availability info to students?
- $mform->addElement('select', 'showavailability', get_string('showavailability', 'condition'),
- array(CONDITION_STUDENTVIEW_SHOW=>get_string('showavailability_show', 'condition'),
+ // Do we display availability info to students?
+ $mform->addElement('select', 'showavailability', get_string('showavailability', 'condition'),
+ array(CONDITION_STUDENTVIEW_SHOW=>get_string('showavailability_show', 'condition'),
CONDITION_STUDENTVIEW_HIDE=>get_string('showavailability_hide', 'condition')));
- $mform->setDefault('showavailability', CONDITION_STUDENTVIEW_SHOW);
+ $mform->setDefault('showavailability', CONDITION_STUDENTVIEW_SHOW);
$mform->setHelpButton('showavailability', array('showavailability', get_string('help_showavailability', 'condition'), 'condition'));
}
- // Conditional activities: completion tracking section
+ // Conditional activities: completion tracking section
if(!isset($completion)) {
$completion = new completion_info($COURSE);
}
$mform->addElement('hidden', 'completionunlocked', 0);
$mform->setType('completionunlocked', PARAM_INT);
- $mform->addElement('select', 'completion', get_string('completion', 'completion'),
- array(COMPLETION_TRACKING_NONE=>get_string('completion_none', 'completion'),
+ $mform->addElement('select', 'completion', get_string('completion', 'completion'),
+ array(COMPLETION_TRACKING_NONE=>get_string('completion_none', 'completion'),
COMPLETION_TRACKING_MANUAL=>get_string('completion_manual', 'completion')));
$mform->setHelpButton('completion', array('completion', get_string('help_completion', 'completion'), 'completion'));
$mform->setDefault('completion', $this->_features->defaultcompletion
// Automatic completion according to module-specific rules
$this->_customcompletionelements = $this->add_completion_rules();
foreach ($this->_customcompletionelements as $element) {
- $mform->disabledIf($element, 'completion', 'ne', COMPLETION_TRACKING_AUTOMATIC);
+ $mform->disabledIf($element, 'completion', 'ne', COMPLETION_TRACKING_AUTOMATIC);
}
$gotcompletionoptions = $gotcompletionoptions ||
$mform->getElement('completion')->addOption(
get_string('completion_automatic', 'completion'),
COMPLETION_TRACKING_AUTOMATIC);
- }
+ }
// Completion expected at particular date? (For progress tracking)
$mform->addElement('date_selector', 'completionexpected', get_string('completionexpected', 'completion'), array('optional'=>true));
$mform->setHelpButton('completionexpected', array('completionexpected', get_string('help_completionexpected', 'completion'), 'completion'));
- $mform->disabledIf('completionexpected', 'completion', 'eq', COMPLETION_TRACKING_NONE);
+ $mform->disabledIf('completionexpected', 'completion', 'eq', COMPLETION_TRACKING_NONE);
}
$this->standard_hidden_coursemodule_elements();
}
-
+
/**
* Can be overridden to add custom completion rules if the module wishes
* them. If overriding this, you should also override completion_rule_enabled.
}
}
-?>
+
$keyicon->alt = $strrequireskey;
$keyicon->add_class('icon');
$keyicon = $OUTPUT->image($keyicon);
-
+
foreach ($pending as $course) {
$course = new course_request($course);
-
+
// Check here for shortname collisions and warn about them.
$course->check_shortname_collision();
return ($a->timestamp < $b->timestamp) ? -1 : 1;
}
-?>
\ No newline at end of file
} else {
$groups = '';
}
-
+
if ($courseusers = get_users_by_capability($context, 'moodle/course:view', 'u.id, u.firstname, u.lastname', 'lastname ASC, firstname DESC', '', '', $groups)) {
foreach ($courseusers as $courseuser) {
$options[$courseuser->id] = fullname($courseuser, $viewfullnames);
-<?php // $Id$
+<?php
// Display all the interfaces for importing data into a specific course
require_once('../config.php');
}
echo $OUTPUT->footer();
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
)
);
-?>
+
break;
}
-?>
\ No newline at end of file
-<?php // $Id$
+<?php
// Displays different views of the logs.
require_once('../../../config.php');
echo $OUTPUT->footer();
exit;
-?>
+
-<?php // $Id$
+<?php
// Display link to live logs in separate window
require_once('../../../config.php');
echo $OUTPUT->container_start('info');
$link = html_link::make('/course/report/log/live.php?id='. $course->id, get_string('livelogs'));
$link->add_action(new popup_action('click', $link->url, 'livelog', array('height' => 500, 'width' => 800)));
- echo $OUTPUT->link($link);
+ echo $OUTPUT->link($link);
echo $OUTPUT->container_end();
echo $OUTPUT->footer();
-?>
+
global $USER, $CFG, $SITE, $DB, $OUTPUT, $SESSION;
require_once $CFG->dirroot.'/mnet/peer.php';
-
+
$mnet_peer = new mnet_peer();
$mnet_peer->set_id($hostid);
if ($numcourses < COURSE_MAX_COURSES_PER_DROPDOWN && !$showcourses) {
$showcourses = 1;
}
-
+
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
-
+
// Context for remote data is always SITE
// Groups for remote data are always OFF
if ($hostid == $CFG->mnet_localhost_id) {
echo "<input type=\"hidden\" name=\"showusers\" value=\"$showusers\" />\n";
echo "<input type=\"hidden\" name=\"showcourses\" value=\"$showcourses\" />\n";
if (has_capability('coursereport/log:view', $sitecontext) && $showcourses) {
- $cid = empty($course->id)? '1' : $course->id;
+ $cid = empty($course->id)? '1' : $course->id;
$select = html_select::make($dropdown, "host_course", $hostid.'/'.$cid);
$select->nested = true;
echo $OUTPUT->select($select);
."&id=$course->id&date=$selecteddate&modid=$selectedactivity&showusers=1&showcourses=$showcourses";
print_string('logtoomanyusers','moodle',$a);
}
-
+
echo $OUTPUT->select(html_select::make($dates, "date", $selecteddate, get_string("alldays")));
-
+
$select = html_select::make($activities, "modid", $selectedactivity);
$select->nothinglabel = get_string("allactivities");
$select->nothingvalue = '';
echo $OUTPUT->select($select);
-
+
echo $OUTPUT->select(html_select::make($actions, 'modaction', $modaction, get_string("allactions")));
-
+
$logformats = array('showashtml' => get_string('displayonpage'),
'downloadascsv' => get_string('downloadtext'),
'downloadasods' => get_string('downloadods'),
if ($numcourses < COURSE_MAX_COURSES_PER_DROPDOWN && !$showcourses) {
$showcourses = 1;
}
-
+
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
$context = get_context_instance(CONTEXT_COURSE, $course->id);
-
+
/// Setup for group handling.
if ($course->groupmode == SEPARATEGROUPS and !has_capability('moodle/site:accessallgroups', $context)) {
$selectedgroup = -1;
// this may be a lot of users :-(
$courseusers = $DB->get_records('user', array('deleted'=>0), 'lastaccess DESC', 'id, firstname, lastname, idnumber');
}
-
+
if (count($courseusers) < COURSE_MAX_USERS_PER_DROPDOWN && !$showusers) {
$showusers = 1;
}
print_string('logtoomanyusers','moodle',$a);
}
echo $OUTPUT->select(html_select::make($dates, "date", $selecteddate, get_string("alldays")));
-
+
$select = html_select::make($activities, "modid", $selectedactivity);
$select->nothinglabel = get_string("allactivities");
$select->nothingvalue = '';
echo $OUTPUT->select($select);
-
+
echo $OUTPUT->select(html_select::make($actions, 'modaction', $modaction, get_string("allactions")));
-
+
$logformats = array('showashtml' => get_string('displayonpage'),
'downloadascsv' => get_string('downloadtext'),
'downloadasods' => get_string('downloadods'),
'downloadasexcel' => get_string('downloadexcel'));
-
+
echo $OUTPUT->select(html_select::make($logformats, 'logformat', $logformat, false));
echo '<input type="submit" value="'.get_string('gettheselogs').'" />';
echo '</div>';
-<?php // $Id$
+<?php
// Displays live view of recent logs
require_once("../../../config.php");
$context = get_context_instance(CONTEXT_COURSE, $course->id);
require_capability('coursereport/log:viewlive', $context);
- add_to_log($course->id, "course", "report live", "report/log/live.php?id=$course->id", $course->id);
+ add_to_log($course->id, "course", "report live", "report/log/live.php?id=$course->id", $course->id);
session_get_instance()->write_close();
// we override the default framename so header/footer
- // links open in a new window
+ // links open in a new window
if (empty($CFG->framename) || $CFG->framename==='_top') {
$CFG->framename = '_blank';
}
exit;
-?>
+
-<?php // $Id$
+<?php
if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
echo '<p>';
$link = html_link::make('/course/report/log/live.php?id='. $course->id, get_string('livelogs'));
$link->add_action(new popup_action('click', $link->url, 'livelog', array('height' => 500, 'width' => 800)));
- echo $OUTPUT->link($link);
+ echo $OUTPUT->link($link);
echo '</p>';
}
-?>
+
-<?PHP // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
$plugin->version = 2007101504;
$plugin->requires = 2007101532;
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
)
);
-?>
+
echo $OUTPUT->footer();
-?>
+
-<?php // $Id$
+<?php
if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
echo "$activityreport</a>\n";
echo '</p>';
}
-?>
\ No newline at end of file
-<?PHP // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
$plugin->version = 2007101501;
$plugin->requires = 2007101532;
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
)
);
-?>
+
-<?php // $Id$
+<?php
require_once('../../../config.php');
require_once($CFG->dirroot.'/lib/tablelib.php');
$action = optional_param('action', '', PARAM_ALPHA);
$page = optional_param('page', 0, PARAM_INT); // which page to show
$perpage = optional_param('perpage', DEFAULT_PAGE_SIZE, PARAM_INT); // how many per page
-
+
$PAGE->set_url('course/report/participation/index.php', compact('id', 'roleid', 'instanceid', 'timefrom', 'page', 'perpage'));
if ($action != 'view' and $action != 'post') {
}
list($actionsql, $params) = $DB->get_in_or_equal($actions, SQL_PARAMS_NAMED, 'action0');
- $actionsql = "l.action $actionsql";
+ $actionsql = "l.action $actionsql";
$relatedcontexts = get_related_contexts_string($context);
echo $OUTPUT->footer();
-?>
+
-<?php // $Id$
+<?php
if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
echo "$participationreport</a>\n";
echo '</p>';
}
-?>
+
-<?PHP // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
$plugin->version = 2007101501;
$plugin->requires = 2007101532;
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
)
);
-?>
+
get_string('excelcsvdownload','completion').'</a></li></ul>';
echo $OUTPUT->footer();
-?>
+
-<?php //$Id$
+<?php
if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); // It must be included from a Moodle page
echo '</p>';
}
}
-?>
+
function textrotate_make_svg(el)
{
var string=el.firstChild.nodeValue;
-
+
// Add absolute-positioned string (to measure length)
var abs=document.createElement('div');
abs.appendChild(document.createTextNode(string));
var width=(textHeight*9)/8;
svg.setAttribute('width',width);
svg.setAttribute('height',textWidth+20);
-
+
// Add text
var text=document.createElementNS(SVGNS,'text');
svg.appendChild(text);
text.setAttribute('text-anchor','end');
text.setAttribute('transform','rotate(90)');
text.appendChild(document.createTextNode(string));
-
+
// Is there an icon near the text?
var icon=el.parentNode.firstChild;
if(icon.nodeName.toLowerCase()=='img') {
image.setAttribute('height',16);
image.setAttributeNS(XLINKNS,'href',icon.src);
svg.appendChild(image);
- }
+ }
// Replace original content with this new SVG
el.parentNode.insertBefore(svg,el);
elements=YAHOO.util.Dom.getElementsByClassName('completion-expected', 'div');
for(var i=0;i<elements.length;i++)
- {
+ {
var el=elements[i];
el.style.display='inline';
var parent=el.parentNode;
}
}
-YAHOO.util.Event.onDOMReady(textrotate_init);
+YAHOO.util.Event.onDOMReady(textrotate_init);
-<?PHP // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
$plugin->version = 2007101500;
$plugin->requires = 2007101532;
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
)
);
-?>
+
$graph->draw_stack();
-?>
\ No newline at end of file
-<?php // $Id$
+<?php
require_once('../../../config.php');
require_once($CFG->dirroot.'/lib/statslib.php');
echo $OUTPUT->footer();
-?>
+
-<?php //$Id$
+<?php
if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
echo '</p>';
}
}
-?>
+
-<?php // $Id$
+<?php
if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
}
}
-?>
+
-<?PHP // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
$plugin->version = 2007101501;
$plugin->requires = 2007101532;
-?>
+
if ($requestform->is_cancelled()){
redirect($returnurl);
-} else if ($data = $requestform->get_data()) {
+} else if ($data = $requestform->get_data()) {
$request = course_request::create($data);
// and redirect back to the course listing.
$this->add_action_buttons(true, get_string('reject'));
}
}
-?>
+
$mform->display();
echo $OUTPUT->footer();
-?>
+
-<?php // $Id$
+<?php
require_once $CFG->libdir.'/formslib.php';
class course_reset_form extends moodleform {
/**
* List of all resource type modules in course
*
- * @package moodlecore
+ * @package moodlecore
* @copyright 2009 Petr Skoda (http://skodak.org)
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once('../config.php');
echo $OUTPUT->close_window_button();
echo $OUTPUT->footer();
-?>
\ No newline at end of file
-<?php // $Id$
+<?php
/// Displays external information about a course
$show = optional_param('show', 0, PARAM_INT);
$blocklist = optional_param('blocklist', 0, PARAM_INT);
$modulelist= optional_param('modulelist', '', PARAM_ALPHAEXT);
-
+
$PAGE->set_url('course/search.php', compact('search', 'page', 'perpage', 'blocklist', 'modulelist', 'edit'));
$PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));
$search = trim(strip_tags($search)); // trim & clean raw searched string
$form = new html_form();
$form->url = new moodle_url("$CFG->wwwroot/course/search.php", array(
- 'edit' => $edit,
+ 'edit' => $edit,
'sesskey' => sesskey(),
'search' => s($search, true),
'page' => $page,
}
}
-?>
+
$course->shortname = "TestCourseForCourse";
$course->idnumber = 123456789;
$course = create_course($course);
- $this->course = $course;
+ $this->course = $course;
}
$course["id"] = $this->course->id;
$params[] = $course;
$activities = course_external::get_course_modules($params);
-
+
$activities = course_external::get_course_activities($params);
varlog($activities);
chat_delete_instance($chatid);
}
*/
}
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
}
redirect($returnurl);
-?>
\ No newline at end of file
redirect($backto);
}
-?>
\ No newline at end of file
echo $OUTPUT->footer();
-?>
\ No newline at end of file
echo "</tr>";
}
-?>
\ No newline at end of file
-<?php // $Id$
+<?php
// Display the course home page.
}
//If course is hosted on an external server, redirect to corresponding
- //url with appropriate authentication attached as parameter
+ //url with appropriate authentication attached as parameter
if (file_exists($CFG->dirroot .'/course/externservercourse.php')) {
include $CFG->dirroot .'/course/externservercourse.php';
if (function_exists('extern_server_course')) {
// AJAX-capable course format?
- $useajax = false;
+ $useajax = false;
$ajaxformatfile = $CFG->dirroot.'/course/format/'.$course->format.'/ajax.php';
$bodytags = '';
$completion = new completion_info($course);
if ($completion->is_enabled() && ajaxenabled()) {
$PAGE->requires->yui_lib('connection')->asap();
- $PAGE->requires->js('course/completion.js')->asap();
+ $PAGE->requires->js('course/completion.js')->asap();
$PAGE->requires->js_function_call('completion_init')->on_dom_ready();
$PAGE->requires->data_for_js('completion_strsaved', get_string('saved', 'completion'));
$PAGE->requires->data_for_js('completion_strtitley', get_string('completion-title-manual-y', 'completion'));
$PAGE->requires->data_for_js('completion_strtitlen', get_string('completion-title-manual-n', 'completion'));
$PAGE->requires->data_for_js('completion_stralty', get_string('completion-alt-manual-y', 'completion'));
- $PAGE->requires->data_for_js('completion_straltn', get_string('completion-alt-manual-n', 'completion'));
+ $PAGE->requires->data_for_js('completion_straltn', get_string('completion-alt-manual-n', 'completion'));
}
// The "Editing On" button will be appearing only in the "main" course screen
// Content wrapper end.
echo "</div>\n\n";
- // Use AJAX?
+ // Use AJAX?
if ($useajax && has_capability('moodle/course:manageactivities', $context)) {
// At the bottom because we want to process sections and activities
// after the relevant html has been generated. We're forced to do this
- // because of the way in which lib/ajax/ajaxcourse.js is written.
-
+ // because of the way in which lib/ajax/ajaxcourse.js is written.
+
echo '<script type="text/javascript" ';
echo "src=\"{$CFG->wwwroot}/lib/ajax/ajaxcourse.js\"></script>\n";
$COURSE->javascriptportal->print_javascript($course->id);
echo $OUTPUT->footer();
-?>
+
-<?php // $Id$
+<?php
/// The Web service script that is called from the filepicker front end
-<?PHP // $Id$
+<?php
////////////////////////////////////////////////////////////////////////////////
-/// This file contains a few configuration variables that control
+/// This file contains a few configuration variables that control
/// how Moodle uses this theme.
////////////////////////////////////////////////////////////////////////////////
$THEME->sheets = array('styles', 'styles_select');
-/// This variable is an array containing the names of all the
+/// This variable is an array containing the names of all the
/// stylesheet files you want included in this theme, and in what order
////////////////////////////////////////////////////////////////////////////////
-$THEME->standardsheets = true;
+$THEME->standardsheets = true;
/// This variable can be set to an array containing
-/// filenames from the *STANDARD* theme. If the
-/// array exists, it will be used to choose the
+/// filenames from the *STANDARD* theme. If the
+/// array exists, it will be used to choose the
/// files to include in the standard style sheet.
/// When false, then no files are used.
/// When true or NON-EXISTENT, then ALL standard files are used.
-/// This parameter can be used, for example, to prevent
+/// This parameter can be used, for example, to prevent
/// having to override too many classes.
/// Note that the trailing .css should not be included
/// eg $THEME->standardsheets = array('styles_layout','styles_fonts','styles_color');
////////////////////////////////////////////////////////////////////////////////
-$THEME->parent = '';
+$THEME->parent = '';
/// This variable can be set to the name of a parent theme
/// which you want to have included before the current theme.
-/// This can make it easy to make modifications to another
+/// This can make it easy to make modifications to another
/// theme without having to actually change the files
-/// If this variable is empty or false then a parent theme
+/// If this variable is empty or false then a parent theme
/// is not used.
////////////////////////////////////////////////////////////////////////////////
-$THEME->parentsheets = false;
+$THEME->parentsheets = false;
/// This variable can be set to an array containing
-/// filenames from a chosen *PARENT* theme. If the
-/// array exists, it will be used to choose the
+/// filenames from a chosen *PARENT* theme. If the
+/// array exists, it will be used to choose the
/// files to include in the standard style sheet.
/// When false, then no files are used.
/// When true or NON-EXISTENT, then ALL standard files are used.
-/// This parameter can be used, for example, to prevent
+/// This parameter can be used, for example, to prevent
/// having to override too many classes.
/// Note that the trailing .css should not be included
/// eg $THEME->parentsheets = array('styles_layout','styles_fonts','styles_color');
$THEME->metainclude = false;
-/// When this is enabled (or not set!) then Moodle will try
-/// to include a file meta.php from this theme into the
+/// When this is enabled (or not set!) then Moodle will try
+/// to include a file meta.php from this theme into the
/// <head></head> part of the page.
$THEME->standardmetainclude = true;
-/// When this is enabled (or not set!) then Moodle will try
-/// to include a file meta.php from the standard theme into the
+/// When this is enabled (or not set!) then Moodle will try
+/// to include a file meta.php from the standard theme into the
/// <head></head> part of the page.
$THEME->parentmetainclude = false;
-/// When this is enabled (or not set!) then Moodle will try
-/// to include a file meta.php from the parent theme into the
+/// When this is enabled (or not set!) then Moodle will try
+/// to include a file meta.php from the parent theme into the
/// <head></head> part of the page.
$THEME->navmenuwidth = 50;
-/// You can use this to control the cutoff point for strings
+/// You can use this to control the cutoff point for strings
/// in the navmenus (list of activities in popup menu etc)
/// Default is 50 characters wide.
/// By setting this to true, then you will have access to a
/// new variable in your header.html and footer.html called
-/// $navmenulist ... this contains a simple XHTML menu of
-/// all activities in the current course, mostly useful for
+/// $navmenulist ... this contains a simple XHTML menu of
+/// all activities in the current course, mostly useful for
/// creating popup navigation menus and so on.
-$THEME->resource_mp3player_colors =
+$THEME->resource_mp3player_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'font=Arial&fontColour=3333FF&buffer=10&waitForPlay=no&autoPlay=yes';
-/// With this you can control the colours of the "big" MP3 player
+/// With this you can control the colours of the "big" MP3 player
/// that is used for MP3 resources.
-$THEME->filter_mediaplugin_colors =
+$THEME->filter_mediaplugin_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'waitForPlay=yes';
$THEME->custompix = false;
-/// If true, then this theme must have a "pix"
-/// subdirectory that contains copies of all
+/// If true, then this theme must have a "pix"
+/// subdirectory that contains copies of all
/// files from the moodle/pix directory, plus a
-/// "pix/mod" directory containing all the icons
+/// "pix/mod" directory containing all the icons
/// for all the activity modules.
///$CFG->block_search_button = link_arrow_right(get_string('search'), $url='', $accesshide=true);
///
/// Accessibility: Right and left arrow-like characters are
-/// used in the breadcrumb trail, course navigation menu
+/// used in the breadcrumb trail, course navigation menu
/// (previous/next activity), calendar, and search forum block.
///
/// If the theme does not set characters, appropriate defaults
/// use < > » - these are confusing for blind users.
////////////////////////////////////////////////////////////////////////////////
-?>
+
<div id="footer-l">
<div id="footer-r">
<div id="footer-m" class="clearfix">
-
+
<div id="footer-logo">
<a href="http://moodle.org" target="_blank"><img src="<?php echo $CFG->themewww .'/'. current_theme() ?>/images/logo.jpg" title="Moodle <?php echo $CFG->release ?>" /></a>
</div>
<div id="footer-loggedinas">
<?php echo $loggedinas; ?>
</div>
-
+
</div>
</div>
</div>
<script type="text/javascript" charset="utf-8">
/* <![CDATA[ */
var CSSClass={};CSSClass.is=function(e,c){if(typeof e=="string")e=document.getElementById(e);var classes=e.className;if(!classes)return false;if(classes==c)return true;return e.className.search("\\b"+c+"\\b")!=-1;};CSSClass.add=function(e,c){if(typeof e=="string")e=document.getElementById(e);if(CSSClass.is(e,c))return;if(e.className)c=" "+c;e.className+=c;};CSSClass.remove=function(e,c){if(typeof e=="string")e=document.getElementById(e);e.className=e.className.replace(new RegExp("\\b"+c+"\\b\\s*","g"),"");};
-
+
var jsscript = {
-
+
corrections: function () {
-
+
// check for layouttabel and add haslayouttable class to body
function setbodytag () {
var bd = document.getElementsByTagName('body')[0];
setTimeout(function() { setbodytag() }, 10);
}
};
-
+
setbodytag();
},
-
+
init: function() {
jsscript.corrections();
}
};
-
+
jsscript.init();
/* ]]> */
</script>
if ($home) { // This is what gets printed on the home page only
?>
<?php echo $OUTPUT->container_start('clearfix header-home'); ?>
-
+
<div id="header-t">
<div id="header-r">
<div id="header-l">
Chameleon, the flexible Moodle theme.
</h3>
<p>
- Chameleon is a Moodle theme with an option to interactively change your theme within your browser page.
- You click on an element to change it's style. Please read the
- <a href="http://docs.moodle.org/en/Chameleon" alt="Chameleon Moodle Docs">Chameleon Moodle Docs explanation</a>
+ Chameleon is a Moodle theme with an option to interactively change your theme within your browser page.
+ You click on an element to change it's style. Please read the
+ <a href="http://docs.moodle.org/en/Chameleon" alt="Chameleon Moodle Docs">Chameleon Moodle Docs explanation</a>
for more information about Chameleon's interactive theme work.
</p>
<p>
- To enable editing you change "$THEME->chameleonenabled = false;" in the config.php file
- in your Chameleon theme folder to true. It is recommended to change "$THEME->chameleonenabled = true;"
- back to false again once you're satisfied with your theme because the editing engine loads several
+ To enable editing you change "$THEME->chameleonenabled = false;" in the config.php file
+ in your Chameleon theme folder to true. It is recommended to change "$THEME->chameleonenabled = true;"
+ back to false again once you're satisfied with your theme because the editing engine loads several
extra files into the browser. Therefore the page loading speed is reduced.
</p>
</h4>
<p>
- If you want to hand code styles you must not write hooks as comma separated lists of elements like
+ If you want to hand code styles you must not write hooks as comma separated lists of elements like
<pre>
-td#middle-column div.bt,
+td#middle-column div.bt,
div#middle-column div.bt {
...
}
</pre>
- in Chameleon themes because the Chameleon engine can't handle these comma lists.
+ in Chameleon themes because the Chameleon engine can't handle these comma lists.
Please write two separate statements instead.
<pre>
td#middle-column div.bt {
</p>
<p>
- A Moodle Theme from <strong>Urs Hunkler, <a href="http://www.unodo.de">unodo</a>
+ A Moodle Theme from <strong>Urs Hunkler, <a href="http://www.unodo.de">unodo</a>
and Andrew Walker, <a href="http://www.altoncollege.ac.uk/">Alton College</a></strong>.
</p>
\ No newline at end of file
-<?PHP // $Id$
+<?php
////////////////////////////////////////////////////////////////////////////////
-/// This file contains a few configuration variables that control
+/// This file contains a few configuration variables that control
/// how Moodle uses this theme.
////////////////////////////////////////////////////////////////////////////////
$THEME->sheets = array('user_styles');
-/// This variable is an array containing the names of all the
+/// This variable is an array containing the names of all the
/// stylesheet files you want included in this theme, and in what order
////////////////////////////////////////////////////////////////////////////////
$THEME->standardsheets = array('styles_layout', 'styles_color');
/// This variable can be set to an array containing
-/// filenames from the *STANDARD* theme. If the
-/// array exists, it will be used to choose the
+/// filenames from the *STANDARD* theme. If the
+/// array exists, it will be used to choose the
/// files to include in the standard style sheet.
/// When false, then no files are used.
/// When true or NON-EXISTENT, then ALL standard files are used.
-/// This parameter can be used, for example, to prevent
+/// This parameter can be used, for example, to prevent
/// having to override too many classes.
/// Note that the trailing .css should not be included
/// eg $THEME->standardsheets = array('styles_layout','styles_fonts','styles_color');
////////////////////////////////////////////////////////////////////////////////
-$THEME->parent = '';
+$THEME->parent = '';
/// This variable can be set to the name of a parent theme
/// which you want to have included before the current theme.
-/// This can make it easy to make modifications to another
+/// This can make it easy to make modifications to another
/// theme without having to actually change the files
-/// If this variable is empty or false then a parent theme
+/// If this variable is empty or false then a parent theme
/// is not used.
////////////////////////////////////////////////////////////////////////////////
-$THEME->parentsheets = false;
+$THEME->parentsheets = false;
/// This variable can be set to an array containing
-/// filenames from a chosen *PARENT* theme. If the
-/// array exists, it will be used to choose the
+/// filenames from a chosen *PARENT* theme. If the
+/// array exists, it will be used to choose the
/// files to include in the standard style sheet.
/// When false, then no files are used.
/// When true or NON-EXISTENT, then ALL standard files are used.
-/// This parameter can be used, for example, to prevent
+/// This parameter can be used, for example, to prevent
/// having to override too many classes.
/// Note that the trailing .css should not be included
/// eg $THEME->parentsheets = array('styles_layout','styles_fonts','styles_color');
$THEME->metainclude = true;
-/// When this is enabled (or not set!) then Moodle will try
-/// to include a file meta.php from this theme into the
+/// When this is enabled (or not set!) then Moodle will try
+/// to include a file meta.php from this theme into the
/// <head></head> part of the page.
$THEME->standardmetainclude = true;
-/// When this is enabled (or not set!) then Moodle will try
-/// to include a file meta.php from the standard theme into the
+/// When this is enabled (or not set!) then Moodle will try
+/// to include a file meta.php from the standard theme into the
/// <head></head> part of the page.
$THEME->parentmetainclude = false;
-/// When this is enabled (or not set!) then Moodle will try
-/// to include a file meta.php from the parent theme into the
+/// When this is enabled (or not set!) then Moodle will try
+/// to include a file meta.php from the parent theme into the
/// <head></head> part of the page.
$THEME->navmenuwidth = 50;
-/// You can use this to control the cutoff point for strings
+/// You can use this to control the cutoff point for strings
/// in the navmenus (list of activities in popup menu etc)
/// Default is 50 characters wide.
/// By setting this to true, then you will have access to a
/// new variable in your header.html and footer.html called
-/// $navmenulist ... this contains a simple XHTML menu of
-/// all activities in the current course, mostly useful for
+/// $navmenulist ... this contains a simple XHTML menu of
+/// all activities in the current course, mostly useful for
/// creating popup navigation menus and so on.
$THEME->chameleonenabled = false;
/// By setting this to true it enables editing of the stylsheets.
-/// It is recommended to set this to false again once you're
+/// It is recommended to set this to false again once you're
/// satisfied with your theme.
$THEME->chameleonteachereditenabled = false;
-/// If you use chameleon as a course theme setting this to true
-/// will allow teachers on that course to edit the theme.
+/// If you use chameleon as a course theme setting this to true
+/// will allow teachers on that course to edit the theme.
-$THEME->resource_mp3player_colors =
+$THEME->resource_mp3player_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'font=Arial&fontColour=3333FF&buffer=10&waitForPlay=no&autoPlay=yes';
-/// With this you can control the colours of the "big" MP3 player
+/// With this you can control the colours of the "big" MP3 player
/// that is used for MP3 resources.
-$THEME->filter_mediaplugin_colors =
+$THEME->filter_mediaplugin_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'waitForPlay=yes';
$THEME->custompix = true;
-/// If true, then this theme must have a "pix"
-/// subdirectory that contains copies of all
+/// If true, then this theme must have a "pix"
+/// subdirectory that contains copies of all
/// files from the moodle/pix directory, plus a
-/// "pix/mod" directory containing all the icons
+/// "pix/mod" directory containing all the icons
/// for all the activity modules.
////////////////////////////////////////////////////////////////////////////////
-?>
+
<!-- <p><div class="homelink"><a <?php echo $CFG->frametarget ?> href="<?php $CFG->wwwroot ?>/course/view.php?id=<?php $COURSE->id ?>"> <?php $COURSE->shortname ?> </a></div></p> -->
<p>
<!-- <<a href="http://validator.w3.org/check?verbose=1&ss=1&uri=<?php echo urlencode(qualified_me()) ?>"><img src="<?php echo "$CFG->themewww/$CFG->theme" ?>/xhtml_1_0.gif" alt="XHTML Validator" /></a>
-<a href="http://jigsaw.w3.org/css-validator/validator?uri=<?php echo urlencode(qualified_me()) ?>&warning=1&profile=css2&usermedium=all"><img src="<?php echo "$CFG->themewww/$CFG->theme" ?>/css.gif" alt="CSS Validator" /></a>
+<a href="http://jigsaw.w3.org/css-validator/validator?uri=<?php echo urlencode(qualified_me()) ?>&warning=1&profile=css2&usermedium=all"><img src="<?php echo "$CFG->themewww/$CFG->theme" ?>/css.gif" alt="CSS Validator" /></a>
<a href="http://www.contentquality.com/mynewtester/cynthia.exe?rptmode=-1&url1=<?php echo urlencode(qualified_me()) ?>"><img src="<?php echo "$CFG->themewww/$CFG->theme" ?>/section_508.gif" alt="Section 508 Validator" /></a> -->
</p>
</div>
icon.gif: a 16x16 icon for the module
db/mysql.sql: an SQL dump of all the required db tables and data
-
+
index.php: a page to list all instances in a course
view.php: a page to view a particular instance
If you are a developer and interested in developing new Modules see:
-
+
Moodle Documentation: http://moodle.org/doc
Moodle Community: http://moodle.org/community
/*
* These styles are ONLY included for IE 7 (via meta.php)
*/
-
+
input[type="submit"] {
padding: 0 2px;
}
class ChameleonCSS {
var $error;
var $base;
-
+
var $perm;
var $temp;
- function ChameleonCSS($base, $perm, $temp) {
+ function ChameleonCSS($base, $perm, $temp) {
$this->base = $base;
$this->perm = $perm;
$this->temp = $temp;
}
-
+
function update($file, $content = '') {
if (!is_writable($this->base . $this->$file)) {
$this->error = $this->$file . ' is not writeable, the file permissions are currently ' . $this->getfilepermissions($this->$file);
return false;
}
-
+
if (!$fp = fopen($this->base . $this->$file, 'w')) {
$this->error = 'couldn\'t open file';
return false;
fclose($fp);
return true;
}
-
+
function getfilepermissions($file) {
return substr(sprintf('%o', fileperms($this->base . $file)), -4);
}
function read() {
$permcss = file_get_contents($this->base . $this->perm);
$tempcss = file_get_contents($this->base . $this->temp);
-
+
if ($permcss === false || $tempcss === false) {
$this->error = 'Couldn\'t read file';
return false;
}
-
+
$permcss = trim($permcss);
$tempcss = trim($tempcss);
-
+
if ($tempcss == '') {
return $permcss;
}
return $this->_merge($permcss, $tempcss);
}
-
-
-
-
+
+
+
+
function _merge($permcss, $tempcss) {
$csssrcs = array($this->_toobj($permcss), $this->_toobj($tempcss));
-
+
$merged = array();
-
+
for ($i = 0; $i < 2; ++$i) {
foreach ($csssrcs[$i] as $sel => $rule) {
$newsel = false;
}
}
}
-
+
return $this->_tostr($merged);
}
-
-
-
-
+
+
+
+
function _toobj($cssstr) {
$cssobj = array();
$end = strpos($cssstr, '}');
}
return $cssobj;
}
-
-
+
+
function _tostr($cssobj) {
$cssstr = '';
foreach ($cssobj as $sel => $rule) {
var $path;
var $dir;
var $IMAGE_TYPES;
-
+
var $founddirs = array();
var $foundfiles = array();
function ChameleonFileBrowser() {
$this->IMAGE_TYPES = array('jpeg', 'jpg', 'gif', 'png');
-
+
$tmp = explode('/', str_replace('\\', '/', __FILE__));
array_pop($tmp);
array_pop($tmp);
if ($path == 'root') {
return 'pix';
}
-
+
if (substr($path, 0, 3) != 'pix') {
$this->send('<chameleon_error>Not a valid directory</chameleon_error>');
}
-
+
return preg_replace('/[.]+/', '', $path);
}
if (!is_dir($this->dir)) {
$this->send('<chameleon_error>Not a valid directory</chameleon_error>');
}
-
- $handle = opendir($this->dir);
+
+ $handle = opendir($this->dir);
while (false !== ($file = readdir($handle))) {
if ($file == '.' || $file == '..') {
continue;
$out .= " <file type=\"img\">$this->path/$file</file>\n";
}
$out .= "</files>";
-
+
$this->send($out);
}
-
+
function send($out) {
header("Content-type: application/xml; charset=utf-8");
die($out);
<?php
-
+
if (!empty($THEME->chameleonenabled)) {
$chameleon_isadmin = has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
$chameleon_isteacher = false;
$chameleon_courseparam = '?id=' . $COURSE->id;
$chameleon_isteacher = !empty($COURSE->theme) and has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $COURSE->id));
}
-
- if ($chameleon_isadmin or ($chameleon_isteacher and !empty($CFG->allowcoursethemes) and !empty($THEME->chameleonteachereditenabled))) {
+
+ if ($chameleon_isadmin or ($chameleon_isteacher and !empty($CFG->allowcoursethemes) and !empty($THEME->chameleonteachereditenabled))) {
// either we're an admin or we're a teacher and this is being used as the course theme
// if we're on a page using a course theme edit that, otherwise edit the main chameleon theme
$chameleon_theme = $PAGE->theme->name;
var struct = [];
var hotspotMode = null;
-
+
var Config = {
THEME_ROOT: '<?php echo $chameleon_theme_root; ?>',
REMOTE_URI: '<?php echo substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], '/')); ?>/css.php<?php echo (isset($_GET['id'])) ? '?id='.(int) $_GET['id'] : '?dummy=1'; ?>',
UNITS: ['px', 'pt', 'em', '%'],
PROPS_LIST: ['color', 'background-color', 'background-image', 'background-attachment', 'background-position', 'font-family', 'font-size', 'font-weight', 'font-style', 'line-height', 'margin', 'padding', 'border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width', 'border-top-style', 'border-right-style', 'border-bottom-style', 'border-left-style', 'border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color']
};
-
+
var Util = {
obj.setAttribute('id', id);
return obj;
},
-
+
removeElement: function(obj) {
if (!obj || !obj.parentNode) return false;
if (!kids.length && typeof obj.all != 'undefined') {
kids = obj.all;
}
-
+
var n = kids.length;
while (n--) {
if (kids[n].id && Util.__registry[kids[n].id]) {
if (Util.__registry[obj.id]) {
Util.__removeAllEvents(obj);
}
- obj.parentNode.removeChild(obj);
+ obj.parentNode.removeChild(obj);
},
-
+
clearElement: function(obj) {
while (obj.hasChildNodes()) {
obj.removeChild(obj.firstChild);
}
- },
+ },
addEvent: function(obj, ev, fn) {
if (!Util.__addToRegistry(obj, ev, fn)) return;
-
+
if (obj.addEventListener) {
obj.addEventListener(ev, fn, false);
} else if (obj.attachEvent) {
obj['e' + ev + fn] = fn;
- obj[ev + fn] = function() {
+ obj[ev + fn] = function() {
obj['e' + ev + fn](window.event);
};
obj.attachEvent('on' + ev, obj[ev + fn]);
obj.removeEventListener(ev, fn, false);
} else if (obj.detachEvent) {
obj.detachEvent('on' + ev, obj[ev + fn]);
- obj[ev + fn] = null;
+ obj[ev + fn] = null;
}
},
},
__removeFromRegistry: function(obj, ev, fn) {
var id = Util.__getEventId(obj);
-
+
if (!id) return false;
-
+
var pos = Util.__findEvent(id, ev, fn);
if (pos != -1) {
Util.__registry[id][ev].splice(pos, 1);
return {x: x, y: y};
}
};
-
-
-
+
+
+
var CSS = {
-
+
__localCSS: {},
__remoteCSS: {},
-
+
__localSaveRequired: false,
__remoteSaveRequired: false,
-
-
+
+
requireRemoteSave: function() {
- CSS.__remoteSaveRequired = true;
+ CSS.__remoteSaveRequired = true;
},
-
+
clearTheme: function() {
/*var links = document.getElementsByTagName('link');
var n = links.length;
}
}*/
},
-
+
loadRemote: function(doSetup) {
if (!Sarissa.IS_ENABLED_XMLHTTP) {
xmlhttp.send(null);
return true;
},
-
-
+
+
updateTemp: function(e, reset) {
if (!CSS.__localSaveRequired && !reset) {
UI.statusMsg('There are no changes that need saving!', 'chameleon-notice');
return;
}
-
+
if (!reset) {
UI.statusMsg('Updating temporary styles on the server...', 'chameleon-working');
} else {
UI.statusMsg('Deleting temporary styles from the server...', 'chameleon-working');
}
-
+
var css = CSS.toString();
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.responseText.indexOf('CHAMELEON_ERROR') != -1) {
UI.statusMsg('There was an error saving to the server:\n' + xmlhttp.responseText.replace(/CHAMELEON_ERROR /, '') + '.', 'chameleon-error');
-
+
} else {
CSS.__localSaveRequired = false;
if (!reset) {
UI.statusMsg('Temporary styles have been updated.', 'chameleon-ok');
} else {
UI.statusMsg('Temporary styles have been cleared.', 'chameleon-ok');
- }
+ }
}
xmlhttp = null;
}
xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xmlhttp.send('css=' + css);
},
-
+
updateRemote: function() {
if (!CSS.__remoteSaveRequired) {
UI.statusMsg('There are no changes that need saving!', 'chameleon-notice');
return;
}
-
+
var css = CSS.toString(CSS.__localCSS);
UI.statusMsg('Updating styles on the server...', 'chameleon-working');
xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xmlhttp.send('css=' + css);
},
-
-
-
-
-
-
+
+
+
+
+
+
hardReset: function(e, noPrompt) {
if (noPrompt || confirm('Are you sure? This will erase all styles that have not been permanently saved to the server.')) {
CSS.__localCSS = {};
CSS.updateTemp(null, true);
-
+
CSS.__localCSS = CSS.__clone(CSS.__remoteCSS);
CSS.__localSaveRequired = false;
CSS.__remoteSaveRequired = false;
CSS.preview();
}
},
-
-
-
+
+
+
setPropValue: function(prop, value, selector) {
if (!selector) var selector = CSS.Selector.get();
if (!CSS.__localCSS[selector]) {
CSS.__localCSS[selector] = {};
}
-
+
var matches = prop.match(/^border\-([^\-]+)$/);
if (value) {
var func = CSS.__requiresFunction(prop);
CSS.unsetProp(prop, selector);
}
}
-
+
CSS.__localSaveRequired = true;
CSS.__remoteSaveRequired = true;
CSS.preview(selector);
},
-
+
getPropValue: function(prop, selector) {
if (!selector) var selector = CSS.Selector.get();
delete CSS.__localCSS[selector];
}
},
-
-
+
+
__hasProps: function(selector) {
for (var prop in CSS.__localCSS[selector]) {
if (prop) {
}
return false;
},
-
-
+
+
__cleanFunctions: function(val) {
fixPath: function(val) {
if (val == 'none') return val;
-
+
var tmp = val.split('(');
if (tmp.length > 1) {
tmp[1] = Config.THEME_ROOT + '/' + tmp[1];
}
return Config.THEME_ROOT + '/' + val;
},
-
-
-
+
+
+
preview: function(sel) {
var styleId = 'chameleon-preview-styles';
var h = document.getElementsByTagName('head')[0];
var s = document.getElementById(styleId);
-
+
if (!s) {
var s = Util.createElement('style', styleId);
s.setAttribute('type', 'text/css');
h.appendChild(s);
}
-
+
if (navigator.userAgent.toLowerCase().indexOf('msie') != -1 && !window.opera && document.styleSheets && document.styleSheets.length > 0) {
var lastStyle = document.styleSheets[document.styleSheets.length - 1];
-
+
var ieCrashProtector = /[^a-z0-9 #_:\.\-\*]/i; // some characters appearing in a selector can cause addRule to crash IE in spectacular style - if the selector contains any character outside this list don't try to add to the preview
var ieWarning = false;
-
+
if (sel) {
var matchedSelectors = [];
if (typeof sel == 'string') {
sel.splice(ns, 1);
break;
}
-
+
if (lastStyle.rules[n].selectorText.toLowerCase() == sel[ns].toLowerCase()) {
matchedSelectors.push(sel[ns]);
sel.splice(ns, 1);
while (n--) {
lastStyle.removeRule(n);
}
-
+
for (var sel in CSS.__localCSS) {
if (sel.match(ieCrashProtector)) {
ieWarning = true;
lastStyle.addRule(sel, dec);
}
}
-
+
if (ieWarning) {
UI.statusMsg('The edited CSS contains content that can not be previewed by Internet Explorer', 'chameleon-notice');
}
-
+
} else {
Util.clearElement(s);
s.appendChild(document.createTextNode(CSS.toString(CSS.__localCSS, true))); // I think innerHTML would be faster here, but it doesn't work in KHTML browsers (Safari etc)
}
},
-
-
+
+
__merge: function() {
var merged = {};
}
return merged;
},
-
+
__clone: function(src) {
var cloned = {};
for (var sel in src) {
}
return cloned;
},
-
-
+
+
toString: function(css, fixpath) {
if (!css) var css = CSS.__localCSS;
-
+
var dec = '';
for (var sel in css) {
dec += sel + ' ' + CSS.__propsToString(css[sel], fixpath, sel);
}
return dec;
},
-
+
__propsToString: function(css, fixpath) {
CSS.__Shorthand.border = {};
-
+
var hasBorder = false;
var col = false;
var importantBorders = [];
var dec = '{\n';
for (var prop in css) {
-
+
var includeProp = true;
-
+
if (prop.indexOf('border') != -1 && prop.indexOf('spacing') == -1 && prop.indexOf('collapse') == -1) {
if (css[prop].indexOf('!important') == -1) {
CSS.__Shorthand.recordBorder(prop, css[prop]);
includeProp = false;
hasBorder = true;
}
-
+
if (prop == 'color') {
col = css[prop];
}
}
}
}
-
+
if (hasBorder) {
dec += CSS.__Shorthand.getBorderString(col);
}
dec += ' ' + importantBorders[n].prop + ': ' + importantBorders[n].css + ';\n';
}
}
-
+
dec += '}\n';
return dec;
},
-
-
-
-
+
+
+
+
toObject: function(css) {
var cssObj = {};
var end;
} else {
var selectorArr = [selector];
}
-
+
var rules = parts.pop().trim();
rules = rules.split(';');
for (var i = 0; i < rules.length; ++i) {
var rule = rules[i].split(':');
var prop = rule.shift().trim();
var val = rule.pop().trim();
-
+
for (var j = 0; j < selectorArr.length; ++j) {
var noFontPropReset = {};
-
+
selector = selectorArr[j].trim();
if (!cssObj[selector]) {
cssObj[selector] = {};
}
-
+
if (prop != 'font' && (prop.indexOf('font') != -1 || prop == 'line-height')) {
noFontPropReset[prop] = true;
}
-
+
if (prop == 'background') {
CSS.__Shorthand.setBackground(cssObj, selector, val);
- } else if (prop == 'font') {
+ } else if (prop == 'font') {
CSS.__Shorthand.setFont(cssObj, selector, val, noFontPropReset);
} else if ((prop == 'border' || prop.match(/^border\-([^-]+)$/)) && prop.indexOf('spacing') == -1 && prop.indexOf('collapse') == -1) {
CSS.__Shorthand.setBorder(cssObj, selector, val, prop);
}
return cssObj;
},
-
-
-
-
-
+
+
+
+
+
getSelectorCSS: function(selector, asObject) {
if (!selector) var selector = CSS.Selector.get();
}
return selector + ' ' + CSS.__propsToString(css);
},
-
-
-
+
+
+
saveRequired: function() {
return CSS.__localSaveRequired || CSS.__serverSaveRequired;
},
-
-
+
+
checkSpec: function(e, selector) {
if (!selector) var selector = CSS.Selector.get();
if (selector == '') {
UI.statusMsg('First you have to choose which item to style!', 'chameleon-notice');
return;
}
-
+
var splitSelector = function(selector) {
var selectorEnd = selector.split(' ').pop();
selectorEnd = selectorEnd.replace(/([\.:#])/g, '|$1');
return selectorEnd.split('|');
};
-
+
var similar = [];
-
+
var selectorBits = splitSelector(selector);
-
+
for (var sel in CSS.__localCSS) {
var selBits = splitSelector(sel);
-
+
var n = selectorBits.length;
-
+
while (n--) {
var match = selectorBits[n];
var m = selBits.length;
}
}
}
-
+
if (similar.length) {
UI.Selector.__displayOverview(null, similar, selector);
} else {
UI.statusMsg('Your file currently contains no selectors that appear similar to "' + selector + '"', 'chameleon-notice');
- }
+ }
},
-
-
+
+
unloadPrompt: function() {
if (CSS.__localSaveRequired) {
if (confirm('You have made changes to the CSS on this page since the last time it was saved, these changes will be lost unless you save them now. Select OK to save a temporary copy or Cancel to continue and discard the unsaved CSS.')) {
}
};
-
-
-
+
+
+
CSS.Selector = {
-
+
trimmed: [],
full: [],
selector: '',
-
+
create: function() {
CSS.Selector.trimmed = [];
-
+
var n = struct.length;
while (n--) {
if (CSS.Selector.full[n]) {
}
CSS.Selector.set(CSS.Selector.trimmed.join(' '));
},
-
+
modify: function(e) {
var target = e.target || e.srcElement;
var p = target.position;
-
+
var sel = CSS.Selector.full;
if (!sel[p]) {
CSS.Selector.create();
UI.Selector.displaySelector(CSS.Selector.trimmed);
},
-
+
set: function(sel) {
CSS.Selector.selector = sel;
},
-
+
get: function() {
- return CSS.Selector.selector;
+ return CSS.Selector.selector;
},
reset: function() {
CSS.Selector.trimmed = [];
CSS.Selector.full = [];
CSS.Selector.set('');
- }
+ }
};
-
-
-
+
+
+
CSS.__Shorthand = {
border: {},
-
+
recordBorder: function(prop, value) {
var pr = prop.split('-')
var p = pr.pop();
CSS.__Shorthand.border[p].push({prop: prop, value: value});
CSS.__Shorthand.border[s][p] = value;
},
-
+
getBorderString: function(col) {
var cb = CSS.__Shorthand.border;
-
+
var useHowManyProps = function(prop) {
if (!cb['top'] || !cb['right'] || !cb['bottom'] || !cb['left']) {
return false;
}
-
+
if (!(cb['top'][prop] && cb['right'][prop] && cb['bottom'][prop] && cb['left'][prop])) {
return false;
}
-
+
if (cb['top'][prop] == cb['right'][prop] && cb['top'][prop] == cb['bottom'][prop] && cb['top'][prop] == cb['left'][prop]) {
return 1;
}
}
return 4;
};
-
+
var getPropShorthand = function(prop) {
var num = useHowManyProps(prop);
if (!num) {
return '';
}
-
+
if (prop.indexOf('color') != -1) {
var l = inheritColor(cb['left'][prop]);
var r = inheritColor(cb['right'][prop]);
var t = cb['top'][prop];
var b = cb['bottom'][prop];
}
-
+
var propShorthand = '';
if (num == 1) {
propShorthand += ' border-' + prop + ': ' + l;
}
return propShorthand + ';\n';
};
-
+
var propsStr = function(props) {
var str = '';
for (var i = 0; i < props.length; ++i) {
}
return str;
};
-
+
var inheritColor = function(val) {
- if (!col || val != 'inherit') return val;
+ if (!col || val != 'inherit') return val;
return col;
};
-
+
var setImportant = function(str) {
if (!str) return '';
if (str.indexOf('!important') == -1) return str;
str = str.replace(/ *\!important */g, ' ');
return str.substr(0, str.lastIndexOf(';')) + ' !important;\n';
};
-
+
var widthEqual = (cb['width']) ? CSS.__Shorthand.__allPropsEqual(cb['width']) : false;
var styleEqual = (cb['style']) ? CSS.__Shorthand.__allPropsEqual(cb['style']) : false;
var colorEqual = (cb['color']) ? CSS.__Shorthand.__allPropsEqual(cb['color']) : false;
-
+
if (widthEqual && styleEqual && colorEqual) {
- var propStr = setImportant(cb['width'][0].value + ' ' + cb['style'][0].value + ' ' + inheritColor(cb['color'][0].value) + ';\n');
+ var propStr = setImportant(cb['width'][0].value + ' ' + cb['style'][0].value + ' ' + inheritColor(cb['color'][0].value) + ';\n');
if (cb['left'] && cb['top'] && cb['right'] && cb['bottom']) {
return ' border: ' + propStr;
}
-
+
var sideShorthand = '';
if (cb['top']) {
sideShorthand += ' border-top: ' + propStr;
}
return sideShorthand;
}
-
+
var widthProps = getPropShorthand('width');
if (!widthProps) {
widthProps = (cb['width']) ? propsStr(cb['width']) : '';
if (!colorProps) {
colorProps = (cb['color']) ? propsStr(cb['color']) : '';
}
-
+
return setImportant(widthProps) + setImportant(styleProps) + setImportant(colorProps);
},
-
-
-
-
-
+
+
+
+
+
setBorder: function(css, selector, value, prop) {
var props = {};
var p = '';
regexp: /^((rgb\(\d{1,3} *, *\d{1,3} *, *\d{1,3} *\))|(#[A-F0-9]{3}([A-F0-9]{3})?)|([a-z]+))$/i,
def: 'inherit'
};
-
+
var bits = value.split(' ');
var imp = (bits[bits.length - 1] == '!important') ? ' ' + bits.pop() : '';
-
+
if (prop == 'border') {
for (var i in props) {
css[selector]['border-top-' + i] = props[i].def;
bits.splice(j, 1);
break;
}
- }
+ }
}
imp = '';
}
}
}
-
+
},
-
-
-
-
+
+
+
+
setBackground: function(css, selector, value) {
var imp = (value.indexOf('!important') != -1) ? ' !important' : '';
if (imp != '') {
value = value.replace(/ *\!important */g, '');
}
-
+
var urlPos = value.indexOf('url(');
if (urlPos == -1 && value.indexOf('none') == -1) {
css[selector]['background-color'] = value + imp;
return;
}
css[selector]['background-image'] = 'url(' + bits[1].substr(0, endImg).replace(/["']+/g, '') + ')' + imp; //"
-
+
var pos = [];
-
+
var bgOptions = bits[1].substring(endImg + 1).split(' ');
var n = bgOptions.length;
-
+
for (var i = 0; i < n; ++i) {
var opt = bgOptions[i].trim();
if (opt.indexOf('repeat') != -1) {
css[selector]['background-color'] = col + imp;
}
},
-
+
setFont: function(css, selector, value, noreset) {
var imp = (value.indexOf('!important') != -1) ? ' !important' : '';
if (imp != '') {
value = value.replace(/ *\!important */g, '');
}
-
+
var order = ['font-style', 'font-variant', 'font-weight', 'font-size', 'font-family'];
var numProps = order.length;
var allowedVals = {};
allowedVals['font-weight'] = /(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit)/;
allowedVals['font-size'] = /([^ ]+)/;
allowedVals['font-family'] = /(.+$)/;
-
+
if (!noreset['font-style']) css[selector]['font-style'] = 'normal';
if (!noreset['font-variant']) css[selector]['font-variant'] = 'normal';
if (!noreset['font-weight']) css[selector]['font-weight'] = 'normal';
if (!noreset['font-size']) css[selector]['font-size'] = 'medium';
if (!noreset['line-height']) css[selector]['line-height'] = 'normal';
-
+
var expandShorthand = function(bits) {
var numBits = bits.length;
var startProp = 0;
}
}
};
-
+
var removeCommaListSpaces = function(str) {
var comma = str.indexOf(',');
if (comma != -1) {
}
return str;
};
-
+
var hasQuote = value.match(/(["'])/); //"
if (hasQuote) {
var tmp = value.split(hasQuote[1]);
var bits = removeCommaListSpaces(tmp.shift()).split(' ');
var startFont = bits.pop();
-
+
expandShorthand(bits);
-
- css[selector]['font-family'] = startFont + hasQuote[1] + tmp.join(hasQuote[1]) + imp;
+
+ css[selector]['font-family'] = startFont + hasQuote[1] + tmp.join(hasQuote[1]) + imp;
} else {
- value = removeCommaListSpaces(value);
+ value = removeCommaListSpaces(value);
expandShorthand(value.split(' '));
}
},
-
-
-
+
+
+
__allPropsEqual: function(props) {
var num = props.length - 1;
if (num < 3) return false;
-
+
for (var i = 0; i < num; ++i) {
if (props[i].value != props[i + 1].value) {
return false;
return true;
}
};
-
-
-
+
+
+
CSS.FreeEdit = {
-
+
__initial: {},
-
+
setInitial: function(e) {
var target = e.target || e.srcElement;
CSS.FreeEdit.__initial = CSS.toObject(target.value);
},
-
+
saveComplete: function(e) {
var target = e.target || e.srcElement;
target.value = CSS.FreeEdit.__stripComments(target.value);
CSS.preview();
},
-
+
saveSelector: function(e) {
var target = e.target || e.srcElement;
target.value = CSS.FreeEdit.__stripComments(target.value);
-
+
var changedSelectors = [];
var css = CSS.toObject(target.value);
for (var sel in css) {
}
}
}
-
+
CSS.__localSaveRequired = true;
CSS.__remoteSaveRequired = true;
CSS.preview(changedSelectors);
},
-
+
__stripComments: function(str) {
return str.replace(/\/\*([\s\S])*?\*\//g, '');
}
-
+
};
-
-
-
-
-
-
+
+
+
+
+
+
var FileHandler = {
-
+
getFiles: function(path) {
if (!path) path = '';
var xmlhttp = new XMLHttpRequest();
return true;
}
};
-
-
-
-
-
+
+
+
+
+
var UI = {
boxes: [],
boxOffsetX: 35,
statusMsg: function(msg, cls) {
UI.clearStatusMsg();
-
+
var target = UI.__getBox();
if (!target) {
var box = Util.createElement('div', 'chameleon-status-msg');
box.style.zIndex = ++UI.zIndex;
UI.addToDoc(box);
} else {
-
+
var statusTable = Util.createElement('table', 'chameleon-status-msg');
var statusTableBody = Util.createElement('tbody');
var statusRow = Util.createElement('tr');
var statusIconCell = Util.createElement('td');
var statusMsgCell = Util.createElement('td');
var statusBtnCell = Util.createElement('td');
-
+
if (cls) {
statusIconCell.className = cls;
}
statusMsgCell.appendChild(document.createTextNode(msg));
statusBtnCell.appendChild(UI.createButton('chameleon-status-msg-btn', 'OK', 'Clear this message', UI.clearStatusMsg));
-
+
statusRow.appendChild(statusIconCell);
statusRow.appendChild(statusMsgCell);
statusRow.appendChild(statusBtnCell);
statusTableBody.appendChild(statusRow);
statusTable.appendChild(statusTableBody);
-
+
target.appendChild(statusTable);
}
},
var offset = x + 525 - screen.width;
x -= offset;
}
-
+
var box = Util.createElement('div', id);
box.style.left = x + 'px';
box.style.top = y + 'px';
closeBtn.appendChild(document.createTextNode('x'));
closeBtn.setAttribute('title', 'Close');
topBar.setAttribute('title', 'Drag me!');
-
+
UI.__dragTargetId = id + '-handle';
Util.addEvent(closeBtn, 'click', UI.closeBoxes);
topBar.appendChild(closeBtn);
box.appendChild(topBar);
-
+
UI.boxes.push(id);
return box;
},
-
+
closeAllBoxes: function() {
var n = UI.boxes.length;
while (n--) {
var target = e.target || e.srcElement;
var box = target.parentNode.parentNode;
}
-
+
var n = UI.boxes.length;
while (n--) {
if (UI.boxes[n] == box.id) {
var mouseCoords = Pos.getMouse(e);
var elementCoords = Pos.getElement(target);
target.mouseX = mouseCoords.x - elementCoords.x;
- target.mouseY = mouseCoords.y - elementCoords.y;
+ target.mouseY = mouseCoords.y - elementCoords.y;
UI.__dragTargetId = target.id;
var mouseCoords = Pos.getMouse(e);
target.parentNode.style.left = (mouseCoords.x - target.mouseX) + 'px';
target.parentNode.style.top = (mouseCoords.y - target.mouseY) + 'px';
-
+
if (e.preventDefault) {
e.preventDefault();
} else if (window.event) {
var target = e.target || e.srcElement;
target.parentNode.style.zIndex = ++UI.zIndex;
},
-
+
__getBox: function() {
var obj = document.getElementById(UI.__dragTargetId);
if (obj && obj.parentNode) {
}
return false;
},
-
-
-
-
+
+
+
+
setupPane: function(tabs, parentId, tabId, active) {
for (var i = 0; i < tabs.length; ++i) {
var obj = document.getElementById(tabId + '-tab-' + tabs[i]);
}
return parent;
},
-
+
setupButtons: function() {
var parentId = arguments[0];
var parent = document.getElementById(parentId);
}
}
},
-
+
createButton: function(id, value, title, fn, hidden) {
var btn = Util.createElement('input', id);
btn.setAttribute('type', 'submit');
}
}
};
-
-
+
+
UI.Selector = {
controlsId: 'chameleon-selector-controls',
viewedProp: null,
displayPropWatch: false,
sections: ['choose', 'overview', 'free-edit'],
-
-
+
+
editWindow: function(e) {
if (!e.shiftKey) {
return;
if (typeof tmpStruct == 'string') {
return;
}
-
+
hotspotMode = false;
var box = document.getElementById('chameleon-selector-box');
var tabsContainer = Util.createElement('table', 'chameleon-selector-tabs');
var tabsBody = Util.createElement('tbody');
var tabs = Util.createElement('tr');
-
+
tabs.appendChild(UI.Selector.__createTab('Choose', UI.Selector.__editSelector, true, 'Choose'));
tabs.appendChild(UI.Selector.__createTab('Overview', UI.Selector.__displayOverview, false, 'Overview'));
tabs.appendChild(UI.Selector.__createTab('Free Edit', UI.Selector.__editCode, false, 'Free Edit'));
UI.addToDoc(box);
UI.Selector.__editSelector();
-
+
if (e.preventDefault) {
e.preventDefault();
} else if (window.event) {
window.event.returnValue = false;
}
},
-
-
+
+
__listProps: function(e) {
var target = e.target || e.srcElement;
-
+
Util.removeElement(document.getElementById('chameleon-selector-element-list'));
UI.Selector.viewedProp = target.options[target.selectedIndex].value;
if (!document.getElementById('chameleon-selector-list')) {
target.parentNode.parentNode.insertBefore(UI.Selector.__elementList(target.options[target.selectedIndex].value), document.getElementById('chameleon-selector-list'));
}
},
-
+
__editSelector: function() {
var parent = UI.setupPane(UI.Selector.sections, UI.Selector.controlsId, 'chameleon-selector', 'choose');
UI.setupButtons('chameleon-selector-buttons', 'edit', 'check');
var instructions = Util.createElement('p');
instructions.appendChild(document.createTextNode('Please choose the element you wish to style.'));
container.appendChild(instructions);
-
+
var options = Util.createElement('p');
-
+
if (UI.Selector.__displayPropWatch) {
-
+
var selectProp = Util.createElement('select', 'chameleon-selector-prop-select');
var optionProp = Util.createElement('option');
optionProp.appendChild(document.createTextNode('Select a CSS property to view'));
optionProp.setAttribute('value', '');
selectProp.appendChild(optionProp);
-
+
for (var i = 0; i < Config.PROPS_LIST.length; ++i) {
optionProp = Util.createElement('option');
optionProp.setAttribute('value', Config.PROPS_LIST[i]);
optionProp.setAttribute('selected', 'selected');
}
optionProp.appendChild(document.createTextNode(Config.PROPS_LIST[i]));
- selectProp.appendChild(optionProp);
+ selectProp.appendChild(optionProp);
}
-
+
Util.addEvent(selectProp, 'change', UI.Selector.__listProps);
-
+
options.appendChild(selectProp);
-
+
}
-
+
var togglePropWatch = Util.createElement('a');
togglePropWatch.setAttribute('title', 'The property inspector allows you to check the current value of a range of CSS properties for these elements');
togglePropWatch.appendChild(document.createTextNode(' (' + (UI.Selector.__displayPropWatch ? 'Hide property inspector' : 'Show property inspector') + ')'));
Util.addEvent(togglePropWatch, 'click', UI.Selector.__togglePropWatch);
options.appendChild(togglePropWatch);
-
-
+
+
container.appendChild(options);
-
+
container.appendChild(UI.Selector.__elementList());
parent.appendChild(container);
UI.Selector.displaySelector(CSS.Selector.trimmed);
},
-
+
__togglePropWatch: function() {
UI.Selector.__displayPropWatch = !UI.Selector.__displayPropWatch;
UI.Selector.__editSelector();
},
-
+
__displayOverview: function(e, selectors, selector) {
var parent = UI.setupPane(UI.Selector.sections, UI.Selector.controlsId, 'chameleon-selector', 'overview');
UI.setupButtons('chameleon-selector-buttons');
-
+
var container = Util.createElement('div', 'chameleon-style-overview-container');
parent.appendChild(container); // doing it this way is much faster than creating the table then applying the overflow
UI.setOverflow(container, 350, true);
-
+
var overviewTable = Util.createElement('table', 'chameleon-style-overview');
var overviewTableBody = Util.createElement('tbody');
-
+
if (!selectors) {
for (var sel in CSS.__localCSS) {
var overviewTableRow = Util.createElement('tr');
-
+
var overviewTableCell = Util.createElement('th');
overviewTableCell.className = 'selector';
overviewTableCell.appendChild(document.createTextNode(sel));
}
}
} else {
-
+
var n = selectors.length;
-
+
if (!CSS.__localCSS[selector]) {
var overviewTableRow = Util.createElement('tr');
-
+
var overviewTableCell = Util.createElement('th');
overviewTableCell.className = 'current-selector';
overviewTableCell.appendChild(document.createTextNode(selector));
overviewTableRow.appendChild(overviewTableCell);
overviewTableBody.appendChild(overviewTableRow);
}
-
+
for (var i = 0; i < n; ++i) {
var sel = selectors[i];
-
+
var overviewTableRow = Util.createElement('tr');
-
+
var overviewTableCell = Util.createElement('th');
overviewTableCell.className = (sel == selector) ? 'current-selector' : 'selector';
overviewTableCell.appendChild(document.createTextNode(sel));
overviewTableRow.appendChild(overviewTableCell);
overviewTableBody.appendChild(overviewTableRow);
-
+
for (var prop in CSS.__localCSS[sel]) {
overviewTableRow = Util.createElement('tr');
overviewTableCell = Util.createElement('td');
overviewTableBody.appendChild(overviewTableRow);
}
}
-
+
}
- overviewTable.appendChild(overviewTableBody);
+ overviewTable.appendChild(overviewTableBody);
container.appendChild(overviewTable);
},
-
+
__elementList: function(showComputedStyle) {
if (!showComputedStyle && UI.Selector.viewedProp) {
showComputedStyle = UI.Selector.viewedProp;
}
-
+
var list = Util.createElement('ol', 'chameleon-selector-element-list');
var n = struct.length;
var classStr = '';
tag.appendChild(document.createTextNode(struct[n].tagname));
tag.selectorValue = struct[n].tagname;
tag.position = n;
-
+
UI.Selector.__autoHighlight(tag);
Util.addEvent(tag, 'click', CSS.Selector.modify);
if (idStr = struct[n].id) {
var id = Util.createElement('span', 'chameleon-id-attr-' + n);
- id.selectorValue = struct[n].tagname + '#' + idStr;
- id.position = n;
+ id.selectorValue = struct[n].tagname + '#' + idStr;
+ id.position = n;
id.appendChild(document.createTextNode('#' + idStr));
UI.Selector.__autoHighlight(id);
for (var i = 0; i < classArr.length; ++i) {
var cn = Util.createElement('span', 'chameleon-class-attr-' + n + '-' + i);
cn.selectorValue = struct[n].tagname + '.' + classArr[i];
- cn.position = n;
+ cn.position = n;
cn.appendChild(document.createTextNode('.' + classArr[i]));
UI.Selector.__autoHighlight(cn);
var pc = Util.createElement('span', 'chameleon-pseudo-class' + n + '-' + i);
pc.selectorValue = struct[n].tagname + ':' + pseudoClasses[i];
- pc.position = n;
+ pc.position = n;
pc.appendChild(document.createTextNode(':' + pseudoClasses[i]));
UI.Selector.__autoHighlight(pc);
item.appendChild(pc);
}
}
-
+
if (showComputedStyle) {
var sides = ['top', 'right', 'bottom', 'left'];
-
+
if (document.defaultView && document.defaultView.getComputedStyle) {
if (showComputedStyle == 'margin' || showComputedStyle == 'padding') {
var styleVal = [];
- for (var i = 0; i < 4; ++i) {
+ for (var i = 0; i < 4; ++i) {
styleVal.push(document.defaultView.getComputedStyle(struct[n].el, null).getPropertyValue(showComputedStyle + '-' + sides[i]))
}
-
+
if (styleVal[0] == styleVal[1] && styleVal[1] == styleVal[2] && styleVal[2] == styleVal[3]) {
styleVal = styleVal[0];
} else if (styleVal[0] == styleVal[2] && styleVal[1] == styleVal[3]) {
} else {
styleVal = styleVal.join(' ');
}
- } else {
+ } else {
var styleVal = document.defaultView.getComputedStyle(struct[n].el, null).getPropertyValue(showComputedStyle);
}
-
+
if (styleVal.indexOf('rgb') != -1) {
styleVal = UI.Selector.__formatColor(styleVal);
}
-
+
} else if (struct[n].el.currentStyle) {
var propBits = showComputedStyle.split('-');
for (var i = 1; i < propBits.length; ++i) {
propBits[i] = propBits[i].charAt(0).toUpperCase() + propBits[i].substring(1);
}
- var styleVal = struct[n].el.currentStyle[propBits.join('')];
+ var styleVal = struct[n].el.currentStyle[propBits.join('')];
}
-
+
var sp = Util.createElement('span');
sp.className = 'prop-value';
sp.appendChild(document.createTextNode(styleVal));
-
+
item.appendChild(sp);
}
-
+
list.appendChild(item);
}
-
+
return list;
},
-
-
+
+
__formatColor: function(color) {
- var newColor = '';
+ var newColor = '';
colorBits = color.replace(/rgb\(|[ \)]/g, '').split(',');
var hexCol = (colorBits[0] << 16 | colorBits[1] << 8 | colorBits[2]).toString(16);
while (hexCol.length < 6) {
}
return '#' + hexCol;
},
-
-
+
+
__editCode: function() {
var parent = UI.setupPane(UI.Selector.sections, UI.Selector.controlsId, 'chameleon-selector', 'free-edit');
UI.setupButtons('chameleon-selector-buttons', 'revert', 'save-local', 'save-server');
var container = Util.createElement('div');
var textarea = Util.createElement('textarea', 'chameleon-free-edit-all-field');
-
+
textarea.style.width = '100%';
textarea.style.height = '350px';
Util.addEvent(textarea, 'blur', CSS.FreeEdit.saveComplete);
parent.appendChild(container);
textarea.value = CSS.toString(); // avoid Konqueror bug
},
-
-
-
-
+
+
+
+
__selectorList: function() {
return Util.createElement('ol', 'chameleon-selector-list');
},
-
-
-
-
+
+
+
+
__createTab: function(str, fn, active, title) {
var id = 'chameleon-selector-tab-' + str.replace(/ +/, '-').toLowerCase();
var tab = Util.createElement('td', id);
return p;
},
-
-
-
-
+
+
+
+
__autoHighlight: function(el) {
if (CSS.Selector.full[el.position] && CSS.Selector.full[el.position].val == el.selectorValue) {
UI.Selector.highlight(el);
UI.Selector.unhighlight(el);
}
},
-
+
highlight: function(el) {
UI.Selector.unhighlight(el);
el.className += 'active-selector';
unhighlight: function(el) {
el.className = el.className.replace(/\bactive-selector\b/, '');
},
-
-
-
-
+
+
+
+
displaySelector: function(selector) {
var n = selector.length;
item.appendChild(document.createTextNode('That are descended from ' + UI.Selector.__describe(selector[n])));
list.appendChild(item);
}
-
+
UI.setOverflow(list, 100);
},
__describe: function(txt) {
if (!txt) return '';
-
+
if (txt.indexOf(':') != -1) {
var parts = txt.split(':');
var pc = ' the "' + parts.pop() + '" state of ';
return pc + txt + ' tags';
}
};
-
-
-
+
+
+
UI.CSS = {
redraw: null,
colorType: null,
controlsId: 'chameleon-style-controls',
sections: ['text', 'backgrounds', 'borders-all', 'borders-separate', 'free-edit'],
-
+
__borderEditGroup: true,
-
+
editWindow: function(e) {
if (CSS.Selector.get() == '') {
UI.statusMsg('First you have to choose which item to style!', 'chameleon-notice');
return;
}
-
+
var box = document.getElementById('chameleon-style-box');
if (box) UI.closeBoxes(true, box);
var tabsContainer = Util.createElement('table', 'chameleon-style-tabs');
var tabsBody = Util.createElement('tbody');
var tabs = Util.createElement('tr');
-
+
tabs.appendChild(UI.CSS.__createTab('Text', UI.CSS.__editText, true, 'Text'));
tabs.appendChild(UI.CSS.__createTab('Backgrounds', UI.CSS.__editBackgrounds, false, 'Backgrounds'));
tabs.appendChild(UI.CSS.__createTab('Borders (All)', UI.CSS.__editBordersAll, false, 'Borders (All)'));
box.appendChild(UI.CSS.__addButtons());
UI.addToDoc(box);
-
+
UI.CSS.__editText();
},
-
-
-
+
+
+
launchEditWindow: function(e) {
var target = e.target || e.srcElement;
CSS.Selector.set(target.value);
UI.CSS.editWindow(e);
},
-
-
+
+
__editText: function(e, redraw) {
UI.CSS.redraw = arguments.callee;
UI.CSS.colorType = 'color';
container.appendChild(row.node);
row = UI.CSS.__selectBox('font-family', '-select-font-family', Check.fontFamily, Config.FONTS_LIST);
- container.appendChild(row.node);
+ container.appendChild(row.node);
row = UI.CSS.__inputField('font-family', '-input-font-family', Check.fontFamily, !row.meta.sel);
container.appendChild(row.node);
row = UI.CSS.__selectBox('font-style', '-select-font-style', Check.fontStyle, Config.FONT_STYLES);
container.appendChild(row.node);
-
+
row = UI.CSS.__selectBox('text-align', '-select-text-align', Check.textAlign, Config.TEXT_ALIGN);
container.appendChild(row.node);
}
}
},
-
+
__editBackgrounds: function(e, redraw) {
UI.CSS.redraw = arguments.callee;
UI.CSS.colorType = 'background-color';
container.appendChild(row.node);
var extraFields = row.meta;
-
+
row = UI.CSS.__selectBox('background-repeat', '-select-background-repeat', Check.backgroundRepeat, Config.REPEAT_LIST, !extraFields);
container.appendChild(row.node);
row = UI.CSS.__selectBox('background-position', '-select-background-position', Check.backgroundPosition, Config.POSITION_LIST, !extraFields);
- container.appendChild(row.node);
+ container.appendChild(row.node);
containerTable.appendChild(container);
parent.appendChild(containerTable);
imgPreview.setAttribute('height', '20');
}
},
-
+
__editBordersAll: function(e, redraw) {
UI.CSS.redraw = arguments.callee;
UI.CSS.colorType = 'border-color';
-
+
var containerTable = document.getElementById('chameleon-style-edit-borders-all-container');
if (!containerTable) {
-
+
var parent = UI.setupPane(UI.CSS.sections, UI.CSS.controlsId, 'chameleon-style', 'borders-all');
containerTable = Util.createElement('table', 'chameleon-style-edit-borders-all-container');
var container = Util.createElement('tbody');
var row = UI.CSS.__inputField('border-width', '-input-border-width', Check.borderWidth);
container.appendChild(row.node);
-
+
row = UI.CSS.__inputField('border-color', '-input-border-color', Check.color);
container.appendChild(row.node);
-
+
row = UI.CSS.__selectBox('border-style', '-select-border-style', Check.borderStyle, Config.BORDER_LIST);
container.appendChild(row.node);
}
}
},
-
+
__editBordersSeparate: function(e, redraw) {
UI.CSS.redraw = arguments.callee;
-
+
var containerTable = document.getElementById('chameleon-style-edit-borders-separate-container');
if (!containerTable) {
var parent = UI.setupPane(UI.CSS.sections, UI.CSS.controlsId, 'chameleon-style', 'borders-separate');
var row = UI.CSS.__inputField('border-top-width', '-input-border-top-width', Check.borderWidth);
container.appendChild(row.node);
-
+
row = UI.CSS.__inputField('border-top-color', '-input-border-top-color', Check.color, false, UI.CSS.__setColorType);
container.appendChild(row.node);
-
+
row = UI.CSS.__selectBox('border-top-style', '-select-border-top-style', Check.borderStyle, Config.BORDER_LIST);
- container.appendChild(row.node);
+ container.appendChild(row.node);
row = UI.CSS.__inputField('border-right-width', '-input-border-right-width', Check.borderWidth);
container.appendChild(row.node);
-
+
row = UI.CSS.__inputField('border-right-color', '-input-border-right-color', Check.color, false, UI.CSS.__setColorType);
container.appendChild(row.node);
row = UI.CSS.__selectBox('border-right-style', '-select-border-right-style', Check.borderStyle, Config.BORDER_LIST);
- container.appendChild(row.node);
+ container.appendChild(row.node);
+
-
row = UI.CSS.__inputField('border-bottom-width', '-input-border-bottom-width', Check.borderWidth);
container.appendChild(row.node);
container.appendChild(row.node);
row = UI.CSS.__selectBox('border-bottom-style', '-select-border-bottom-style', Check.borderStyle, Config.BORDER_LIST);
- container.appendChild(row.node);
+ container.appendChild(row.node);
+
-
row = UI.CSS.__inputField('border-left-width', '-input-border-left-width', Check.borderWidth);
container.appendChild(row.node);
row = UI.CSS.__selectBox('border-left-style', '-select-border-left-style', Check.borderStyle, Config.BORDER_LIST);
container.appendChild(row.node);
-
+
containerTable.appendChild(container);
parent.appendChild(containerTable);
} else {
}
}
},
-
+
__editCode: function(e) {
UI.CSS.redraw = arguments.callee;
var container = Util.createElement('div');
var textarea = Util.createElement('textarea', 'chameleon-free-edit-field');
-
+
textarea.style.width = '100%';
textarea.style.height = '350px';
parent.appendChild(container);
textarea.value = CSS.getSelectorCSS(); // avoid Konqueror bug
},
-
-
-
-
-
-
-
+
+
+
+
+
+
+
__getPropValue: function(prop) {
var val = UI.CSS.__getBorderPropValue(prop);
if (val === '') {
return false;
}
-
+
if (val === false) {
val = CSS.getPropValue(prop);
}
return val;
},
-
-
+
+
__setColorDisplay: function(prop, value, field, picker) {
if (!field) var field = document.getElementById(UI.CSS.controlsId + '-input-' + prop);
if (!picker) var picker = document.getElementById(UI.CSS.controlsId + '-color-picker-' + prop);
-
+
if (!field || !picker) return;
-
+
field.value = value;
try {
picker.style.backgroundColor = (value != '') ? value.replace(/[ ]*\!important/, '') : '#000';
UI.statusMsg(value + ' is an Invalid color!', 'chameleon-error');
}
},
-
+
__setImageDisplay: function(value, field, picker) {
if (!field) var field = document.getElementById(UI.CSS.controlsId + '-input-background-image');
if (!picker) var picker = document.getElementById(UI.CSS.controlsId + '-background-image-picker');
-
+
var preview = document.getElementById('chameleon-image-preview');
-
+
if (!field || !picker) return;
-
+
field.value = value;
if (value != '') {
if (!preview) {
preview = Util.createElement('img', 'chameleon-image-preview');
picker.appendChild(preview);
}
-
+
if (field.value != 'none') {
preview.setAttribute('src', CSS.fixPath(value.replace(/[ ]*\!important/, '')));
} else {
picker.setAttribute('title', 'Open image picker');
Util.addEvent(picker, 'click', UI.CSS.__loadImagePicker);
}
-
-
+
+
},
-
+
__shorthandWarningIcon: function() {
var img = Util.createElement('img');
img.setAttribute('src', CSS.fixPath('ui/images/notice.gif'));
img.style.margin = '0 2px -5px 0';
- img.setAttribute('title', 'Currently this property has specific values set for one or more individual sides. Updating the value here will set this property for all sides, overwriting these individual values.');
+ img.setAttribute('title', 'Currently this property has specific values set for one or more individual sides. Updating the value here will set this property for all sides, overwriting these individual values.');
return img;
},
-
+
__inputField: function(prop, id, validate, hidden, init) {
var row = Util.createElement('tr', UI.CSS.controlsId + '-row' + id);
id = UI.CSS.controlsId + id;
-
+
var labelCell = Util.createElement('td');
var fieldCell = Util.createElement('td');
var field = Util.createElement('input', id);
field.setAttribute('type', 'text');
field.className = 'chameleon-input-text';
-
-
+
+
var val = UI.CSS.__getPropValue(prop);
if (val !== false) {
field.value = val;
} else {
labelCell.appendChild(UI.CSS.__shorthandWarningIcon());
}
-
+
Util.addEvent(field, 'blur', validate);
if (init) {
Util.addEvent(field, 'focus', init);
}
-
+
labelCell.appendChild(document.createTextNode(UI.CSS.__formatProp(prop) + ': '));
labelCell.className = 'label';
fieldCell.appendChild(field);
-
+
row.appendChild(labelCell);
row.appendChild(fieldCell);
-
+
if (prop == 'color' || prop.indexOf('-color') != -1) {
var colorCell = Util.createElement('td');
var colorPicker = Util.createElement('div', UI.CSS.controlsId + '-color-picker-' + prop);
colorPicker.setAttribute('title', 'Open color picker');
UI.CSS.__setColorDisplay(prop, field.value, field, colorPicker);
-
+
Util.addEvent(colorPicker, 'click', UI.CSS.__displayColorPicker);
if (init) {
Util.addEvent(colorPicker, 'click', init);
} else if (prop.indexOf('-image') != -1) {
var imgCell = Util.createElement('td');
var imgPicker = Util.createElement('div', UI.CSS.controlsId + '-background-image-picker');
-
+
UI.CSS.__setImageDisplay(field.value, field, imgPicker);
imgCell.appendChild(imgPicker);
row.appendChild(imgCell);
-
+
} else {
fieldCell.setAttribute('colspan', '2');
}
}
return {node: row, meta: (field.value == 'none') ? false : field.value};
},
-
-
+
+
__selectBox: function(prop, id, validate, src, hidden) {
var row = Util.createElement('tr', UI.CSS.controlsId + '-row' + id);
id = UI.CSS.controlsId + id;
var labelCell = Util.createElement('td');
var fieldCell = Util.createElement('td');
fieldCell.setAttribute('colspan', '2');
-
+
var currentValue = UI.CSS.__getPropValue(prop);
if (currentValue === false) {
labelCell.appendChild(UI.CSS.__shorthandWarningIcon());
var selected = false;
var otherSelected = false;
-
+
for (var i = 0; i < src.length; ++i) {
op = Util.createElement('option');
op.setAttribute('value', src[i]);
return {node: row, meta: {sel: otherSelected, value: currentValue}};
},
-
-
-
+
+
+
__createTab: function(str, fn, active, title) {
var id = 'chameleon-style-tab-' + str.replace(/[\( ]+/, '-').replace(/[\)]+/, '').toLowerCase();
var tab = Util.createElement('td', id);
Util.addEvent(tab, 'click', fn);
return tab;
},
-
+
__addButtons: function() {
var p = Util.createElement('p', 'chameleon-style-buttons');
p.style.textAlign = 'right';
return p;
},
-
+
__formatProp: function(txt) {
if (txt.length > 15 && txt.indexOf('-') != -1) {
return txt.split('-').slice(1).join('-');
__loadImagePicker: function(e) {
var target = e.target || e.srcElement;
-
+
if (target.value) {
UI.statusMsg('Loading file list for ' + target.value + '...', 'chameleon-working');
FileHandler.getFiles(target.value);
FileHandler.getFiles('root');
}
},
-
+
displayImagePicker: function(xmldata) {
UI.clearStatusMsg();
var coords = Pos.getElement(document.getElementById('chameleon-style-box'));
box = UI.makeDraggableBox('chameleon-file-box', coords.x + UI.boxOffsetX, coords.y + UI.boxOffsetY);
-
+
if (xmldata.firstChild.nodeName.toLowerCase() == 'chameleon_error') {
UI.statusMsg('There was an error reading files from the server:\n' + xmldata.firstChild.firstChild.nodeValue + '.', 'chameleon-error');
return;
}
-
+
var files = xmldata.firstChild;
var hasFiles = false;
-
+
var infoTable = Util.createElement('table');
var infoTableBody = Util.createElement('tbody');
var infoTableRow = Util.createElement('tr');
Util.addEvent(parentLink, 'click', UI.CSS.__loadImagePicker);
parentCell.appendChild(parentLink);
infoTableRow.appendChild(parentCell);
- }
+ }
var location = Util.createElement('td', 'chameleon-files-location');
var locationPara = Util.createElement('p');
infoTableBody.appendChild(infoTableRow);
infoTable.appendChild(infoTableBody);
box.appendChild(infoTable);
-
+
var fileList = Util.createElement('div');
for (var i = 0; i < files.childNodes.length; ++i) {
UI.setOverflow(fileList, 350);
},
-
-
-
-
+
+
+
+
__displayColorPicker: function(e) {
var box = document.getElementById('chameleon-color-box');
if (box) UI.closeBoxes(true, box);
-
+
var extraColors = ['000000', '333333', '666666', '999999', 'cccccc', 'ffffff', 'ff0000', '00ff00', '0000ff', 'ffff00', 'ff00ff', '00ffff'];
var coords = Pos.getElement(document.getElementById('chameleon-style-box'));
while (col.length < 6) {
col = '0' + col;
}
-
+
yi = (xx > 17) ? 5 : 0;
-
+
var colorTab = Util.createElement('div');
colorTab.style.position = 'absolute';
colorTab.style.left = ((15 * x) + 17) + 'px';
colorTab.setAttribute('title', '#' + col);
container.appendChild(colorTab);
-
+
if (x == 17) {
x = 0;
if (xx == 35) {
++x;
++xx;
}
- }
+ }
}
}
-
+
for (var i = 0; i < extraColors.length; ++i) {
var colorTab = Util.createElement('div');
colorTab.style.position = 'absolute';
container.appendChild(colorTab);
}
-
+
Util.addEvent(container, 'click', Check.color);
container.style.height = (((y + yi) * 15) + 20) + 'px';
UI.addToDoc(box);
},
-
-
-
+
+
+
__setColorType: function(e) {
var target = e.target || e.srcElement;
UI.CSS.colorType = UI.CSS.getBorderProp(target.id);
},
-
-
+
+
getBorderProp: function(id) {
var separators = ['color-picker', 'input', 'select'];
for (var i = 0; i < separators.length; ++i) {
if (!p1 && !p2 && !p3 && !p4) {
return false;
}
-
+
if (!(p1 && p2 && p3 && p4)) {
return '';
}
-
- return (p1 == p2 && p2 == p3 && p3 == p4) ? p1 : '';
+
+ return (p1 == p2 && p2 == p3 && p3 == p4) ? p1 : '';
}
return false;
}
-
+
};
-
-
-
+
+
+
UI.HotSpots = {
__selectors: null,
__counter: 0,
__lookup: {},
-
+
init: function() {
var box = Util.createElement('div', 'chameleon-launch-hotspots');
box.appendChild(document.createTextNode('Load hotspots'));
box.style.zIndex = ++UI.zIndex;
-
+
box.hotSpotsOn = false;
Util.addEvent(box, 'click', UI.HotSpots.__load);
-
+
UI.addToDoc(box);
},
-
+
getString: function() {
var sel = CSS.Selector.get();
if (UI.HotSpots.__selectors[sel]) {
}
return '"' + sel + '"';
},
-
+
__load: function(e) {
var target = e.target || e.srcElement;
target.hotSpotsOn = !target.hotSpotsOn;
-
+
UI.HotSpots.__counter = 0;
UI.HotSpots.__lookup = {};
-
+
if (!target.hotSpotsOn) {
target.firstChild.nodeValue = 'Show hotspots';
UI.HotSpots.__clear();
return;
}
target.firstChild.nodeValue = 'Hide hotspots';
-
+
if (!UI.HotSpots.__selectors) {
UI.HotSpots.__selectors = {};
UI.HotSpots.__selectors['body'] = 'The body of the page (all pages)';
UI.HotSpots.__selectors['table.generaltable tr.r0'] = 'Odd numbered table rows';
UI.HotSpots.__selectors['table.generaltable tr.r1'] = 'Even numbered table rows';
}
-
+
UI.HotSpots.__parse();
},
-
+
__parse: function() {
var pos = {};
-
+
for (var sel in UI.HotSpots.__selectors) {
var matches = cssQuery(sel);
var nm = matches.length;
if (!nm) {
continue;
}
-
+
for (var j = 0; j < nm; ++j) {
if (matches[j].hasAttribute && matches[j].hasAttribute('id') && matches[j].getAttribute('id').indexOf('chameleon') != -1) {
continue;
}
-
+
if (!matches[j].chameleonHotspotId) {
var coords = Pos.getElement(matches[j]);
coords.x = 20 * Math.round(coords.x / 20);
coords.y = 20 * Math.round(coords.y / 20);
-
+
while (pos[coords.x + '-' + coords.y]) {
coords.x += 20;
}
pos[coords.x + '-' + coords.y] = true;
-
+
var button = UI.HotSpots.__makeButton(UI.HotSpots.__selectors[sel], coords.x, coords.y);
UI.addToDoc(button);
-
+
matches[j].chameleonHotspotId = button.id;
UI.HotSpots.__lookup[button.id] = sel;
break;
} else {
UI.HotSpots.__lookup[matches[j].chameleonHotspotId] += '|' + sel;
document.getElementById(matches[j].chameleonHotspotId).title += ", " + UI.HotSpots.__selectors[sel];
-
+
break;
}
}
}
-
+
pos = null;
matches = null;
},
-
-
+
+
__clear: function() {
for (var sel in UI.HotSpots.__selectors) {
var matches = cssQuery(sel);
if (!nm) {
continue;
}
-
+
for (var j = 0; j < nm; ++j) {
if (matches[j].chameleonHotspotId) {
UI.HotSpots.__lookup[matches[j].chameleonHotspotId] = null;
break;
}
}
- }
+ }
},
-
-
+
+
__makeButton: function(title, x, y) {
var d = Util.createElement('img', 'chameleon-hotspot-' + ++UI.HotSpots.__counter);
d.style.width = d.style.height = '20px';
d.style.left = (x - 5) + 'px';
d.style.top = (y + 15) + 'px';
d.style.cursor = 'pointer';
-
+
d.setAttribute('src', CSS.fixPath('ui/images/hotspot.gif'));
d.setAttribute('title', title);
Util.addEvent(d, 'click', UI.HotSpots.__launch);
return d;
},
-
+
__launch: function(e) {
var target = e.target || e.srcElement;
var selectors = UI.HotSpots.__lookup[target.id].split('|');
-
+
var coords = Pos.getMouse(e);
-
+
hotspotMode = true;
-
+
var box = document.getElementById('chameleon-selector-box');
if (box) UI.closeBoxes(true, box);
-
+
var box = UI.makeDraggableBox('chameleon-selector-box', coords.x, coords.y);
-
+
if (selectors.length > 1) {
var instructions = Util.createElement('p');
instructions.appendChild(document.createTextNode('This element matches more than one selector, please choose which you would like to style.'));
instructions.className = 'chameleon-instructions';
box.appendChild(instructions);
}
-
+
var selList = Util.createElement('ul');
for (var i = 0; i < selectors.length; ++i) {
var item = Util.createElement('li');
itemLink.appendChild(document.createTextNode('Add/Edit styles for ' + UI.HotSpots.__selectors[selectors[i]]));
itemLink.value = selectors[i];
Util.addEvent(itemLink, 'click', UI.HotSpots.__launchCSSEditor);
-
+
item.appendChild(itemLink);
-
+
selList.appendChild(item);
-
- box.appendChild(selList);
+
+ box.appendChild(selList);
}
UI.addToDoc(box);
},
-
+
__launchCSSEditor: function(e, value) {
var target = e.target || e.srcElement;
-
+
if (!value) {
var value = target.value;
}
CSS.Selector.set(value);
UI.CSS.editWindow(e);
}
-
+
};
-
-
-
-
-
+
+
+
+
+
var Check = {
color: function(e) {
var target = e.target || e.srcElement;
if (e.type == 'click' && !target.value) return;
-
+
var originalColor = UI.CSS.__getPropValue(UI.CSS.colorType);
if (originalColor != target.value) {
CSS.setPropValue(UI.CSS.colorType, target.value);
UI.closeBoxes(true, target.parentNode.parentNode);
}
},
-
+
backgroundImage: function(e) {
var target = e.target || e.srcElement;
if (e.type == 'click') {
UI.closeBoxes(true, document.getElementById('chameleon-file-box'));
}
- },
-
+ },
+
backgroundRepeat: function(e) {
var target = e.target || e.srcElement;
var value = target.options[target.options.selectedIndex].value.toLowerCase();
CSS.setPropValue('background-repeat', value);
},
-
+
backgroundPosition: function(e) {
var target = e.target || e.srcElement;
var value = target.options[target.options.selectedIndex].value.toLowerCase();
CSS.setPropValue('background-position', value);
},
-
+
borderWidth: function(e) {
var target = e.target || e.srcElement;
} else if (!hasUnits) {
target.value = val + 'px';
}
- CSS.setPropValue(UI.CSS.getBorderProp(target.id), target.value);
+ CSS.setPropValue(UI.CSS.getBorderProp(target.id), target.value);
},
-
+
borderStyle: function(e) {
var target = e.target || e.srcElement;
var value = target.options[target.options.selectedIndex].value.toLowerCase();
CSS.setPropValue(UI.CSS.getBorderProp(target.id), value);
},
-
+
fontStyle: function(e) {
var target = e.target || e.srcElement;
var value = target.options[target.options.selectedIndex].value.toLowerCase();
CSS.setPropValue('font-style', value);
},
-
+
fontWeight: function(e) {
var target = e.target || e.srcElement;
var value = target.options[target.options.selectedIndex].value.toLowerCase();
CSS.setPropValue('font-weight', value);
},
-
+
fontSize: function(e) {
var target = e.target || e.srcElement;
CSS.setPropValue('font-size', target.value);
},
-
+
lineHeight: function(e) {
var target = e.target || e.srcElement;
CSS.setPropValue('line-height', target.value);
},
-
+
fontFamily: function(e) {
var target = e.target || e.srcElement;
var n = target.nodeName.toLowerCase();
-
+
if (n == 'select') {
var value = target.options[target.options.selectedIndex].value.toLowerCase();
var fontFamilyInputRow = target.parentNode.parentNode.nextSibling;
CSS.setPropValue('font-family', target.value);
}
},
-
+
textDecoration: function(e) {
var target = e.target || e.srcElement;
var value = target.options[target.options.selectedIndex].value.toLowerCase();
CSS.setPropValue('text-decoration', value);
},
-
+
textAlign: function(e) {
var target = e.target || e.srcElement;
var value = target.options[target.options.selectedIndex].value.toLowerCase();
CSS.setPropValue('text-align', value);
}
};
-
-
+
+
var setup = function() {
UI.clearStatusMsg();
-
+
// UI.HotSpots.init();
-
+
var crumb = new cookie('chameleon_server_save_required');
if (crumb.read() == 1) {
CSS.requireRemoteSave();
}
-
+
Util.addEvent(window, 'unload', CSS.unloadPrompt);
Util.addEvent(window, 'unload', Util.cleanUp);
Util.addEvent(document, 'mousedown', UI.Selector.editWindow);
-
+
//CSS.clearTheme();
};
-/* sorry about the massive abuse of !important ;-) this tries to prevent user changes in CSS being
+/* sorry about the massive abuse of !important ;-) this tries to prevent user changes in CSS being
inherited by the user interface */
/* general box styles */
-#chameleon-selector-box, #chameleon-style-box,
-#chameleon-color-box, #chameleon-file-box,
+#chameleon-selector-box, #chameleon-style-box,
+#chameleon-color-box, #chameleon-file-box,
#chameleon-export-box {
position: absolute !important;
left: 0; top: 0;
}
/* drag handles */
-#chameleon-selector-box #chameleon-selector-box-handle,
-#chameleon-style-box #chameleon-style-box-handle,
+#chameleon-selector-box #chameleon-selector-box-handle,
+#chameleon-style-box #chameleon-style-box-handle,
#chameleon-color-box #chameleon-color-box-handle,
#chameleon-file-box #chameleon-file-box-handle,
#chameleon-export-box #chameleon-export-box-handle {
background: #ddd !important;
}
-#chameleon-selector-box #chameleon-selector-box-close,
-#chameleon-style-box #chameleon-style-box-close,
+#chameleon-selector-box #chameleon-selector-box-close,
+#chameleon-style-box #chameleon-style-box-close,
#chameleon-color-box #chameleon-color-box-close,
#chameleon-file-box #chameleon-file-box-close {
padding: 1px 5px !important;
/* the buttons */
-#chameleon-selector-box input.chameleon-btn,
-#chameleon-style-box input.chameleon-btn,
-#chameleon-color-box input.chameleon-btn,
+#chameleon-selector-box input.chameleon-btn,
+#chameleon-style-box input.chameleon-btn,
+#chameleon-color-box input.chameleon-btn,
#chameleon-file-box input.chameleon-btn {
cursor: pointer !important;
margin-bottom: 3px !important;
die('CHAMELEON_ERROR ' . $chameleon->error);
}
}
-
+
} else {
$css = $chameleon->read();
*
*/
/**
- * <p>Sarissa is a utility class. Provides "static" methods for DOMDocument and
+ * <p>Sarissa is a utility class. Provides "static" methods for DOMDocument and
* XMLHTTP objects, DOM Node serializatrion to XML strings and other goodies.</p>
* @constructor
*/
};
return oDoc;
};
- // see non-IE version
+ // see non-IE version
Sarissa.getParseErrorText = function (oDoc) {
var parseErrorText = Sarissa.PARSED_OK;
if(oDoc.parseError != 0){
- parseErrorText = "XML Parsing Error: " + oDoc.parseError.reason +
- "\nLocation: " + oDoc.parseError.url +
- "\nLine Number " + oDoc.parseError.line + ", Column " +
- oDoc.parseError.linepos +
+ parseErrorText = "XML Parsing Error: " + oDoc.parseError.reason +
+ "\nLocation: " + oDoc.parseError.url +
+ "\nLine Number " + oDoc.parseError.line + ", Column " +
+ oDoc.parseError.linepos +
":\n" + oDoc.parseError.srcText +
"\n";
for(var i = 0; i < oDoc.parseError.linepos;i++){
Sarissa.setXpathNamespaces = function(oDoc, sNsSet) {
oDoc.setProperty("SelectionLanguage", "XPath");
oDoc.setProperty("SelectionNamespaces", sNsSet);
- };
+ };
/**
- * Basic implementation of Mozilla's XSLTProcessor for IE.
+ * Basic implementation of Mozilla's XSLTProcessor for IE.
* Reuses the same XSLT stylesheet for multiple transforms
* @constructor
*/
*/
XSLTProcessor.prototype.importStylesheet = function(xslDoc){
// convert stylesheet to free threaded
- var converted = new ActiveXObject(_SARISSA_THREADEDDOM_PROGID);
+ var converted = new ActiveXObject(_SARISSA_THREADEDDOM_PROGID);
converted.loadXML(xslDoc.xml);
this.template.stylesheet = converted;
this.processor = this.template.createProcessor();
XSLTProcessor.prototype.transformToDocument = function(sourceDoc){
this.processor.input = sourceDoc;
var outDoc = new ActiveXObject(_SARISSA_DOM_PROGID);
- this.processor.output = outDoc;
+ this.processor.output = outDoc;
this.processor.transform();
return outDoc;
};
};
return oDoc;
};
-
-
+
+
}//if(window.XMLDocument)
else if(document.implementation && document.implementation.hasFeature && document.implementation.hasFeature('LS', '3.0')){
Document.prototype.async = true;
var parser = document.implementation.createLSParser(this.async ? document.implementation.MODE_ASYNCHRONOUS : document.implementation.MODE_SYNCHRONOUS, null);
if(this.async){
var self = this;
- parser.addEventListener("load",
- function(e) {
+ parser.addEventListener("load",
+ function(e) {
self.readyState = 4;
Sarissa.copyChildNodes(e.newDocument, self.documentElement, false);
- self.onreadystatechange.call();
- },
- false);
+ self.onreadystatechange.call();
+ },
+ false);
};
try {
var oDoc = parser.parseURI(sURI);
*/
Sarissa.getDomDocument = function(sUri, sName){
return document.implementation.createDocument(sUri?sUri:"", sName?sName:"", null);
- };
+ };
};
};//if(_SARISSA_HAS_DOM_CREATE_DOCUMENT)
};
DOMParser = function() {
};
if(_SARISSA_IS_SAFARI){
- /**
+ /**
* Construct a new DOM Document from the given XMLstring
* @param sXml the given XML string
- * @param contentType the content type of the document the given string represents (one of text/xml, application/xml, application/xhtml+xml).
+ * @param contentType the content type of the document the given string represents (one of text/xml, application/xml, application/xhtml+xml).
* @return a new DOM Document from the given XML string
*/
DOMParser.prototype.parseFromString = function(sXml, contentType){
};
/**
* <p> Copies the childNodes of nodeFrom to nodeTo</p>
- * <p> <b>Note:</b> The second object's original content is deleted before
+ * <p> <b>Note:</b> The second object's original content is deleted before
* the copy operation, unless you supply a true third parameter</p>
* @argument nodeFrom the Node to copy the childNodes from
* @argument nodeTo the Node to copy the childNodes to
/**
* <p> Moves the childNodes of nodeFrom to nodeTo</p>
- * <p> <b>Note:</b> The second object's original content is deleted before
+ * <p> <b>Note:</b> The second object's original content is deleted before
* the move operation, unless you supply a true third parameter</p>
* @argument nodeFrom the Node to copy the childNodes from
* @argument nodeTo the Node to copy the childNodes to
* @argument bPreserveExisting whether to preserve the original content of nodeTo, default is
- */
+ */
Sarissa.moveChildNodes = function(nodeFrom, nodeTo, bPreserveExisting) {
if((!nodeFrom) || (!nodeTo)){
throw "Both source and destination nodes must be provided";
};
};
-/**
+/**
* <p>Serialize any object to an XML string. All properties are serialized using the property name
- * as the XML element name. Array elements are rendered as <code>array-item</code> elements,
+ * as the XML element name. Array elements are rendered as <code>array-item</code> elements,
* using their index/key as the value of the <code>key</code> attribute.</p>
* @argument anyObject the object to serialize
* @argument objectName a name for that object
indentSpace = indentSpace?indentSpace:'';
var s = indentSpace + '<' + objectName + '>';
var isLeaf = false;
- if(!(anyObject instanceof Object) || anyObject instanceof Number || anyObject instanceof String
+ if(!(anyObject instanceof Object) || anyObject instanceof Number || anyObject instanceof String
|| anyObject instanceof Boolean || anyObject instanceof Date){
s += Sarissa.escape(""+anyObject);
isLeaf = true;
return s += (objectName.indexOf(' ')!=-1?"</array-item>\n":"</" + objectName + ">\n");
};
-/**
+/**
* Escape the given string chacters that correspond to the five predefined XML entities
* @param sXml the string to escape
*/
.replace(/'/g, "'");
};
-/**
- * Unescape the given string. This turns the occurences of the predefined XML
+/**
+ * Unescape the given string. This turns the occurences of the predefined XML
* entities to become the characters they represent correspond to the five predefined XML entities
* @param sXml the string to unescape
*/
.replace(/</g,"<")
.replace(/&/g,"&");
};
-//
\ No newline at end of file
+//
\ No newline at end of file
background-color: #EEEEEE;
}
span.arrow {
- font-family: Arial, Helvetica, Courier, sans-serif;
+ font-family: Arial, Helvetica, Courier, sans-serif;
}
p.arrow_button input {
- font-family: Arial, Helvetica, Courier, sans-serif;
+ font-family: Arial, Helvetica, Courier, sans-serif;
}
img.resize {
width: 1em;
background-color: #EEEEEE;
border-width: 1px;
border-style: solid;
- border-color: #FFFFFF #DDDDDD #DDDDDD #FFFFFF;
+ border-color: #FFFFFF #DDDDDD #DDDDDD #FFFFFF;
}
body#grade-index .grades td {
border-color: #FFFFFF;
.highlight2 {
color: #AA0000;
}
-.headingblock,
+.headingblock,
h2.headingblock {
margin: 0 0 10px;
padding: 11px 5px 7px;
background-color: #e4e4e4;
border-style: none;
}
-body#site-index .headingblock,
+body#site-index .headingblock,
body#course-view .headingblock {
margin-top: -1px;
}
table.generalbox {
border-style: none;
}
-th.header,
+th.header,
td.cell {
border-bottom: 1px solid #EEE;
text-align: left;
}
-table.generalbox th,
+table.generalbox th,
table.generalbox td {
border-bottom: 1px solid #EEE;
text-align: left;
margin-top: 10px;
}
.admin th.header.c0 {
-
+
}
.rolecap .rolecapheading {
background-color: #FAFAFA;
background-color: #EEE;
padding: 1px;
}
-#left-column .sideblock .header,
+#left-column .sideblock .header,
#left-column .sideblock h2.header {
background-color: #da5a23;
}
-#right-column .sideblock .header,
+#right-column .sideblock .header,
#right-column .sideblock h2.header {
background-color: #4b95ed;
}
#course-view .subscribelink {
padding: 0 5px;
}
-.weeks-format #left-column,
-.weeks-format #right-column,
-.topics-format #left-column,
+.weeks-format #left-column,
+.weeks-format #right-column,
+.topics-format #left-column,
.topics-format #right-column {
width: 15.5em;
}
border-style: none;
border-top: 1px solid #EEE;
}
-.glossarypost div.concept h3,
+.glossarypost div.concept h3,
.glossarypost.continuous .concept {
display: inline;
}
border-color: #DDD;
}
.que .incorrect {
-
+
}
.que.multianswer .incorrect {
background-color: #faa;
-<?PHP // $Id$
+<?php
////////////////////////////////////////////////////////////////////////////////
-/// This file contains a few configuration variables that control
+/// This file contains a few configuration variables that control
/// how Moodle uses this theme.
////////////////////////////////////////////////////////////////////////////////
$THEME->sheets = array('reset', 'colors');
-/// This variable is an array containing the names of all the
+/// This variable is an array containing the names of all the
/// stylesheet files you want included in this theme, and in what order
////////////////////////////////////////////////////////////////////////////////
$THEME->standardsheets = array('styles_layout');
/// This variable can be set to an array containing
-/// filenames from the *STANDARD* theme. If the
-/// array exists, it will be used to choose the
+/// filenames from the *STANDARD* theme. If the
+/// array exists, it will be used to choose the
/// files to include in the standard style sheet.
/// When false, then no files are used.
/// When true or NON-EXISTENT, then ALL standard files are used.
-/// This parameter can be used, for example, to prevent
+/// This parameter can be used, for example, to prevent
/// having to override too many classes.
/// Note that the trailing .css should not be included
/// eg $THEME->standardsheets = array('styles_layout','styles_fonts','styles_color');
////////////////////////////////////////////////////////////////////////////////
-$THEME->parent = '';
+$THEME->parent = '';
/// This variable can be set to the name of a parent theme
/// which you want to have included before the current theme.
-/// This can make it easy to make modifications to another
+/// This can make it easy to make modifications to another
/// theme without having to actually change the files
-/// If this variable is empty or false then a parent theme
+/// If this variable is empty or false then a parent theme
/// is not used.
////////////////////////////////////////////////////////////////////////////////
-$THEME->parentsheets = false;
+$THEME->parentsheets = false;
/// This variable can be set to an array containing
-/// filenames from a chosen *PARENT* theme. If the
-/// array exists, it will be used to choose the
+/// filenames from a chosen *PARENT* theme. If the
+/// array exists, it will be used to choose the
/// files to include in the standard style sheet.
/// When false, then no files are used.
/// When true or NON-EXISTENT, then ALL standard files are used.
-/// This parameter can be used, for example, to prevent
+/// This parameter can be used, for example, to prevent
/// having to override too many classes.
/// Note that the trailing .css should not be included
/// eg $THEME->parentsheets = array('styles_layout','styles_fonts','styles_color');
$THEME->metainclude = true;
-/// When this is enabled (or not set!) then Moodle will try
-/// to include a file meta.php from this theme into the
+/// When this is enabled (or not set!) then Moodle will try
+/// to include a file meta.php from this theme into the
/// <head></head> part of the page.
$THEME->standardmetainclude = true;
-/// When this is enabled (or not set!) then Moodle will try
-/// to include a file meta.php from the standard theme into the
+/// When this is enabled (or not set!) then Moodle will try
+/// to include a file meta.php from the standard theme into the
/// <head></head> part of the page.
$THEME->parentmetainclude = false;
-/// When this is enabled (or not set!) then Moodle will try
-/// to include a file meta.php from the parent theme into the
+/// When this is enabled (or not set!) then Moodle will try
+/// to include a file meta.php from the parent theme into the
/// <head></head> part of the page.
$THEME->navmenuwidth = 50;
-/// You can use this to control the cutoff point for strings
+/// You can use this to control the cutoff point for strings
/// in the navmenus (list of activities in popup menu etc)
/// Default is 50 characters wide.
/// By setting this to true, then you will have access to a
/// new variable in your header.html and footer.html called
-/// $navmenulist ... this contains a simple XHTML menu of
-/// all activities in the current course, mostly useful for
+/// $navmenulist ... this contains a simple XHTML menu of
+/// all activities in the current course, mostly useful for
/// creating popup navigation menus and so on.
-$THEME->resource_mp3player_colors =
+$THEME->resource_mp3player_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'font=Arial&fontColour=3333FF&buffer=10&waitForPlay=no&autoPlay=yes';
-/// With this you can control the colours of the "big" MP3 player
+/// With this you can control the colours of the "big" MP3 player
/// that is used for MP3 resources.
-$THEME->filter_mediaplugin_colors =
+$THEME->filter_mediaplugin_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'waitForPlay=yes';
$THEME->custompix = true;
-/// If true, then this theme must have a "pix"
-/// subdirectory that contains copies of all
+/// If true, then this theme must have a "pix"
+/// subdirectory that contains copies of all
/// files from the moodle/pix directory, plus a
-/// "pix/mod" directory containing all the icons
+/// "pix/mod" directory containing all the icons
/// for all the activity modules.
////////////////////////////////////////////////////////////////////////////////
-?>
+
-<?php
+<?php
echo $OUTPUT->container_end(); // content container
echo $OUTPUT->container_start('clearfix footer');
$useridarray = array(2, 3 // MD
);
-
+
if (!empty($performanceinfo) && isloggedin() && in_array($USER->id, $useridarray)) {
echo $performanceinfo;
}
-
+
echo $OUTPUT->container_end();
?>
</div>
#header-home hr {
display: none;
}
-.headermain,
+.headermain,
h1.headermain {
margin: 10px 0 0 10px;
}
.sideblock a {
color: #eee;
}
-.sideblock .header,
+.sideblock .header,
.sideblock h2.header {
padding: 5px;
border-style: none;
width: 100%;
}
-#left-column .sideblock .header,
+#left-column .sideblock .header,
#left-column .sideblock h2.header {
background-color: #da5a23;
}
-#right-column .sideblock .header,
+#right-column .sideblock .header,
#right-column .sideblock h2.header {
background-color: #4b95ed;
}
</head>
<body<?php echo " $bodytags"; ?>>
-
+
<div id="page">
-
-<?php if ($home) { // This is what gets printed on the home page only
+
+<?php if ($home) { // This is what gets printed on the home page only
?>
<?php echo $OUTPUT->container_start('clearfix header-home'); ?>
<h1 class="headermain"><?php echo $heading ?></h1>
<div class="headermenu"><?php echo $menu ?></div>
<?php echo $OUTPUT->container_end(); ?>
<div class="navbar clearfix">
-
+
</div>
-<?php } else if ($heading) { // This is what gets printed on any other page with a heading
+<?php } else if ($heading) { // This is what gets printed on any other page with a heading
?>
<?php echo $OUTPUT->container_start('clearfix header'); ?>
<h1 class="headermain"><?php echo $heading ?></h1>
/**
* CSSClass.js: utilities for manipulating the CSS class of an HTML element.
- *
+ *
* This module defines a single global symbol named CSSClass. This object
* contains utility functions for working with the class attribute (className
* property) of HTML elements. All functions take two arguments: the element
<script type="text/javascript" charset="utf-8">
/* <![CDATA[ */
var CSSClass={};CSSClass.is=function(e,c){if(typeof e=="string")e=document.getElementById(e);var classes=e.className;if(!classes)return false;if(classes==c)return true;return e.className.search("\\b"+c+"\\b")!=-1;};CSSClass.add=function(e,c){if(typeof e=="string")e=document.getElementById(e);if(CSSClass.is(e,c))return;if(e.className)c=" "+c;e.className+=c;};CSSClass.remove=function(e,c){if(typeof e=="string")e=document.getElementById(e);e.className=e.className.replace(new RegExp("\\b"+c+"\\b\\s*","g"),"");};
-
+
var jsscript = {
-
+
corrections: function () {
if (top.user) {
top.document.getElementsByTagName('frameset')[0].rows = "117,30%,0,200";
}
-
+
// check for layouttabel and add haslayouttable class to body
function setbodytag () {
var bd = document.getElementsByTagName('body')[0];
setTimeout(function() { setbodytag() }, 10);
}
};
-
+
setbodytag();
},
-
+
init: function() {
jsscript.corrections();
}
};
-
+
jsscript.init();
/* ]]> */
</script>
\ No newline at end of file
icon.gif: a 16x16 icon for the module\r
\r
db/mysql.sql: an SQL dump of all the required db tables and data\r
- \r
+\r
index.php: a page to list all instances in a course\r
\r
view.php: a page to view a particular instance\r
\r
\r
If you are a developer and interested in developing new Modules see:\r
- \r
+\r
Moodle Documentation: http://moodle.org/doc\r
Moodle Community: http://moodle.org/community\r
-<?PHP // $Id$
+<?php
////////////////////////////////////////////////////////////////////////////////
-/// This file contains a few configuration variables that control
+/// This file contains a few configuration variables that control
/// how Moodle uses this theme.
////////////////////////////////////////////////////////////////////////////////
$THEME->sheets = array('cornflower');
-/// This variable is an array containing the names of all the
+/// This variable is an array containing the names of all the
/// stylesheet files you want included in this theme, and in what order
////////////////////////////////////////////////////////////////////////////////
-$THEME->standardsheets = true;
+$THEME->standardsheets = true;
/// This variable can be set to an array containing
-/// filenames from the *STANDARD* theme. If the
-/// array exists, it will be used to choose the
+/// filenames from the *STANDARD* theme. If the
+/// array exists, it will be used to choose the
/// files to include in the standard style sheet.
/// When false, then no files are used.
/// When true or NON-EXISTENT, then ALL standard files are used.
-/// This parameter can be used, for example, to prevent
+/// This parameter can be used, for example, to prevent
/// having to override too many classes.
/// Note that the trailing .css should not be included
/// eg $THEME->standardsheets = array('styles_layout','styles_fonts','styles_color');
////////////////////////////////////////////////////////////////////////////////
-$THEME->parent = '';
+$THEME->parent = '';
/// This variable can be set to the name of a parent theme
/// which you want to have included before the current theme.
-/// This can make it easy to make modifications to another
+/// This can make it easy to make modifications to another
/// theme without having to actually change the files
-/// If this variable is empty or false then a parent theme
+/// If this variable is empty or false then a parent theme
/// is not used.
////////////////////////////////////////////////////////////////////////////////
-$THEME->parentsheets = false;
+$THEME->parentsheets = false;
/// This variable can be set to an array containing
-/// filenames from a chosen *PARENT* theme. If the
-/// array exists, it will be used to choose the
+/// filenames from a chosen *PARENT* theme. If the
+/// array exists, it will be used to choose the
/// files to include in the standard style sheet.
/// When false, then no files are used.
/// When true or NON-EXISTENT, then ALL standard files are used.
-/// This parameter can be used, for example, to prevent
+/// This parameter can be used, for example, to prevent
/// having to override too many classes.
/// Note that the trailing .css should not be included
/// eg $THEME->parentsheets = array('styles_layout','styles_fonts','styles_color');
$THEME->navmenuwidth = 50;
-/// You can use this to control the cutoff point for strings
+/// You can use this to control the cutoff point for strings
/// in the navmenus (list of activities in popup menu etc)
/// Default is 50 characters wide.
/// By setting this to true, then you will have access to a
/// new variable in your header.html and footer.html called
-/// $navmenulist ... this contains a simple XHTML menu of
-/// all activities in the current course, mostly useful for
+/// $navmenulist ... this contains a simple XHTML menu of
+/// all activities in the current course, mostly useful for
/// creating popup navigation menus and so on.
-$THEME->resource_mp3player_colors =
+$THEME->resource_mp3player_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'font=Arial&fontColour=3333FF&buffer=10&waitForPlay=no&autoPlay=yes';
-/// With this you can control the colours of the "big" MP3 player
+/// With this you can control the colours of the "big" MP3 player
/// that is used for MP3 resources.
-$THEME->filter_mediaplugin_colors =
+$THEME->filter_mediaplugin_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'waitForPlay=yes';
$THEME->custompix = false;
-/// If true, then this theme must have a "pix"
-/// subdirectory that contains copies of all
+/// If true, then this theme must have a "pix"
+/// subdirectory that contains copies of all
/// files from the moodle/pix directory, plus a
-/// "pix/mod" directory containing all the icons
+/// "pix/mod" directory containing all the icons
/// for all the activity modules.
////////////////////////////////////////////////////////////////////////////////
-?>
\ No newline at end of file
/*******************************************************************
Cornflower CSS
-
- This CSS file contains all color and layout definitions
+
+ This CSS file contains all color and layout definitions
for the Cornflower theme.
-
+
This theme requires the Standard theme to be present.
-
+
*******************************************************************/
/***
a:hover {
color:#054377;
text-decoration:underline;
-
+
}
body {
.navbar {
background-color:#D0E2EE;
border-color:#D0E2EE;
-
+
}
.generalbox {
- border-color:#739FC4;
+ border-color:#739FC4;
}
.informationbox {
- border-color:#739FC4;
+ border-color:#739FC4;
}
.feedbackbox {
- border-color: #739FC4;
+ border-color: #739FC4;
}
.noticebox {
- border-color:#739FC4;
+ border-color:#739FC4;
}
.errorbox {
.unread {
background: #78A2CD;
-}
+}
/***
*** Header
.headermain {
background: transparent url(images/hdbgend.jpg) 100% 0 no-repeat;
float: none;
-
+
}
***/
.admin .generalboxcontent {
- background-color:#EEEEEE;
+ background-color:#EEEEEE;
}
.admin .generalbox {
- border-color:#739FC4;
+ border-color:#739FC4;
}
.admin .informationbox {
- border-color:#739FC4;
- background-color:#FFFFFF;
+ border-color:#739FC4;
+ background-color:#FFFFFF;
}
***/
.userpicture {
- background:#EEEEEE;
+ background:#EEEEEE;
}
.userinfobox {
}
.forumpost .left {
- background:#739FC4;
+ background:#739FC4;
}
.forumpost .topic {
border-bottom-color: #739FC4;
- background:#D0E2EE;
+ background:#D0E2EE;
}
.forumpost .starter {
- background:#739FC4;
+ background:#739FC4;
}
.forumheaderlist .discussion .starter {
- background:#D0E2EE;
+ background:#D0E2EE;
}
.forumheaderlist td {
}
#mod-forum-discuss .unread .forumpost .message {
- border-color: #78A2CD;
-}
+ border-color: #78A2CD;
+}
#mod-forum-discuss .forumthread .unread {
-}
+}
#mod-forum-index .unread {
}
padding-right:10px;
}
-div.headermenu
+div.headermenu
{
position: absolute;
top: 15px;
-<?php // $Id$
+<?php
////////////////////////////////////////////////////////////////////////////////
/// This file contains a few configuration variables that control
/// how Moodle uses this theme.
<?php echo $OUTPUT->container_end(); ?><!-- end container Content -->
<!-- START OF FOOTER -->
-<?php
+<?php
-global $CFG, $COURSE;
+global $CFG, $COURSE;
if (function_exists('is_in_popup')) {
$inpopup = is_in_popup();
} else {
$inpopup = false;
}
-if (!$inpopup) {
+if (!$inpopup) {
echo $OUTPUT->container_start('footer');
-
+
echo '<p class="helplink">';
echo page_doc_link(get_string('moodledocslink'));
echo '</p>';
-
+
echo $loggedinas;
echo $homelink;
$useridarray = array(2 // MD
);
-
+
if (!empty($performanceinfo) && isloggedin() && in_array($USER->id, $useridarray)) {
echo $performanceinfo;
}
<title><?php echo $title ?></title>
<link rel="shortcut icon" href="<?php echo $CFG->httpsthemewww .'/'. current_theme() ?>/favicon.ico" />
- <?php
+ <?php
include("$CFG->javascript");
include($CFG->themedir.'/custom_corners/js/js.php');
-
+
// check if page is opened within a popup window
if (function_exists('is_in_popup')) {
$inpopup = is_in_popup();
} else {
$inpopup = false;
}
-
+
// get class list
preg_match('/class="([^"]*)"/i', $bodytags, $classes);
$classlist = explode (' ', $classes[1]);
-
-
+
+
// add "inpopup" or "notinpopup" to class list
if ($inpopup) {
array_push($classlist, 'inpopup');
} else {
array_push($classlist, 'notinpopup');
}
-
+
//replace classlist with new one
$bodytags = str_replace($classes[0], 'class="'.implode(' ', $classlist).'"', $bodytags);
?>
<?php } ?>
<div id="page">
-<?php if (!$inpopup) {
+<?php if (!$inpopup) {
if ($home) { // This is what gets printed on the home page only
?>
<?php echo $OUTPUT->container_start('clearfix header-home'); ?>
/**
* CSSClass.js: utilities for manipulating the CSS class of an HTML element.
- *
+ *
* This module defines a single global symbol named CSSClass. This object
* contains utility functions for working with the class attribute (className
* property) of HTML elements. All functions take two arguments: the element
<script type="text/javascript" charset="utf-8">
/* <![CDATA[ */
var CSSClass={};CSSClass.is=function(e,c){if(typeof e=="string")e=document.getElementById(e);var classes=e.className;if(!classes)return false;if(classes==c)return true;return e.className.search("\\b"+c+"\\b")!=-1;};CSSClass.add=function(e,c){if(typeof e=="string")e=document.getElementById(e);if(CSSClass.is(e,c))return;if(e.className)c=" "+c;e.className+=c;};CSSClass.remove=function(e,c){if(typeof e=="string")e=document.getElementById(e);e.className=e.className.replace(new RegExp("\\b"+c+"\\b\\s*","g"),"");};
-
+
var script = {
corrections: function () {
if (top.user) {
top.document.getElementsByTagName('frameset')[0].rows = "117,30%,0,200";
}
-
+
// check for layouttabel and add layouttable classes to body
var tagname = 'nolayouttable';
if (document.getElementById('middle-column')) {
} else if(document.getElementsByTagName('body')[0].id.substring(0,9)=='calendar-') {
tagname='haslayouttable onlyrightcolumn';
}
-
+
function setbodytag (tagname) {
var bd = document.getElementsByTagName('body')[0];
if (bd) {
setTimeout(function() { setbodytag(tagname) }, 30);
}
}
-
+
setTimeout(function() { setbodytag(tagname) }, 30);
},
-
+
init: function() {
script.corrections();
}
width: 35em;
}
form#adminsettings div.form-item {
-
+
/*background: url(pix/small_bg_gradient.png) repeat-x 0 bottom;*/
border-top: 1px solid #F1ECE6;
}
border-style: none;
}
div.htmlarea iframe {
-
+
}
div#header-home {
position: relative;
-<?PHP // $Id$
+<?php
////////////////////////////////////////////////////////////////////////////////
-/// This file contains a few configuration variables that control
+/// This file contains a few configuration variables that control
/// how Moodle uses this theme.
////////////////////////////////////////////////////////////////////////////////
$THEME->sheets = array('fw_layout','fw_color','fw_fonts');
///$THEME->sheets = false;
-/// This variable is an array containing the names of all the
+/// This variable is an array containing the names of all the
/// stylesheet files you want included in this theme, and in what order
////////////////////////////////////////////////////////////////////////////////
///$THEME->standardsheets = true;
/// This variable can be set to an array containing
-/// filenames from the *STANDARD* theme. If the
-/// array exists, it will be used to choose the
+/// filenames from the *STANDARD* theme. If the
+/// array exists, it will be used to choose the
/// files to include in the standard style sheet.
/// When false, then no files are used.
/// When true or NON-EXISTENT, then ALL standard files are used.
-/// This parameter can be used, for example, to prevent
+/// This parameter can be used, for example, to prevent
/// having to override too many classes.
/// Note that the trailing .css should not be included
/// eg $THEME->standardsheets = array('styles_layout','styles_fonts','styles_color');
////////////////////////////////////////////////////////////////////////////////
-$THEME->parent = '';
+$THEME->parent = '';
/// This variable can be set to the name of a parent theme
/// which you want to have included before the current theme.
-/// This can make it easy to make modifications to another
+/// This can make it easy to make modifications to another
/// theme without having to actually change the files
-/// If this variable is empty or false then a parent theme
+/// If this variable is empty or false then a parent theme
/// is not used.
////////////////////////////////////////////////////////////////////////////////
-$THEME->parentsheets = false;
+$THEME->parentsheets = false;
/// This variable can be set to an array containing
-/// filenames from a chosen *PARENT* theme. If the
-/// array exists, it will be used to choose the
+/// filenames from a chosen *PARENT* theme. If the
+/// array exists, it will be used to choose the
/// files to include in the standard style sheet.
/// When false, then no files are used.
/// When true or NON-EXISTENT, then ALL standard files are used.
-/// This parameter can be used, for example, to prevent
+/// This parameter can be used, for example, to prevent
/// having to override too many classes.
/// Note that the trailing .css should not be included
/// eg $THEME->parentsheets = array('styles_layout','styles_fonts','styles_color');
$THEME->metainclude = false;
-/// When this is enabled (or not set!) then Moodle will try
-/// to include a file meta.php from this theme into the
+/// When this is enabled (or not set!) then Moodle will try
+/// to include a file meta.php from this theme into the
/// <head></head> part of the page.
$THEME->standardmetainclude = true;
-/// When this is enabled (or not set!) then Moodle will try
-/// to include a file meta.php from the standard theme into the
+/// When this is enabled (or not set!) then Moodle will try
+/// to include a file meta.php from the standard theme into the
/// <head></head> part of the page.
$THEME->parentmetainclude = false;
-/// When this is enabled (or not set!) then Moodle will try
-/// to include a file meta.php from the parent theme into the
+/// When this is enabled (or not set!) then Moodle will try
+/// to include a file meta.php from the parent theme into the
/// <head></head> part of the page.
$THEME->navmenuwidth = 50;
-/// You can use this to control the cutoff point for strings
+/// You can use this to control the cutoff point for strings
/// in the navmenus (list of activities in popup menu etc)
/// Default is 50 characters wide.
/// By setting this to true, then you will have access to a
/// new variable in your header.html and footer.html called
-/// $navmenulist ... this contains a simple XHTML menu of
-/// all activities in the current course, mostly useful for
+/// $navmenulist ... this contains a simple XHTML menu of
+/// all activities in the current course, mostly useful for
/// creating popup navigation menus and so on.
-$THEME->resource_mp3player_colors =
+$THEME->resource_mp3player_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'font=Arial&fontColour=3333FF&buffer=10&waitForPlay=no&autoPlay=yes';
-/// With this you can control the colours of the "big" MP3 player
+/// With this you can control the colours of the "big" MP3 player
/// that is used for MP3 resources.
-$THEME->filter_mediaplugin_colors =
+$THEME->filter_mediaplugin_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'waitForPlay=yes';
$THEME->custompix = false;
-/// If true, then this theme must have a "pix"
-/// subdirectory that contains copies of all
+/// If true, then this theme must have a "pix"
+/// subdirectory that contains copies of all
/// files from the moodle/pix directory, plus a
-/// "pix/mod" directory containing all the icons
+/// "pix/mod" directory containing all the icons
/// for all the activity modules.
////////////////////////////////////////////////////////////////////////////////
///$CFG->block_search_button = link_arrow_right(get_string('search'), $url='', $accesshide=true);
///
/// Accessibility: Right and left arrow-like characters are
-/// used in the breadcrumb trail, course navigation menu
+/// used in the breadcrumb trail, course navigation menu
/// (previous/next activity), calendar, and search forum block.
///
/// If the theme does not set characters, appropriate defaults
/// use < > » - these are confusing for blind users.
////////////////////////////////////////////////////////////////////////////////
-?>
+
}
/* .generaltable .r0 td.cell.c0 {
- background-color:#C6BDA8;
+ background-color:#C6BDA8;
} */
.generaltable .r0 {
- background-color:#FEF9F6;
+ background-color:#FEF9F6;
}
.generaltable .r1 {
- background-color:#F1EFEB;
+ background-color:#F1EFEB;
}
.generaltable .r1 td.cell.c0 {
-border-color:#C6BDA8;
+border-color:#C6BDA8;
/* background-color:#E3DFD4; */
}
.sideblock .header, .sideblock .header h2 {
background: url(pix/grad/gradient_h.jpg) repeat-x;
- background-color:#E3DFD4;
+ background-color:#E3DFD4;
}
.sideblock hr {
/***
*** Calendar
***/
-
+
#calendar .maincalendar,
#calendar .sidecalendar,
#calendar .maincalendar .event {
table.calendarmonth tr td {
border-color:#C6BDA8;
-}
+}
table.minicalendar {
border-color:#C6BDA8;
table.minicalendar tr td.day {
border-color:#C6BDA8;
}
-
+
table.minicalendar tr td.weekend {
border-color:#C6BDA8;
color: red;
}
-
+
#calendar .today,
.minicalendar .today {
border-color:#000000 !important;
}
-
+
/* colors for calendar events */
#calendar .event_global,
.minicalendar .event_global,
}
.forumpost .left {
- background:#FEF9F6;
+ background:#FEF9F6;
}
.forumpost .topic {
}
.forumpost .starter {
- background:#FEF9F6;
+ background:#FEF9F6;
}
.forumheaderlist .discussion .starter {
- background:#FEF9F6;
+ background:#FEF9F6;
}
.forumheaderlist td {
#mod-forum-discuss .forumpost.unread .content {
/* border-color: #C6BDA8; */
-}
+}
#mod-forum-discuss .forumthread .unread {
-}
+}
#mod-forum-index .unread {
}
.entryattachment,
.entryapproval {
background-color: #E3DFD4;
- }
+ }
.entrybox {
border-color: #C6BDA8;
.glossarypost.dictionary,
.glossarypost.fullwithauthor,
.glossarypost.fullwithoutauthor,
-.glossarypost.continuous,
+.glossarypost.continuous,
.glossarypost.encyclopedia,
.glossarypost.faq {
border-color: #C6BDA8;
}
-.glossarycategoryheader h2,
+.glossarycategoryheader h2,
.glossarypost .concept h3 {
background-color: #FFFFFF
}
.errorboxcontent {
background-color:#FEF9F6;
}
-
+
/***
*** Grade
***/
.grade-report-grader table#user-grades td.cell span.gradepass {
- background-color: #C2EBBD;
+ background-color: #C2EBBD;
}
.grade-report-grader table#user-grades td.cell span.gradefail {
/***
*** Header
***/
-
+
.breadcrumb {
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size:.85em;
/***
*** Blocks
***/
-
+
.sideblock .footer {
font-size:0.85em;
text-align: left;
table.minicalendar tr td {
font-size:0.7em;
}
-
+
/***
*** Course
***/
-
+
#course-view .section .left {
font-weight: bold;
font-size: 1.2em;
h6.main {
text-align: left;
padding-left: 5px;
-}
+}
h1, h2, h3, h4 {
text-align: left;
#content {
clear:both;
}
-
+
h1, h2, h3, th.header {
border-width: 1px;
- border-style: solid;
+ border-style: solid;
}
h4 {
border-bottom-style: solid;
- border-bottom-width:1px;
+ border-bottom-width:1px;
}
input, select {
}
.generaltable {
- border-width:0px;
+ border-width:0px;
}
.generalbox {
- border-width:1px;
- border-style:solid;
+ border-width:1px;
+ border-style:solid;
}
.sitetopiccontent {
border-style:solid;
}
-.clearfix {
- min-width: 0;
- /* overflow: hidden; */
+.clearfix {
+ min-width: 0;
+ /* overflow: hidden; */
}
.clearfix:after {
/* content: "<!-- -->"; */
- content: ".";
- display: block;
- height: 0;
- clear: both;
+ content: ".";
+ display: block;
+ height: 0;
+ clear: both;
visibility: hidden;
}
/***
*** Footer
***/
-
+
#footer {
text-align:left;
margin-top: 5px;
margin-bottom: 0px;
}
-
+
#footer p.helplink {
margin-bottom: 0px;
}
.sideblock .header .hide-show-image {
padding-top: 4px;
}
-
+
.sideblock .footer {
border-top-width:1px;
border-top-style:dashed;
}
-
+
/***
*** Calendar
***/
-
+
#calendar .today,
.minicalendar .today {
border:1px solid !important;
-}
-
+}
+
table.minicalendar {
width: 100%;
margin:10px auto;
/***
*** Course
***/
-
+
.headingblock {
border-width:1px;
border-style:solid;
padding-bottom: 5px;
}
-.tabrow0 {
- padding-top: 4px;
-}
+.tabrow0 {
+ padding-top: 4px;
+}
/***
*** Modules: glossary
if ($readmeurl) {
$link = html_link::make($readmeurl, get_string('info'));
$link->add_action(new popup_action('click', $link->url, $themename));
- $infoitems['readme'] = $OUTPUT->link($link);
+ $infoitems['readme'] = $OUTPUT->link($link);
}
// Contents of the first screenshot/preview cell.
-<?PHP // $Id$
+<?php
////////////////////////////////////////////////////////////////////////////////
-/// This file contains a few configuration variables that control
+/// This file contains a few configuration variables that control
/// how Moodle uses this theme.
////////////////////////////////////////////////////////////////////////////////
$THEME->sheets = array('reset', 'lines');
-/// This variable is an array containing the names of all the
+/// This variable is an array containing the names of all the
/// stylesheet files you want included in this theme, and in what order
////////////////////////////////////////////////////////////////////////////////
$THEME->standardsheets = array('styles_layout','styles_color');
/// This variable can be set to an array containing
-/// filenames from the *STANDARD* theme. If the
-/// array exists, it will be used to choose the
+/// filenames from the *STANDARD* theme. If the
+/// array exists, it will be used to choose the
/// files to include in the standard style sheet.
/// When false, then no files are used.
/// When true or NON-EXISTENT, then ALL standard files are used.
-/// This parameter can be used, for example, to prevent
+/// This parameter can be used, for example, to prevent
/// having to override too many classes.
/// Note that the trailing .css should not be included
/// eg $THEME->standardsheets = array('styles_layout','styles_fonts','styles_color');
////////////////////////////////////////////////////////////////////////////////
-$THEME->parent = '';
+$THEME->parent = '';
/// This variable can be set to the name of a parent theme
/// which you want to have included before the current theme.
-/// This can make it easy to make modifications to another
+/// This can make it easy to make modifications to another
/// theme without having to actually change the files
-/// If this variable is empty or false then a parent theme
+/// If this variable is empty or false then a parent theme
/// is not used.
////////////////////////////////////////////////////////////////////////////////
-$THEME->parentsheets = false;
+$THEME->parentsheets = false;
/// This variable can be set to an array containing
-/// filenames from a chosen *PARENT* theme. If the
-/// array exists, it will be used to choose the
+/// filenames from a chosen *PARENT* theme. If the
+/// array exists, it will be used to choose the
/// files to include in the standard style sheet.
/// When false, then no files are used.
/// When true or NON-EXISTENT, then ALL standard files are used.
-/// This parameter can be used, for example, to prevent
+/// This parameter can be used, for example, to prevent
/// having to override too many classes.
/// Note that the trailing .css should not be included
/// eg $THEME->parentsheets = array('styles_layout','styles_fonts','styles_color');
$THEME->metainclude = true;
-/// When this is enabled (or not set!) then Moodle will try
-/// to include a file meta.php from this theme into the
+/// When this is enabled (or not set!) then Moodle will try
+/// to include a file meta.php from this theme into the
/// <head></head> part of the page.
$THEME->standardmetainclude = true;
-/// When this is enabled (or not set!) then Moodle will try
-/// to include a file meta.php from the standard theme into the
+/// When this is enabled (or not set!) then Moodle will try
+/// to include a file meta.php from the standard theme into the
/// <head></head> part of the page.
$THEME->parentmetainclude = false;
-/// When this is enabled (or not set!) then Moodle will try
-/// to include a file meta.php from the parent theme into the
+/// When this is enabled (or not set!) then Moodle will try
+/// to include a file meta.php from the parent theme into the
/// <head></head> part of the page.
$THEME->navmenuwidth = 50;
-/// You can use this to control the cutoff point for strings
+/// You can use this to control the cutoff point for strings
/// in the navmenus (list of activities in popup menu etc)
/// Default is 50 characters wide.
/// By setting this to true, then you will have access to a
/// new variable in your header.html and footer.html called
-/// $navmenulist ... this contains a simple XHTML menu of
-/// all activities in the current course, mostly useful for
+/// $navmenulist ... this contains a simple XHTML menu of
+/// all activities in the current course, mostly useful for
/// creating popup navigation menus and so on.
-$THEME->resource_mp3player_colors =
+$THEME->resource_mp3player_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'font=Arial&fontColour=3333FF&buffer=10&waitForPlay=no&autoPlay=yes';
-/// With this you can control the colours of the "big" MP3 player
+/// With this you can control the colours of the "big" MP3 player
/// that is used for MP3 resources.
-$THEME->filter_mediaplugin_colors =
+$THEME->filter_mediaplugin_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'waitForPlay=yes';
$THEME->custompix = false;
-/// If true, then this theme must have a "pix"
-/// subdirectory that contains copies of all
+/// If true, then this theme must have a "pix"
+/// subdirectory that contains copies of all
/// files from the moodle/pix directory, plus a
-/// "pix/mod" directory containing all the icons
+/// "pix/mod" directory containing all the icons
/// for all the activity modules.
////////////////////////////////////////////////////////////////////////////////
-?>
+
-<?php
+<?php
echo $OUTPUT->container_end(); // content container
echo $OUTPUT->container_start('clearfix footer');
$useridarray = array(2, 3 // MD
);
-
+
if (!empty($performanceinfo) && isloggedin() && in_array($USER->id, $useridarray)) {
echo $performanceinfo;
}
-
+
echo $OUTPUT->container_end();
?>
</div>
</head>
<body<?php echo " $bodytags"; ?>>
-
+
<div id="page">
-
-<?php if ($home) { // This is what gets printed on the home page only
+
+<?php if ($home) { // This is what gets printed on the home page only
?>
<?php echo $OUTPUT->container_start('clearfix header-home'); ?>
<h1 class="headermain"><?php echo $heading ?></h1>
<div class="headermenu"><?php echo $menu ?></div>
<?php echo $OUTPUT->container_end(); ?>
<div class="navbar clearfix">
-
+
</div>
-<?php } else if ($heading) { // This is what gets printed on any other page with a heading
+<?php } else if ($heading) { // This is what gets printed on any other page with a heading
?>
<?php echo $OUTPUT->container_start('clearfix header'); ?>
<h1 class="headermain"><?php echo $heading ?></h1>
/**
* CSSClass.js: utilities for manipulating the CSS class of an HTML element.
- *
+ *
* This module defines a single global symbol named CSSClass. This object
* contains utility functions for working with the class attribute (className
* property) of HTML elements. All functions take two arguments: the element
<script type="text/javascript" charset="utf-8">
/* <![CDATA[ */
var CSSClass={};CSSClass.is=function(e,c){if(typeof e=="string")e=document.getElementById(e);var classes=e.className;if(!classes)return false;if(classes==c)return true;return e.className.search("\\b"+c+"\\b")!=-1;};CSSClass.add=function(e,c){if(typeof e=="string")e=document.getElementById(e);if(CSSClass.is(e,c))return;if(e.className)c=" "+c;e.className+=c;};CSSClass.remove=function(e,c){if(typeof e=="string")e=document.getElementById(e);e.className=e.className.replace(new RegExp("\\b"+c+"\\b\\s*","g"),"");};
-
+
var jsscript = {
-
+
corrections: function () {
if (top.user) {
top.document.getElementsByTagName('frameset')[0].rows = "117,30%,0,200";
}
-
+
// check for layouttabel and add haslayouttable class to body
function setbodytag () {
var bd = document.getElementsByTagName('body')[0];
setTimeout(function() { setbodytag() }, 10);
}
};
-
+
setbodytag();
},
-
+
init: function() {
jsscript.corrections();
}
};
-
+
jsscript.init();
// setTimeout(function() { jsscript.init() }, 10);
/* ]]> */
YAHOO.util.Dom.setStyle(formsets[j], 'border-bottom-color', col);
}
}
-
+
// var check = document.getElementById('admin-settings');
if (document.getElementById('admin-settings') || document.getElementById('admin-search')) {
var check = 1;
- }
+ }
// console.log("page: " + check);
if (!check) return;
padding-top: 0;
font-size: 100%;
}
-#site-index .headingblock,
+#site-index .headingblock,
#course-view .headingblock {
margin-bottom: 0;
}
table.generalbox {
border-style: none;
}
-th.header,
+th.header,
td.cell {
border-bottom: 1px solid #EEE;
text-align: left;
}
-.generalbox th,
+.generalbox th,
.generalbox td {
border-bottom: 1px solid #EEE;
text-align: left;
margin-top: 10px;
}
.admin .header.c0 {
-
+
}
.rolecap .rolecapheading {
background-color: #FAFAFA;
.haslayouttable div#content {
margin: 0;
}
-.weeks-format #left-column,
-.weeks-format #right-column,
-.topics-format #left-column,
+.weeks-format #left-column,
+.weeks-format #right-column,
+.topics-format #left-column,
.topics-format #right-column {
width: 15.5em;
}
margin-bottom: 2em;
}
#course-view .weeks .content ,
-#course-view .topics .content,
+#course-view .topics .content,
#course-view .weeks .section,
#course-view .topics .section {
background-color: #FFF;
.cal_popup_fg div a {
font-size: 100% !important;
}
-.block_calendar_month .cal_popup_caption,
+.block_calendar_month .cal_popup_caption,
.block_calendar_month .cal_popup_fg div {
border-color: #9B9984;
font-size: 100% !important;
border-style: none;
border-top: 1px solid #EEE;
}
-.glossarypost .concept h3,
+.glossarypost .concept h3,
.glossarypost.continuous .concept {
display: inline;
}
border-color: #DDD;
}
.que .incorrect {
-
+
}
.que.multianswer .incorrect {
background-color: #faa;
This theme is designed by A. Chavan (chavan at users.sourceforge.net).
-It is based on moodle's "standardwhite" theme.
+It is based on moodle's "standardwhite" theme.
It uses the background image from, and is inspired by:
http://www.alexking.org/software/wordpress/styles/sample.php?wpstyle=metaldreams
/*******************************************************************
styles_color.css
-
- This CSS file contains all color definitions like
+
+ This CSS file contains all color definitions like
background-color, font-color, border-color etc.
Styles are organised into the following sections:
}
/* Alternate rows even */
-.r0 {
+.r0 {
}
/* Alternate rows odd */
-.r1 {
+.r1 {
}
/* notification messages (can be good or bad) */
}
.generalbox {
- border-color:#999999;
+ border-color:#999999;
}
.informationbox {
- border-color:#999999;
+ border-color:#999999;
}
.feedbackbox {
- border-color: #999999;
+ border-color: #999999;
}
.feedbackby {
background-color:#BBBBBB;
}
.noticebox {
- border-color:#999999;
+ border-color:#999999;
}
.errorbox {
.unread {
background: #FFD991;
-}
+}
.censoredtext {
color:#000000;
***/
.generalboxcontent {
- background-color:#EEEEEE;
+ background-color:#EEEEEE;
}
.admin .generalbox {
- border-color:#999999;
+ border-color:#999999;
}
.admin .informationbox {
- border-color:#999999;
- background-color:#FFFFFF;
+ border-color:#999999;
+ background-color:#FFFFFF;
}
body#admin-index .c0 {
***/
.userpicture {
- background:#EEEEEE;
+ background:#EEEEEE;
}
.userinfobox {
.assignmentnew .assignmentfeedback{
background-color:#DDDDDD;
-}
-
+}
+
.assignmentold .assignmentfeedback{
background-color:#BBBBBB;
}
}
.forumpost .left {
- background:#EEEEEE;
+ background:#EEEEEE;
}
.forumpost .topic {
}
.forumpost .starter {
- background:#DDDDDD;
+ background:#DDDDDD;
}
.forumheaderlist .discussion .starter {
- background:#DDDDDD;
+ background:#DDDDDD;
}
.forumheaderlist td {
#mod-forum-discuss .forumpost.unread .content {
border-width:3px;
-/* border-color: #FFD991; */
-}
+/* border-color: #FFD991; */
+}
#mod-forum-discuss .forumthread .unread {
-}
+}
#mod-forum-index .unread {
}
-<?PHP // $Id$
+<?php
////////////////////////////////////////////////////////////////////////////////
-/// This file contains a few configuration variables that control
+/// This file contains a few configuration variables that control
/// how Moodle uses this theme.
////////////////////////////////////////////////////////////////////////////////
$THEME->sheets = array('gradients', 'colors', 'fonts');
-/// This variable is an array containing the names of all the
+/// This variable is an array containing the names of all the
/// stylesheet files you want included in this theme, and in what order
////////////////////////////////////////////////////////////////////////////////
-$THEME->standardsheets = array('styles_layout','styles_fonts','styles_color');
+$THEME->standardsheets = array('styles_layout','styles_fonts','styles_color');
/// This variable can be set to an array containing
-/// filenames from the *STANDARD* theme. If the
-/// array exists, it will be used to choose the
+/// filenames from the *STANDARD* theme. If the
+/// array exists, it will be used to choose the
/// files to include in the standard style sheet.
/// When false, then no files are used.
/// When true or NON-EXISTENT, then ALL standard files are used.
-/// This parameter can be used, for example, to prevent
+/// This parameter can be used, for example, to prevent
/// having to override too many classes.
/// Note that the trailing .css should not be included
/// eg $THEME->standardsheets = array('styles_layout','styles_fonts','styles_color');
////////////////////////////////////////////////////////////////////////////////
-$THEME->parent = '';
+$THEME->parent = '';
/// This variable can be set to the name of a parent theme
/// which you want to have included before the current theme.
-/// This can make it easy to make modifications to another
+/// This can make it easy to make modifications to another
/// theme without having to actually change the files
-/// If this variable is empty or false then a parent theme
+/// If this variable is empty or false then a parent theme
/// is not used.
////////////////////////////////////////////////////////////////////////////////
-$THEME->parentsheets = false;
+$THEME->parentsheets = false;
/// This variable can be set to an array containing
-/// filenames from a chosen *PARENT* theme. If the
-/// array exists, it will be used to choose the
+/// filenames from a chosen *PARENT* theme. If the
+/// array exists, it will be used to choose the
/// files to include in the standard style sheet.
/// When false, then no files are used.
/// When true or NON-EXISTENT, then ALL standard files are used.
-/// This parameter can be used, for example, to prevent
+/// This parameter can be used, for example, to prevent
/// having to override too many classes.
/// Note that the trailing .css should not be included
/// eg $THEME->parentsheets = array('styles_layout','styles_fonts','styles_color');
$THEME->navmenuwidth = 50;
-/// You can use this to control the cutoff point for strings
+/// You can use this to control the cutoff point for strings
/// in the navmenus (list of activities in popup menu etc)
/// Default is 50 characters wide.
-$THEME->makenavmenulist = false;
+$THEME->makenavmenulist = false;
/// By setting this to true, then you will have access to a
/// new variable in your header.html and footer.html called
-/// $navmenulist ... this contains a simple XHTML menu of
-/// all activities in the current course, mostly useful for
+/// $navmenulist ... this contains a simple XHTML menu of
+/// all activities in the current course, mostly useful for
/// creating popup navigation menus and so on.
-$THEME->resource_mp3player_colors =
+$THEME->resource_mp3player_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'font=Arial&fontColour=3333FF&buffer=10&waitForPlay=no&autoPlay=yes';
-/// With this you can control the colours of the "big" MP3 player
+/// With this you can control the colours of the "big" MP3 player
/// that is used for MP3 resources.
-$THEME->filter_mediaplugin_colors =
+$THEME->filter_mediaplugin_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'waitForPlay=yes';
$THEME->custompix = false;
-/// If true, then this theme must have a "pix"
-/// subdirectory that contains copies of all
+/// If true, then this theme must have a "pix"
+/// subdirectory that contains copies of all
/// files from the moodle/pix directory, plus a
-/// "pix/mod" directory containing all the icons
+/// "pix/mod" directory containing all the icons
/// for all the activity modules.
////////////////////////////////////////////////////////////////////////////////
-?>
+
th.header,
td.header,
-div.header {
- background-image:url(gradient.jpg);
- background-position:top;
- background-repeat:repeat-x;
+div.header {
+ background-image:url(gradient.jpg);
+ background-position:top;
+ background-repeat:repeat-x;
}
.navbar {
.breadcrumb .sep {
color:#999999;
}
-
+
-<?PHP // $Id$
+<?php
////////////////////////////////////////////////////////////////////////////////
-/// This file contains a few configuration variables that control
+/// This file contains a few configuration variables that control
/// how Moodle uses this theme.
////////////////////////////////////////////////////////////////////////////////
$THEME->sheets = array('gradients', 'styles_color');
-/// This variable is an array containing the names of all the
+/// This variable is an array containing the names of all the
/// stylesheet files you want included in this theme, and in what order
////////////////////////////////////////////////////////////////////////////////
-$THEME->standardsheets = array('styles_layout','styles_fonts','styles_color');
+$THEME->standardsheets = array('styles_layout','styles_fonts','styles_color');
/// This variable can be set to an array containing
-/// filenames from the *STANDARD* theme. If the
-/// array exists, it will be used to choose the
+/// filenames from the *STANDARD* theme. If the
+/// array exists, it will be used to choose the
/// files to include in the standard style sheet.
/// When false, then no files are used.
/// When true or NON-EXISTENT, then ALL standard files are used.
-/// This parameter can be used, for example, to prevent
+/// This parameter can be used, for example, to prevent
/// having to override too many classes.
/// Note that the trailing .css should not be included
/// eg $THEME->standardsheets = array('styles_layout','styles_fonts','styles_color');
////////////////////////////////////////////////////////////////////////////////
-$THEME->parent = '';
+$THEME->parent = '';
/// This variable can be set to the name of a parent theme
/// which you want to have included before the current theme.
-/// This can make it easy to make modifications to another
+/// This can make it easy to make modifications to another
/// theme without having to actually change the files
-/// If this variable is empty or false then a parent theme
+/// If this variable is empty or false then a parent theme
/// is not used.
////////////////////////////////////////////////////////////////////////////////
-$THEME->parentsheets = false;
+$THEME->parentsheets = false;
/// This variable can be set to an array containing
-/// filenames from a chosen *PARENT* theme. If the
-/// array exists, it will be used to choose the
+/// filenames from a chosen *PARENT* theme. If the
+/// array exists, it will be used to choose the
/// files to include in the standard style sheet.
/// When false, then no files are used.
/// When true or NON-EXISTENT, then ALL standard files are used.
-/// This parameter can be used, for example, to prevent
+/// This parameter can be used, for example, to prevent
/// having to override too many classes.
/// Note that the trailing .css should not be included
/// eg $THEME->parentsheets = array('styles_layout','styles_fonts','styles_color');
$THEME->navmenuwidth = 50;
-/// You can use this to control the cutoff point for strings
+/// You can use this to control the cutoff point for strings
/// in the navmenus (list of activities in popup menu etc)
/// Default is 50 characters wide.
/// By setting this to true, then you will have access to a
/// new variable in your header.html and footer.html called
-/// $navmenulist ... this contains a simple XHTML menu of
-/// all activities in the current course, mostly useful for
+/// $navmenulist ... this contains a simple XHTML menu of
+/// all activities in the current course, mostly useful for
/// creating popup navigation menus and so on.
-$THEME->resource_mp3player_colors =
+$THEME->resource_mp3player_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'font=Arial&fontColour=3333FF&buffer=10&waitForPlay=no&autoPlay=yes';
-/// With this you can control the colours of the "big" MP3 player
+/// With this you can control the colours of the "big" MP3 player
/// that is used for MP3 resources.
-$THEME->filter_mediaplugin_colors =
+$THEME->filter_mediaplugin_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'waitForPlay=yes';
$THEME->custompix = false;
-/// If true, then this theme must have a "pix"
-/// subdirectory that contains copies of all
+/// If true, then this theme must have a "pix"
+/// subdirectory that contains copies of all
/// files from the moodle/pix directory, plus a
-/// "pix/mod" directory containing all the icons
+/// "pix/mod" directory containing all the icons
/// for all the activity modules.
////////////////////////////////////////////////////////////////////////////////
-?>
+
}
/** inside border of unread posts in nested format in
- * mod/forum/discuss.php
+ * mod/forum/discuss.php
**/
#mod-forum-discuss .forumpost.unread .content {
border-width:2px;
border-color: #0000FF;
-}
+}
#mod-forum-discuss .forumthread .unread {
}
/** headers of unread posts in threaded format in
- * mod/forum/discuss.php
+ * mod/forum/discuss.php
**/
#mod-forum-discuss .forumthread.unread {
- background: #FFFF6B;
+ background: #FFFF6B;
}
#mod-forum-index .unread {
/** unread column background on
- * mod/forum/view.php
+ * mod/forum/view.php
**/
#mod-forum-view .unread{
background: #FFFF6B;
-<?PHP // $Id$
+<?php
////////////////////////////////////////////////////////////////////////////////
-/// This file contains a few configuration variables that control
+/// This file contains a few configuration variables that control
/// how Moodle uses this theme.
////////////////////////////////////////////////////////////////////////////////
$THEME->sheets = array('styles_layout', 'styles_fonts', 'styles_color', 'styles_tabs');
-/// This variable is an array containing the names of all the
+/// This variable is an array containing the names of all the
/// stylesheet files you want included in this theme, and in what order.
////////////////////////////////////////////////////////////////////////////////
$THEME->standardsheets = array('styles_layout', 'styles_color');
/// This variable can be set to an array containing
-/// filenames from the *STANDARD* theme. If the
-/// array exists, it will be used to choose the
+/// filenames from the *STANDARD* theme. If the
+/// array exists, it will be used to choose the
/// files to include in the standard style sheet.
/// When false, then no files are used.
/// When true or NON-EXISTENT, then ALL standard files are used.
-/// This parameter can be used, for example, to prevent
+/// This parameter can be used, for example, to prevent
/// having to override too many classes.
/// Note that the trailing .css should not be included
/// eg $THEME->standardsheets = array('styles_layout','styles_fonts','styles_color');
////////////////////////////////////////////////////////////////////////////////
-$THEME->parent = '';
+$THEME->parent = '';
/// This variable can be set to the name of a parent theme
/// which you want to have included before the current theme.
-/// This can make it easy to make modifications to another
+/// This can make it easy to make modifications to another
/// theme without having to actually change the files
-/// If this variable is empty or false then a parent theme
+/// If this variable is empty or false then a parent theme
/// is not used.
////////////////////////////////////////////////////////////////////////////////
-$THEME->parentsheets = false;
+$THEME->parentsheets = false;
/// This variable can be set to an array containing
-/// filenames from a chosen *PARENT* theme. If the
-/// array exists, it will be used to choose the
+/// filenames from a chosen *PARENT* theme. If the
+/// array exists, it will be used to choose the
/// files to include in the standard style sheet.
/// When false, then no files are used.
/// When true or NON-EXISTENT, then ALL standard files are used.
-/// This parameter can be used, for example, to prevent
+/// This parameter can be used, for example, to prevent
/// having to override too many classes.
/// Note that the trailing .css should not be included
/// eg $THEME->parentsheets = array('styles_layout','styles_fonts','styles_color');
$THEME->navmenuwidth = 50;
-/// You can use this to control the cutoff point for strings
+/// You can use this to control the cutoff point for strings
/// in the navmenus (list of activities in popup menu etc)
/// Default is 50 characters wide.
/// By setting this to true, then you will have access to a
/// new variable in your header.html and footer.html called
-/// $navmenulist ... this contains a simple XHTML menu of
-/// all activities in the current course, mostly useful for
+/// $navmenulist ... this contains a simple XHTML menu of
+/// all activities in the current course, mostly useful for
/// creating popup navigation menus and so on.
-$THEME->resource_mp3player_colors =
+$THEME->resource_mp3player_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'font=Arial&fontColour=3333FF&buffer=10&waitForPlay=no&autoPlay=yes';
-/// With this you can control the colours of the "big" MP3 player
+/// With this you can control the colours of the "big" MP3 player
/// that is used for MP3 resources.
-$THEME->filter_mediaplugin_colors =
+$THEME->filter_mediaplugin_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'waitForPlay=yes';
$THEME->custompix = false;
-/// If true, then this theme must have a "pix"
-/// subdirectory that contains copies of all
+/// If true, then this theme must have a "pix"
+/// subdirectory that contains copies of all
/// files from the moodle/pix directory, plus a
-/// "pix/mod" directory containing all the icons
+/// "pix/mod" directory containing all the icons
/// for all the activity modules.
////////////////////////////////////////////////////////////////////////////////
-// These colours are not used anymore, so I've set them to
+// These colours are not used anymore, so I've set them to
// bright green to help identify where they should be removed
// These lines will be deleted soon
$THEME->hidden = "#22FF22"; // To color things that are hidden
$THEME->autolink = "#22FF22"; // To color auto-generated links (eg glossary)
-?>
+
* Peterned - http://www.xs4all.nl/~peterned/
* (c) 2004 - Peter Nederlof
*
- * Credits - Arnoud Berendsen
+ * Credits - Arnoud Berendsen
* - Martin Reurings
* for inspiring me and finding really sick bugs
*
function parseStylesheets() {
var sheets = doc.styleSheets, l = sheets.length;
- for(var i=0; i<l; i++)
+ for(var i=0; i<l; i++)
parseStylesheet(sheets[i]);
}
function parseStylesheet(sheet) {
var l, rules, imports;
if(sheet.imports) {
imports = sheet.imports, l = imports.length;
- for(var i=0; i<l; i++)
+ for(var i=0; i<l; i++)
parseStylesheet(sheet.imports[i]);
}
function parseCSSRule(rule) {
var select = rule.selectorText, style = rule.style.cssText;
if(!(/(^|\s)(([^a]([^ ]+)?)|(a([^#.][^ ]+)+)):(hover|active)/i).test(select) || !style) return;
-
+
var pseudo = select.replace(/[^:]+:([a-z-]+).*/i, 'on$1');
var newSelect = select.replace(/(\.([a-z0-9_-]+):[a-z]+)|(:[a-z]+)/gi, '.$2' + pseudo);
var className = (/\.([a-z0-9_-]*on(hover|active))/i).exec(newSelect)[1];
node.attachEvent(events.on,
function() { node.className += ' ' + className; });
node.attachEvent(events.off,
- function() { node.className =
+ function() { node.className =
node.className.replace(new RegExp('\\s+'+className, 'g'),''); });
}
/*******************************************************************
styles_color.css
-
- This CSS file contains all color definitions like
+
+ This CSS file contains all color definitions like
background-color, font-color, border-color etc.
Styles are organised into the following sections:
color:#A00
}
/* Alternate rows even */
-.r0 {
+.r0 {
}
/* Alternate rows odd */
-.r1 {
+.r1 {
}
/* notification messages (can be good or bad) */
.breadcrumb .sep {
- color: #DA3;
+ color: #DA3;
}
.notifyproblem {
color:#600
/***
*** Admin
***/
-
+
.admin .generalboxcontent {
background-color:#EEE
}
border-color:#BBB
}
.admin .informationbox {
- border-color:#BBB;
+ border-color:#BBB;
background-color:#FFF
}
body#admin-index .c0 {
}
.assignmentnew .assignmentfeedback{
background-color:#FFEDCE
-}
-
+}
+
.assignmentold .assignmentfeedback{
background-color:#BBB
}
/***
*** Modules:Forum
***/
-
+
.mod-forum #content {
background-color:#F9FAFA
}
/***
*** Modules:Glossary
***/
-
+
.mod-glossary #content {
background-color:#F9FAFA
}
/*******************************************************************
styles_fonts.css
-
+
This CSS file contains all font definitions like family, size,
weight, text-align, letter-spacing etc.
/***
*** Blocks
***/
-
+
.sideblock {
font-size:0.7em
}
.message .summary {
font-size:0.9em
}
-.message .note,
+.message .note,
.message .pix {
font-size:0.8em
}
#mod-choice-index .cell {
font-size:0.85em
}
-
+
/***
*** Modules:Forum
***/
/*******************************************************************
styles_layout.css
-
+
This CSS file contains all layout definitions like positioning,
floats, margins, padding, borders etc.
/***
*** Footer
***/
-
+
#footer {
margin-top:1em
}
/***
*** Admin
***/
-
+
.logtable th.header {
border-left:1px solid;
border-right:1px solid;
/***
*** Blocks
***/
-
+
.sideblock,
.sideblock .searchform {
text-align:left
.loginbox {
margin-top:12px
}
-
+
/***
*** Modules:Forum
***/
-
+
.forumheaderlist {
width:90%;
margin-left:auto;
#mod-forum-index .generalbox {
width:100%
}
-
+
/***
*** Modules:Glossary
***/
/***
*** Modules:Resource
***/
-
+
.mod-resource #content {
margin-top:1px
}
-<?PHP // $Id$
+<?php
////////////////////////////////////////////////////////////////////////////////
-/// This file contains a few configuration variables that control
+/// This file contains a few configuration variables that control
/// how Moodle uses this theme.
////////////////////////////////////////////////////////////////////////////////
$THEME->sheets = array('styles_pda');
-/// This variable is an array containing the names of all the
+/// This variable is an array containing the names of all the
/// stylesheet files you want included in this theme, and in what order
////////////////////////////////////////////////////////////////////////////////
$THEME->standardsheets = array('styles_layout', 'styles_color');
/// This variable can be set to an array containing
-/// filenames from the *STANDARD* theme. If the
-/// array exists, it will be used to choose the
+/// filenames from the *STANDARD* theme. If the
+/// array exists, it will be used to choose the
/// files to include in the standard style sheet.
/// When false, then no files are used.
/// When true or NON-EXISTENT, then ALL standard files are used.
-/// This parameter can be used, for example, to prevent
+/// This parameter can be used, for example, to prevent
/// having to override too many classes.
/// Note that the trailing .css should not be included
/// eg $THEME->standardsheets = array('styles_layout','styles_fonts','styles_color');
////////////////////////////////////////////////////////////////////////////////
-$THEME->parent = 'orangewhite';
+$THEME->parent = 'orangewhite';
/// This variable can be set to the name of a parent theme
/// which you want to have included before the current theme.
-/// This can make it easy to make modifications to another
+/// This can make it easy to make modifications to another
/// theme without having to actually change the files
-/// If this variable is empty or false then a parent theme
+/// If this variable is empty or false then a parent theme
/// is not used.
////////////////////////////////////////////////////////////////////////////////
-$THEME->parentsheets = array('styles_layout', 'styles_fonts', 'styles_color', 'styles_tabs');
+$THEME->parentsheets = array('styles_layout', 'styles_fonts', 'styles_color', 'styles_tabs');
/// This variable can be set to an array containing
-/// filenames from a chosen *PARENT* theme. If the
-/// array exists, it will be used to choose the
+/// filenames from a chosen *PARENT* theme. If the
+/// array exists, it will be used to choose the
/// files to include in the standard style sheet.
/// When false, then no files are used.
/// When true or NON-EXISTENT, then ALL standard files are used.
-/// This parameter can be used, for example, to prevent
+/// This parameter can be used, for example, to prevent
/// having to override too many classes.
/// Note that the trailing .css should not be included
/// eg $THEME->parentsheets = array('styles_layout','styles_fonts','styles_color');
$THEME->navmenuwidth = 50;
-/// You can use this to control the cutoff point for strings
+/// You can use this to control the cutoff point for strings
/// in the navmenus (list of activities in popup menu etc)
/// Default is 50 characters wide.
/// By setting this to true, then you will have access to a
/// new variable in your header.html and footer.html called
-/// $navmenulist ... this contains a simple XHTML menu of
-/// all activities in the current course, mostly useful for
+/// $navmenulist ... this contains a simple XHTML menu of
+/// all activities in the current course, mostly useful for
/// creating popup navigation menus and so on.
-$THEME->resource_mp3player_colors =
+$THEME->resource_mp3player_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'font=Arial&fontColour=3333FF&buffer=10&waitForPlay=no&autoPlay=yes';
-/// With this you can control the colours of the "big" MP3 player
+/// With this you can control the colours of the "big" MP3 player
/// that is used for MP3 resources.
-$THEME->filter_mediaplugin_colors =
+$THEME->filter_mediaplugin_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'waitForPlay=yes';
$THEME->custompix = false;
-/// If true, then this theme must have a "pix"
-/// subdirectory that contains copies of all
+/// If true, then this theme must have a "pix"
+/// subdirectory that contains copies of all
/// files from the moodle/pix directory, plus a
-/// "pix/mod" directory containing all the icons
+/// "pix/mod" directory containing all the icons
/// for all the activity modules.
////////////////////////////////////////////////////////////////////////////////
-?>
+
/* $Id$ */
-/*************************************************
+/*************************************************
***
*** pda
***
*** header and footer styles
*** content styles (alphabetically)
*** admin, course, activities, calendar, blocks
-***
+***
*** Please sort new styles for existing content
*** into the appropriate part of this CSS file.
*** Styles for new Blocks or Activities please
padding:0
}
p, a, li, dd, dt, pre, code, input, select {
- font-size:1.5em !important
+ font-size:1.5em !important
}
.content, .topic {
- font-size:1.5em !important
+ font-size:1.5em !important
}
#header {
height:auto;
margin-right:0 !important;
padding-left:0 !important;
padding-right:0 !important;
- border:1px solid #AAA !important
+ border:1px solid #AAA !important
}
#course-view .headingblock,
#course-view .topics {
border:1px solid #AAA !important;
}
#course-view .spacer {
- height:1em !important;
+ height:1em !important;
}
#course-view .topics .left,
#course-view .topics .right {
font-weight:bold;
}
/** {
- border:1px solid #A00 !important
+ border:1px solid #A00 !important
}*/
.tabs tr,
.tabs td {
- background-image:none !important
+ background-image:none !important
}
.tabs td {
border:1px solid #AAA !important;
}
#course-log .r1 td {
border:1px solid #AAA;
- text-align:left;
+ text-align:left;
}
.generaltable th,
.generaltable td {
- border:1px solid #AAA !important;
+ border:1px solid #AAA !important;
}
\ No newline at end of file
<p>This theme is always the most up-to date.</p>
-<p>Programmers working on Moodle should always design for this
+<p>Programmers working on Moodle should always design for this
theme, and add new styles to this theme.</p>
<p>By default, these styles are automatically loaded before any other
This CSS file contains all layout definitions that are required for
right-to-left languages. It overrides definitions in other fils to
- move right-floating blocks to the left, align text to the right,
+ move right-floating blocks to the left, align text to the right,
swap left and right margins, etc.
-
+
*******************************************************************/
body, td, li, div {
#mod-quiz-edit div.question div.content div.qorder{
left:50px;
right:auto;
-
+
}
#mod-quiz-edit div.question div.content div.questioncontrols{
right:auto;
-webkit-border-radius:0.6em;
border-radius:0.6em;
-moz-border-radius:0.6em;
-
+
margin-right:0.3em;
border-right:solid #777 thin;
-webkit-border-radius-bottomright:0;
border-radius-topright:0;
-moz-border-radius-bottomright:0;
-moz-border-radius-topright:0;
-
+
}
#mod-quiz-edit .reorder div.question div.content{
/* ========================
- overrides styles_ie6
+ overrides styles_ie6
======================== */
FORM.mform INPUT {
/**
* unread count background on
- * course/view.php
+ * course/view.php
**/
#course-view .unread{
- background: #9EBEFF;
+ background: #9EBEFF;
}
/**
* Patch MDL-18971 version 3 puts the forum classes
* in page sequence. Also added one course class (above)
- * for course/view.php
+ * for course/view.php
**/
/** The location of these classes is unknown
* Commented out with patch MDL-18971 version 3
**/
/*.sideblock .post .head {
- color:#555555;
+ color:#555555;
}*/
/** Unread Posts count background on
background: #9EBEFF;
}
-/** wire frame around cells in
- * mod/forum/view.php
+/** wire frame around cells in
+ * mod/forum/view.php
**/
.forumheaderlist td {
border-color: #FFFFFF;
}
-/** Discussion column background in
- * mod/forum/view.php
+/** Discussion column background in
+ * mod/forum/view.php
* The inner class is actually "topic starter"
**/
.forumheaderlist .discussion .starter {
}
/** unread column background on
- * mod/forum/view.php
+ * mod/forum/view.php
**/
#mod-forum-view .unread{
background: #9EBEFF;
}
-/** border around posts in
- * mod/forum/view.php (forumheaderlist) and
+/** border around posts in
+ * mod/forum/view.php (forumheaderlist) and
* mod/forum/discuss.php (forumpost)
**/
.forumheaderlist,
border-color:#DDDDDD;
}
-/** post body color in
- * mod/forum/discuss.php
+/** post body color in
+ * mod/forum/discuss.php
**/
.forumpost .content {
background: #FFFFFF;
}
-/** left photo section of each post in
- * mod/forum/discuss.php
+/** left photo section of each post in
+ * mod/forum/discuss.php
**/
.forumpost .left {
background:#EEEEEE;
}
-/** line between header and post body in
- * mod/forum/discuss.php
+/** line between header and post body in
+ * mod/forum/discuss.php
**/
.forumpost .topic {
border-bottom-color: #EEEEEE;
}
-/** header of the first post in
- * mod/forum/discuss.php
+/** header of the first post in
+ * mod/forum/discuss.php
**/
.forumpost .starter {
background:#DDDDDD;
}
/** header of reply posts and
- * lower corners of all posts in
- * mod/forum/discuss.php
+ * lower corners of all posts in
+ * mod/forum/discuss.php
**/
#mod-forum-discuss .forumpost {
background: none;
}
/** inside border of unread posts in nested format in
- * mod/forum/discuss.php
+ * mod/forum/discuss.php
**/
#mod-forum-discuss .forumpost.unread .content {
border-width:2px;
- border-color: #0046C7;
+ border-color: #0046C7;
}
/** headers of unread posts in threaded format in
- * mod/forum/discuss.php
+ * mod/forum/discuss.php
**/
#mod-forum-discuss .forumthread.unread {
- background: #9EBEFF;
+ background: #9EBEFF;
}
background-color:inherit;
}
.navigation_bar .sideblock_tab {
-
+
}
.navigation_bar .sideblock_tab .firsttab {
margin-top:1em;
width: 90%;
margin-left: auto;
margin-right: auto;
-}
+}
/***
*** Modules: Forum
-<?PHP // $Id$
+<?php
////////////////////////////////////////////////////////////////////////////////
-/// This file contains a few configuration variables that control
+/// This file contains a few configuration variables that control
/// how Moodle uses this theme.
////////////////////////////////////////////////////////////////////////////////
$THEME->sheets = array('gradients');
-/// This variable is an array containing the names of all the
+/// This variable is an array containing the names of all the
/// stylesheet files you want included in this theme, and in what order
////////////////////////////////////////////////////////////////////////////////
-$THEME->standardsheets = array('styles_layout','styles_fonts','styles_color','styles_moz');
+$THEME->standardsheets = array('styles_layout','styles_fonts','styles_color','styles_moz');
/// This variable can be set to an array containing
-/// filenames from the *STANDARD* theme. If the
-/// array exists, it will be used to choose the
+/// filenames from the *STANDARD* theme. If the
+/// array exists, it will be used to choose the
/// files to include in the standard style sheet.
/// When false, then no files are used.
/// When true or NON-EXISTENT, then ALL standard files are used.
-/// This parameter can be used, for example, to prevent
+/// This parameter can be used, for example, to prevent
/// having to override too many classes.
/// Note that the trailing .css should not be included
/// eg $THEME->standardsheets = array('styles_layout','styles_fonts','styles_color');
////////////////////////////////////////////////////////////////////////////////
-$THEME->parent = '';
+$THEME->parent = '';
/// This variable can be set to the name of a parent theme
/// which you want to have included before the current theme.
-/// This can make it easy to make modifications to another
+/// This can make it easy to make modifications to another
/// theme without having to actually change the files
-/// If this variable is empty or false then a parent theme
+/// If this variable is empty or false then a parent theme
/// is not used.
////////////////////////////////////////////////////////////////////////////////
-$THEME->parentsheets = false;
+$THEME->parentsheets = false;
/// This variable can be set to an array containing
-/// filenames from a chosen *PARENT* theme. If the
-/// array exists, it will be used to choose the
+/// filenames from a chosen *PARENT* theme. If the
+/// array exists, it will be used to choose the
/// files to include in the standard style sheet.
/// When false, then no files are used.
/// When true or NON-EXISTENT, then ALL standard files are used.
-/// This parameter can be used, for example, to prevent
+/// This parameter can be used, for example, to prevent
/// having to override too many classes.
/// Note that the trailing .css should not be included
/// eg $THEME->parentsheets = array('styles_layout','styles_fonts','styles_color');
$THEME->navmenuwidth = 50;
-/// You can use this to control the cutoff point for strings
+/// You can use this to control the cutoff point for strings
/// in the navmenus (list of activities in popup menu etc)
/// Default is 50 characters wide.
-$THEME->makenavmenulist = false;
+$THEME->makenavmenulist = false;
/// By setting this to true, then you will have access to a
/// new variable in your header.html and footer.html called
-/// $navmenulist ... this contains a simple XHTML menu of
-/// all activities in the current course, mostly useful for
+/// $navmenulist ... this contains a simple XHTML menu of
+/// all activities in the current course, mostly useful for
/// creating popup navigation menus and so on.
-$THEME->resource_mp3player_colors =
+$THEME->resource_mp3player_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'font=Arial&fontColour=3333FF&buffer=10&waitForPlay=no&autoPlay=yes';
-/// With this you can control the colours of the "big" MP3 player
+/// With this you can control the colours of the "big" MP3 player
/// that is used for MP3 resources.
-$THEME->filter_mediaplugin_colors =
+$THEME->filter_mediaplugin_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'waitForPlay=yes';
$THEME->custompix = false;
-/// If true, then this theme must have a "pix"
-/// subdirectory that contains copies of all
+/// If true, then this theme must have a "pix"
+/// subdirectory that contains copies of all
/// files from the moodle/pix directory, plus a
-/// "pix/mod" directory containing all the icons
+/// "pix/mod" directory containing all the icons
/// for all the activity modules.
////////////////////////////////////////////////////////////////////////////////
-?>
+
th.header,
td.header,
-div.header {
- background-image:url(gradient.jpg);
- background-position:top;
- background-repeat:repeat-x;
+div.header {
+ background-image:url(gradient.jpg);
+ background-position:top;
+ background-repeat:repeat-x;
}
.navbar {
- background-image:url(gradient.jpg);
- background-position:top;
- background-repeat:repeat-x;
+ background-image:url(gradient.jpg);
+ background-position:top;
+ background-repeat:repeat-x;
}
-<?PHP // $Id$
+<?php
////////////////////////////////////////////////////////////////////////////////
-/// This file contains a few configuration variables that control
+/// This file contains a few configuration variables that control
/// how Moodle uses this theme.
////////////////////////////////////////////////////////////////////////////////
$THEME->sheets = array('gradients');
-/// This variable is an array containing the names of all the
+/// This variable is an array containing the names of all the
/// stylesheet files you want included in this theme, and in what order
////////////////////////////////////////////////////////////////////////////////
-$THEME->standardsheets = array('styles_layout','styles_fonts','styles_color','styles_moz');
+$THEME->standardsheets = array('styles_layout','styles_fonts','styles_color','styles_moz');
/// This variable can be set to an array containing
-/// filenames from the *STANDARD* theme. If the
-/// array exists, it will be used to choose the
+/// filenames from the *STANDARD* theme. If the
+/// array exists, it will be used to choose the
/// files to include in the standard style sheet.
/// When false, then no files are used.
/// When true or NON-EXISTENT, then ALL standard files are used.
-/// This parameter can be used, for example, to prevent
+/// This parameter can be used, for example, to prevent
/// having to override too many classes.
/// Note that the trailing .css should not be included
/// eg $THEME->standardsheets = array('styles_layout','styles_fonts','styles_color');
////////////////////////////////////////////////////////////////////////////////
-$THEME->parent = '';
+$THEME->parent = '';
/// This variable can be set to the name of a parent theme
/// which you want to have included before the current theme.
-/// This can make it easy to make modifications to another
+/// This can make it easy to make modifications to another
/// theme without having to actually change the files
-/// If this variable is empty or false then a parent theme
+/// If this variable is empty or false then a parent theme
/// is not used.
////////////////////////////////////////////////////////////////////////////////
-$THEME->parentsheets = false;
+$THEME->parentsheets = false;
/// This variable can be set to an array containing
-/// filenames from a chosen *PARENT* theme. If the
-/// array exists, it will be used to choose the
+/// filenames from a chosen *PARENT* theme. If the
+/// array exists, it will be used to choose the
/// files to include in the standard style sheet.
/// When false, then no files are used.
/// When true or NON-EXISTENT, then ALL standard files are used.
-/// This parameter can be used, for example, to prevent
+/// This parameter can be used, for example, to prevent
/// having to override too many classes.
/// Note that the trailing .css should not be included
/// eg $THEME->parentsheets = array('styles_layout','styles_fonts','styles_color');
$THEME->navmenuwidth = 50;
-/// You can use this to control the cutoff point for strings
+/// You can use this to control the cutoff point for strings
/// in the navmenus (list of activities in popup menu etc)
/// Default is 50 characters wide.
-$THEME->makenavmenulist = false;
+$THEME->makenavmenulist = false;
/// By setting this to true, then you will have access to a
/// new variable in your header.html and footer.html called
-/// $navmenulist ... this contains a simple XHTML menu of
-/// all activities in the current course, mostly useful for
+/// $navmenulist ... this contains a simple XHTML menu of
+/// all activities in the current course, mostly useful for
/// creating popup navigation menus and so on.
-$THEME->resource_mp3player_colors =
+$THEME->resource_mp3player_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'font=Arial&fontColour=3333FF&buffer=10&waitForPlay=no&autoPlay=yes';
-/// With this you can control the colours of the "big" MP3 player
+/// With this you can control the colours of the "big" MP3 player
/// that is used for MP3 resources.
-$THEME->filter_mediaplugin_colors =
+$THEME->filter_mediaplugin_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'waitForPlay=yes';
$THEME->custompix = false;
-/// If true, then this theme must have a "pix"
-/// subdirectory that contains copies of all
+/// If true, then this theme must have a "pix"
+/// subdirectory that contains copies of all
/// files from the moodle/pix directory, plus a
-/// "pix/mod" directory containing all the icons
+/// "pix/mod" directory containing all the icons
/// for all the activity modules.
////////////////////////////////////////////////////////////////////////////////
-?>
+
th.header,
td.header,
-div.header {
- background-image:url(gradient.jpg);
- background-position:top;
- background-repeat:repeat-x;
+div.header {
+ background-image:url(gradient.jpg);
+ background-position:top;
+ background-repeat:repeat-x;
}
.navbar {
- background-image:url(gradient.jpg);
- background-position:top;
- background-repeat:repeat-x;
+ background-image:url(gradient.jpg);
+ background-position:top;
+ background-repeat:repeat-x;
}
-<?PHP // $Id$
+<?php
////////////////////////////////////////////////////////////////////////////////
-/// This file contains a few configuration variables that control
+/// This file contains a few configuration variables that control
/// how Moodle uses this theme.
////////////////////////////////////////////////////////////////////////////////
$THEME->sheets = array('gradients');
-/// This variable is an array containing the names of all the
+/// This variable is an array containing the names of all the
/// stylesheet files you want included in this theme, and in what order
////////////////////////////////////////////////////////////////////////////////
-$THEME->standardsheets = array('styles_layout','styles_fonts','styles_color','styles_moz');
+$THEME->standardsheets = array('styles_layout','styles_fonts','styles_color','styles_moz');
/// This variable can be set to an array containing
-/// filenames from the *STANDARD* theme. If the
-/// array exists, it will be used to choose the
+/// filenames from the *STANDARD* theme. If the
+/// array exists, it will be used to choose the
/// files to include in the standard style sheet.
/// When false, then no files are used.
/// When true or NON-EXISTENT, then ALL standard files are used.
-/// This parameter can be used, for example, to prevent
+/// This parameter can be used, for example, to prevent
/// having to override too many classes.
/// Note that the trailing .css should not be included
/// eg $THEME->standardsheets = array('styles_layout','styles_fonts','styles_color');
////////////////////////////////////////////////////////////////////////////////
-$THEME->parent = 'standardwhite';
+$THEME->parent = 'standardwhite';
/// This variable can be set to the name of a parent theme
/// which you want to have included before the current theme.
-/// This can make it easy to make modifications to another
+/// This can make it easy to make modifications to another
/// theme without having to actually change the files
-/// If this variable is empty or false then a parent theme
+/// If this variable is empty or false then a parent theme
/// is not used.
////////////////////////////////////////////////////////////////////////////////
-$THEME->parentsheets = array('gradients');
+$THEME->parentsheets = array('gradients');
/// This variable can be set to an array containing
-/// filenames from a chosen *PARENT* theme. If the
-/// array exists, it will be used to choose the
+/// filenames from a chosen *PARENT* theme. If the
+/// array exists, it will be used to choose the
/// files to include in the standard style sheet.
/// When false, then no files are used.
/// When true or NON-EXISTENT, then ALL standard files are used.
-/// This parameter can be used, for example, to prevent
+/// This parameter can be used, for example, to prevent
/// having to override too many classes.
/// Note that the trailing .css should not be included
/// eg $THEME->parentsheets = array('styles_layout','styles_fonts','styles_color');
$THEME->navmenuwidth = 50;
-/// You can use this to control the cutoff point for strings
+/// You can use this to control the cutoff point for strings
/// in the navmenus (list of activities in popup menu etc)
/// Default is 50 characters wide.
-$THEME->makenavmenulist = false;
+$THEME->makenavmenulist = false;
/// By setting this to true, then you will have access to a
/// new variable in your header.html and footer.html called
-/// $navmenulist ... this contains a simple XHTML menu of
-/// all activities in the current course, mostly useful for
+/// $navmenulist ... this contains a simple XHTML menu of
+/// all activities in the current course, mostly useful for
/// creating popup navigation menus and so on.
-$THEME->resource_mp3player_colors =
+$THEME->resource_mp3player_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'font=Arial&fontColour=3333FF&buffer=10&waitForPlay=no&autoPlay=yes';
-/// With this you can control the colours of the "big" MP3 player
+/// With this you can control the colours of the "big" MP3 player
/// that is used for MP3 resources.
-$THEME->filter_mediaplugin_colors =
+$THEME->filter_mediaplugin_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'waitForPlay=yes';
$THEME->custompix = false;
-/// If true, then this theme must have a "pix"
-/// subdirectory that contains copies of all
+/// If true, then this theme must have a "pix"
+/// subdirectory that contains copies of all
/// files from the moodle/pix directory, plus a
-/// "pix/mod" directory containing all the icons
+/// "pix/mod" directory containing all the icons
/// for all the activity modules.
////////////////////////////////////////////////////////////////////////////////
-?>
+
-<?PHP // $Id$
+<?php
////////////////////////////////////////////////////////////////////////////////
-/// This file contains a few configuration variables that control
+/// This file contains a few configuration variables that control
/// how Moodle uses this theme.
////////////////////////////////////////////////////////////////////////////////
$THEME->sheets = array('gradients');
-/// This variable is an array containing the names of all the
+/// This variable is an array containing the names of all the
/// stylesheet files you want included in this theme, and in what order
////////////////////////////////////////////////////////////////////////////////
-$THEME->standardsheets = array('styles_layout','styles_fonts','styles_color','styles_moz');
+$THEME->standardsheets = array('styles_layout','styles_fonts','styles_color','styles_moz');
/// This variable can be set to an array containing
-/// filenames from the *STANDARD* theme. If the
-/// array exists, it will be used to choose the
+/// filenames from the *STANDARD* theme. If the
+/// array exists, it will be used to choose the
/// files to include in the standard style sheet.
/// When false, then no files are used.
/// When true or NON-EXISTENT, then ALL standard files are used.
-/// This parameter can be used, for example, to prevent
+/// This parameter can be used, for example, to prevent
/// having to override too many classes.
/// Note that the trailing .css should not be included
/// eg $THEME->standardsheets = array('styles_layout','styles_fonts','styles_color');
////////////////////////////////////////////////////////////////////////////////
-$THEME->parent = '';
+$THEME->parent = '';
/// This variable can be set to the name of a parent theme
/// which you want to have included before the current theme.
-/// This can make it easy to make modifications to another
+/// This can make it easy to make modifications to another
/// theme without having to actually change the files
-/// If this variable is empty or false then a parent theme
+/// If this variable is empty or false then a parent theme
/// is not used.
////////////////////////////////////////////////////////////////////////////////
-$THEME->parentsheets = false;
+$THEME->parentsheets = false;
/// This variable can be set to an array containing
-/// filenames from a chosen *PARENT* theme. If the
-/// array exists, it will be used to choose the
+/// filenames from a chosen *PARENT* theme. If the
+/// array exists, it will be used to choose the
/// files to include in the standard style sheet.
/// When false, then no files are used.
/// When true or NON-EXISTENT, then ALL standard files are used.
-/// This parameter can be used, for example, to prevent
+/// This parameter can be used, for example, to prevent
/// having to override too many classes.
/// Note that the trailing .css should not be included
/// eg $THEME->parentsheets = array('styles_layout','styles_fonts','styles_color');
$THEME->navmenuwidth = 50;
-/// You can use this to control the cutoff point for strings
+/// You can use this to control the cutoff point for strings
/// in the navmenus (list of activities in popup menu etc)
/// Default is 50 characters wide.
-$THEME->makenavmenulist = false;
+$THEME->makenavmenulist = false;
/// By setting this to true, then you will have access to a
/// new variable in your header.html and footer.html called
-/// $navmenulist ... this contains a simple XHTML menu of
-/// all activities in the current course, mostly useful for
+/// $navmenulist ... this contains a simple XHTML menu of
+/// all activities in the current course, mostly useful for
/// creating popup navigation menus and so on.
-$THEME->resource_mp3player_colors =
+$THEME->resource_mp3player_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'font=Arial&fontColour=3333FF&buffer=10&waitForPlay=no&autoPlay=yes';
-/// With this you can control the colours of the "big" MP3 player
+/// With this you can control the colours of the "big" MP3 player
/// that is used for MP3 resources.
-$THEME->filter_mediaplugin_colors =
+$THEME->filter_mediaplugin_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'waitForPlay=yes';
$THEME->custompix = false;
-/// If true, then this theme must have a "pix"
-/// subdirectory that contains copies of all
+/// If true, then this theme must have a "pix"
+/// subdirectory that contains copies of all
/// files from the moodle/pix directory, plus a
-/// "pix/mod" directory containing all the icons
+/// "pix/mod" directory containing all the icons
/// for all the activity modules.
////////////////////////////////////////////////////////////////////////////////
-?>
+
th.header,
td.header,
-div.header {
- background-image:url(gradient.jpg);
- background-position:top;
- background-repeat:repeat-x;
+div.header {
+ background-image:url(gradient.jpg);
+ background-position:top;
+ background-repeat:repeat-x;
}
.navbar {
- background-image:url(gradient.jpg);
- background-position:top;
- background-repeat:repeat-x;
+ background-image:url(gradient.jpg);
+ background-position:top;
+ background-repeat:repeat-x;
}
)
);
-$THEME->resource_mp3player_colors =
+$THEME->resource_mp3player_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'font=Arial&fontColour=3333FF&buffer=10&waitForPlay=no&autoPlay=yes';
-$THEME->filter_mediaplugin_colors =
+$THEME->filter_mediaplugin_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'waitForPlay=yes';
//$CFG->block_search_button = link_arrow_right(get_string('search'), $url='', $accesshide=true);
$THEME->navmenuwidth = 50;
-// You can use this to control the cutoff point for strings
+// You can use this to control the cutoff point for strings
// in the navmenus (list of activities in popup menu etc)
// Default is 50 characters wide.
-$THEME->makenavmenulist = false;
+$THEME->makenavmenulist = false;
// By setting this to true, then you will have access to a
// new variable in your header.html and footer.html called
-// $navmenulist ... this contains a simple XHTML menu of
-// all activities in the current course, mostly useful for
+// $navmenulist ... this contains a simple XHTML menu of
+// all activities in the current course, mostly useful for
// creating popup navigation menus and so on.
echo $loggedinas;
echo $homelink;
- if (!empty($performanceinfo) and has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))) {
+ if (!empty($performanceinfo) and has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))) {
echo $performanceinfo;
}
<li><a href="http://www.contentquality.com/mynewtester/cynthia.exe?rptmode=-1&url1=<?php echo urlencode(qualified_me()) ?>">Section 508 Check</a></li>
<li><a href="http://www.contentquality.com/mynewtester/cynthia.exe?rptmode=0&warnp2n3e=1&url1=<?php echo urlencode(qualified_me()) ?>">WCAG 1 (2,3) Check</a></li>
</ul></div>
-<?php }
+<?php }
echo $OUTPUT->container_end();
?>
h1.header,
h2.header,
h3.header,
-div.header {
- background-image:url(gradient.jpg);
- background-position:top;
- background-repeat:repeat-x;
+div.header {
+ background-image:url(gradient.jpg);
+ background-position:top;
+ background-repeat:repeat-x;
}
table.rotateheaders th.header {
background-image: none;
}
.navbar {
- background-image:url(gradient.jpg);
- background-position:top;
- background-repeat:repeat-x;
+ background-image:url(gradient.jpg);
+ background-position:top;
+ background-repeat:repeat-x;
}
$lastmodified = time();
// Set the correct content type. (Should we also be specifying charset here?)
-header('Content-type: text/css');
+header('Content-type: text/css');
header('Last-Modified: ' . gmdate("D, d M Y H:i:s", $lastmodified) . ' GMT');
header('Pragma: ');
<h3>WOOD THEME</h3>
<hr />
-<p>This theme is a really simple one using background
+<p>This theme is a really simple one using background
images for near every element inside Moodle.</p>
<p>Two objectives were the main reason to build it:</p>
<ul>
<li>To learn how all the CSS stuff was working under Moodle 1.5 (now
I think it's really a great and powerful stuff!).</li>
-<li>To create an image-based theme template to allow quick
+<li>To create an image-based theme template to allow quick
modifications by simply changing some images and colors.</li>
</ul>
-<p>This theme is based on Moodle's Standard Theme.
+<p>This theme is based on Moodle's Standard Theme.
By default, the styles of the Standard theme
are automatically loaded before any other
themes, so that all custom themes need to do is to define their
own styles to augment or overwrite particular standard styles.</p>
-<p>For Wood to work properly, the Moodle Standard theme must
+<p>For Wood to work properly, the Moodle Standard theme must
be present and unaltered in the Theme directory.</p>
<p>In this way custom themes are not "left behind" by Moodle upgrades.</p>
-<p>For Moodle 1.9 onwards, to use the Wood black hide/show icons
-(pix/t/switch_minus.gif, switch_plus.gif), admins need to enable Smart pix search
+<p>For Moodle 1.9 onwards, to use the Wood black hide/show icons
+(pix/t/switch_minus.gif, switch_plus.gif), admins need to enable Smart pix search
(Site Administration - Miscellaneous - Experimental - smartpix).</p>
<p>For any suggestion, fix or comment about this theme, please, start a discussion
-<?PHP // $Id$
+<?php
////////////////////////////////////////////////////////////////////////////////
-/// This file contains a few configuration variables that control
+/// This file contains a few configuration variables that control
/// how Moodle uses this theme.
////////////////////////////////////////////////////////////////////////////////
$THEME->sheets = array('styles_color');
-/// This variable is an array containing the names of all the
+/// This variable is an array containing the names of all the
/// stylesheet files you want included in this theme, and in what order
////////////////////////////////////////////////////////////////////////////////
-$THEME->standardsheets = array('styles_layout','styles_fonts','styles_color');
+$THEME->standardsheets = array('styles_layout','styles_fonts','styles_color');
/// This variable can be set to an array containing
-/// filenames from the *STANDARD* theme. If the
-/// array exists, it will be used to choose the
+/// filenames from the *STANDARD* theme. If the
+/// array exists, it will be used to choose the
/// files to include in the standard style sheet.
/// When false, then no files are used.
/// When true or NON-EXISTENT, then ALL standard files are used.
-/// This parameter can be used, for example, to prevent
+/// This parameter can be used, for example, to prevent
/// having to override too many classes.
/// Note that the trailing .css should not be included
/// eg $THEME->standardsheets = array('styles_layout','styles_fonts','styles_color');
////////////////////////////////////////////////////////////////////////////////
-$THEME->parent = '';
+$THEME->parent = '';
/// This variable can be set to the name of a parent theme
/// which you want to have included before the current theme.
-/// This can make it easy to make modifications to another
+/// This can make it easy to make modifications to another
/// theme without having to actually change the files
-/// If this variable is empty or false then a parent theme
+/// If this variable is empty or false then a parent theme
/// is not used.
////////////////////////////////////////////////////////////////////////////////
-$THEME->parentsheets = false;
+$THEME->parentsheets = false;
/// This variable can be set to an array containing
-/// filenames from a chosen *PARENT* theme. If the
-/// array exists, it will be used to choose the
+/// filenames from a chosen *PARENT* theme. If the
+/// array exists, it will be used to choose the
/// files to include in the standard style sheet.
/// When false, then no files are used.
/// When true or NON-EXISTENT, then ALL standard files are used.
-/// This parameter can be used, for example, to prevent
+/// This parameter can be used, for example, to prevent
/// having to override too many classes.
/// Note that the trailing .css should not be included
/// eg $THEME->parentsheets = array('styles_layout','styles_fonts','styles_color');
$THEME->navmenuwidth = 50;
-/// You can use this to control the cutoff point for strings
+/// You can use this to control the cutoff point for strings
/// in the navmenus (list of activities in popup menu etc)
/// Default is 50 characters wide.
-$THEME->makenavmenulist = false;
+$THEME->makenavmenulist = false;
/// By setting this to true, then you will have access to a
/// new variable in your header.html and footer.html called
-/// $navmenulist ... this contains a simple XHTML menu of
-/// all activities in the current course, mostly useful for
+/// $navmenulist ... this contains a simple XHTML menu of
+/// all activities in the current course, mostly useful for
/// creating popup navigation menus and so on.
-$THEME->resource_mp3player_colors =
+$THEME->resource_mp3player_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'font=Arial&fontColour=3333FF&buffer=10&waitForPlay=no&autoPlay=yes';
-/// With this you can control the colours of the "big" MP3 player
+/// With this you can control the colours of the "big" MP3 player
/// that is used for MP3 resources.
-$THEME->filter_mediaplugin_colors =
+$THEME->filter_mediaplugin_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'waitForPlay=yes';
$THEME->custompix = false;
-/// If true, then this theme must have a "pix"
-/// subdirectory that contains copies of all
+/// If true, then this theme must have a "pix"
+/// subdirectory that contains copies of all
/// files from the moodle/pix directory, plus a
-/// "pix/mod" directory containing all the icons
+/// "pix/mod" directory containing all the icons
/// for all the activity modules.
////////////////////////////////////////////////////////////////////////////////
-?>
+
border-left:1px solid #FFCC99;
border-bottom:1px solid #330000;
border-right:1px solid #330000;
- background-image:url(gradient1.jpg);
+ background-image:url(gradient1.jpg);
background-position:bottom;
- background-repeat:repeat;
+ background-repeat:repeat;
}
.heading-with-help h2.main {
border:none;
border-left:1px solid #FFCC99;
border-bottom:1px solid #330000;
border-right:1px solid #330000;
- background-image:url(gradient2.jpg);
+ background-image:url(gradient2.jpg);
background-position:bottom;
background-repeat:repeat;
}
border-left:1px solid #FFCC99;
border-bottom:1px solid #330000;
border-right:1px solid #330000;
- background-image:url(gradient4.jpg);
+ background-image:url(gradient4.jpg);
background-position:bottom;
background-repeat:repeat;
}
}
require_once($formaction);
-?>
\ No newline at end of file
echo $OUTPUT->table($table);
echo '<div style="width:100%;text-align:center;"><input type="submit" value="' . get_string('savechanges'). '" /></div></form>';
echo $OUTPUT->footer();
-?>
+
/// and proper footer
echo $OUTPUT->footer();
-?>
\ No newline at end of file
/// and proper footer
echo $OUTPUT->footer();
-?>
\ No newline at end of file
-<?php //$Id$
+<?php
require_once($CFG->dirroot.'/lib/formslib.php');
}
}
-?>
+
// reload preferences in case it was changed in other session
unset($USER->preference);
}
-
+
if ($preferences = get_user_preferences(null, null, $user->id)) {
foreach($preferences as $name=>$value) {
$user->{'preference_'.$name} = $value;
}
-?>
+
$timeend = $unlimited;
unset($userbasemenu[2]);
}
-
+
$checkbox = $OUTPUT->select(html_select::make($periodmenu, "extendperiod[{$m[1]}]", "0", $nochange));
$checkbox2 = $OUTPUT->select(html_select::make($userbasemenu, "extendbase[{$m[1]}]", "2", false));
$table->data[] = array(
echo "\n<div style=\"width:100%;text-align:center;\"><input type=\"submit\" value=\"".get_string('savechanges')."\" /></div>\n</form>\n";
echo $OUTPUT->footer();
-?>
+
if (has_capability('moodle/user:delete', get_context_instance(CONTEXT_SYSTEM))) {
$this->clean_function_params('delete_users', $params);
-
+
foreach ($params->usernames as $username) {
$user = $DB->get_record('user', array('username'=>$username, 'mnethostid'=>1));
-
+
if (empty($user)) {
throw new moodle_exception('wscouldnotdeletenoexistinguser');
}
-
+
if (!delete_user($user)) {
$deletionsuccessfull = false; //this function is in moodlelib.php
}
}
-?>
+
-<?php //$Id$
+<?php
require_once($CFG->dirroot .'/user/filters/lib.php');
-<?php //$Id$
+<?php
require_once($CFG->dirroot.'/user/filters/lib.php');
return '';
}
}
-?>
\ No newline at end of file
-<?php //$Id$
+<?php
require_once($CFG->dirroot.'/user/filters/lib.php');
-<?php //$Id$
+<?php
require_once($CFG->dirroot.'/user/filters/text.php');
require_once($CFG->dirroot.'/user/filters/date.php');
}
if (empty($SESSION->user_filtering[$fname])) {
unset($SESSION->user_filtering[$fname]);
- }
+ }
}
}
// clear+reload the form
if (empty($hosts[$hostid])) {
$choices[$hostid] = 'id: '.$hostid.' ('.get_string('error').')';
}
- }
+ }
}
if (count($choices) < 2) {
return null; // filter not needed
-<?php //$Id$
+<?php
require_once($CFG->dirroot.'/user/filters/lib.php');
$params = array();
if (!array_key_exists($profile, $profile_fields)) {
return array('', array());
- }
+ }
$where = "";
$op = " IN ";
switch($operator) {
case 0: // contains
$where = "data $ilike :$name";
- $params[$name] = "%$value%";
+ $params[$name] = "%$value%";
break;
case 1: // does not contain
$where = "data NOT $ilike :$name";
- $params[$name] = "%$value%";
+ $params[$name] = "%$value%";
break;
case 2: // equal to
$where = "data $ilike :$name";
- $params[$name] = "$value";
+ $params[$name] = "$value";
break;
case 3: // starts with
$where = "data $ilike :$name";
- $params[$name] = "$value%";
+ $params[$name] = "$value%";
break;
case 4: // ends with
$where = "data $ilike :$name";
- $params[$name] = "%$value";
+ $params[$name] = "%$value";
break;
case 5: // empty
$where = "data=:$name";
- $params[$name] = "";
+ $params[$name] = "";
break;
case 6: // is not defined
$op = " NOT IN "; break;
if (!array_key_exists($profile, $profile_fields)) {
return '';
- }
+ }
$a = new object();
$a->label = $this->_label;
-<?php //$Id$
+<?php
require_once($CFG->dirroot.'/user/filters/lib.php');
-<?php //$Id$
+<?php
require_once($CFG->dirroot.'/user/filters/lib.php');
-<?php //$Id$
+<?php
require_once($CFG->dirroot.'/user/filters/lib.php');
-<?php //$Id$
+<?php
require_once($CFG->libdir.'/formslib.php');
-<?php //$Id$
+<?php
/**
* Generic yes/no filter with radio buttons for integer fields.
echo '</div></form>';
echo $OUTPUT->footer();
-?>
+
-<?php // $Id$
+<?php
// Lists all the users within a given course
$courseid = optional_param('id', 0, PARAM_INT); // this are required
$PAGE->set_url('user/index.php', array(
- 'page' => $page,
- 'perpage' => $perpage,
- 'mode' => $mode,
- 'accesssince' => $accesssince,
- 'search' => $search,
- 'roleid' => $roleid,
- 'contextid' => $contextid,
+ 'page' => $page,
+ 'perpage' => $perpage,
+ 'mode' => $mode,
+ 'accesssince' => $accesssince,
+ 'search' => $search,
+ 'roleid' => $roleid,
+ 'contextid' => $contextid,
'courseid' => $courseid));
if ($contextid) {
$picturecell = new html_table_cell();
$picturecell->add_classes(array('left', 'side', 'picture'));
$picturecell->text = print_group_picture($group, $course->id, true, false, false);
-
+
$contentcell = new html_table_cell();
$contentcell->add_class('content');
$contentcell->text = print_group_picture($group, $course->id, true, false, false);
}
-?>
+
echo $OUTPUT->footer();
-?>
\ No newline at end of file
echo $OUTPUT->footer();
-?>
\ No newline at end of file
}
echo $OUTPUT->footer();
-?>
\ No newline at end of file
echo $OUTPUT->footer();
-?>
+
$form->addElement('selectyesno', 'locked', get_string('profilelocked', 'admin'));
$form->addElement('selectyesno', 'forceunique', get_string('profileforceunique', 'admin'));
-
+
$form->addElement('selectyesno', 'signup', get_string('profilesignup', 'admin'));
$choices = array();
}
}
-?>
+
-<?php // $Id$
+<?php
class profile_define_checkbox extends profile_define_base {
}
}
-?>
+
-<?php // $Id$
+<?php
class profile_field_checkbox extends profile_field_base {
$checkbox = &$mform->addElement('advcheckbox', $this->inputname, format_string($this->field->name));
if ($this->data == '1') {
$checkbox->setChecked(true);
- }
+ }
$mform->setType($this->inputname, PARAM_BOOL);
if ($this->is_required() and !has_capability('moodle/user:update', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
$mform->addRule($this->inputname, get_string('required'), 'nonzero', null, 'client');
}
-?>
+
-<?php //$Id$
+<?php
class profile_define_menu extends profile_define_base {
}
-?>
+
-<?php //$Id$
+<?php
class profile_field_menu extends profile_field_base {
var $options;
}
}
-?>
+
-<?php //$Id$
+<?php
class profile_define_text extends profile_define_base {
}
-?>
+
-<?php //$Id$
+<?php
class profile_field_text extends profile_field_base {
}
-?>
+
$optionsyes = array ('id'=>$id, 'confirm'=>1, 'action'=>'deletecategory', 'sesskey'=>sesskey());
admin_externalpage_print_header();
echo $OUTPUT->heading('profiledeletecategory', 'admin');
-
+
$formcontinue = html_form::make_button($redirect, $optionsyes, get_string('yes'), 'post');
$formcancel = html_form::make_button($redirect, array(), get_string('no'), 'get');
echo $OUTPUT->confirm(get_string('profileconfirmcategorydeletion', 'admin', $fieldcount), $formcontinue, $formcancel);
}
-?>
+
-<?php //$Id$
+<?php
require_once($CFG->dirroot.'/lib/formslib.php');
}
}
-?>
+
-<?php //$Id$
+<?php
require_once($CFG->dirroot.'/lib/formslib.php');
}
}
-?>
+
/// Everything else can be extracted from them
var $fieldid;
var $userid;
-
+
var $field;
var $inputname;
var $data;
print_error('mustbeoveride', 'debug', '', 'edit_field_add');
}
-
+
/***** The following methods may be overwritten by child classes *****/
/**
$options->para = false;
return format_text($this->data, FORMAT_MOODLE, $options);
}
-
+
/**
* Print out the form field in the edit profile page
* @param object instance of the moodleform class
}
$data = new object();
-
+
$usernew->{$this->inputname} = $this->edit_save_data_preprocess($usernew->{$this->inputname}, $data);
$data->userid = $usernew->id;
/***** The following methods generally should not be overwritten by child classes *****/
-
+
/**
* Accessor method: set the userid for this instance
* @param integer id from the user table
function is_signup_field() {
return (boolean)$this->field->signup;
}
-
+
} /// End of class definition
if ($categories = $DB->get_records('user_info_category', null, 'sortorder ASC')) {
foreach ($categories as $category) {
if ($fields = $DB->get_records('user_info_field', array('categoryid'=>$category->id), 'sortorder ASC')) {
-
+
// check first if *any* fields will be displayed
$display = false;
foreach ($fields as $field) {
$sql = "SELECT uf.id as fieldid, ic.id as categoryid, ic.name as categoryname, uf.datatype
FROM {user_info_field} uf
JOIN {user_info_category} ic
- ON uf.categoryid = ic.id AND uf.signup = 1 AND uf.visible<>0
+ ON uf.categoryid = ic.id AND uf.signup = 1 AND uf.visible<>0
ORDER BY ic.sortorder ASC, uf.sortorder ASC";
if ( $fields = $DB->get_records_sql($sql)) {
}
-?>
+
echo $OUTPUT->table($table);
echo $OUTPUT->footer();
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
* or do we match occurrences anywhere? */
protected $searchanywhere = false;
- // This is used by get selected users,
+ // This is used by get selected users,
private $validatinguserids = null;
// Used to ensure we only output the search options for one user selector on
// each page.
private static $searchoptionsoutput = false;
-
+
// Public API ==============================================================
/**
public abstract function find_users($search);
/**
- *
+ *
* Note: this function must be implemented if you use the search ajax field
* (e.g. set $options['file'] = '/admin/filecontainingyourclass.php';)
* @return array the options needed to recreate this user_selector.
list($searchcondition, $searchparams) = $this->search_sql($search, 'u');
// Build the SQL
- $fields = "SELECT r.id AS roleid, r.shortname AS roleshortname, r.name AS rolename, u.id AS userid, " .
+ $fields = "SELECT r.id AS roleid, r.shortname AS roleshortname, r.name AS rolename, u.id AS userid, " .
$this->required_fields_sql('u') .
', (SELECT count(igm.groupid) FROM {groups_members} igm JOIN {groups} ig ON
igm.groupid = ig.id WHERE igm.userid = u.id AND ig.courseid = ?) AS numgroups ';
return $this->convert_array_format($roles, $search);
}
}
-?>
\ No newline at end of file
hash + '&sesskey=' + moodle_cfg.sesskey + '&search='
// Set up the data source.
- this.datasource = new YAHOO.util.XHRDataSource(this.searchurl);
+ this.datasource = new YAHOO.util.XHRDataSource(this.searchurl);
this.datasource.connXhrMode = 'cancelStaleRequests';
this.datasource.responseType = YAHOO.util.XHRDataSource.TYPE_JSON;
this.datasource.responseSchema = {resultsList: 'results'};
/**
* The input element that contains the search term.
- *
+ *
* @property searchfield
* @type HTMLInputElement
*/
/**
* The clear button.
- *
+ *
* @property clearbutton
* @type HTMLInputElement
*/
/**
* The select element that contains the list of users.
- *
+ *
* @property listbox
* @type HTMLSelectElement
*/
/**
* Used to hold the timeout id of the timeout that waits before doing a search.
- *
+ *
* @property timeoutid
* @type Number
*/
/**
* The last string that we searched for, so we can avoid unnecessary repeat searches.
- *
+ *
* @property lastsearch
* @type String
*/
}
/**
- * @return the value of one of the option checkboxes.<b>
+ * @return the value of one of the option checkboxes.<b>
*/
user_selector.prototype.get_option = function(name) {
var checkbox = document.getElementById('userselector_' + name + 'id');
}
echo json_encode(array('results' => $users));
-?>
\ No newline at end of file
-<?php // $Id$
+<?php
/// This file to be included so we can assume config.php has already been included.
/// We also assume that $user, $course, $currenttab have been set
print_tabs($tabs, $currenttab, $inactive, $activetwo);
}
-?>
+
if (!$has_courseid && !empty($CFG->profilesforenrolledusersonly) && !$DB->record_exists('role_assignments', array('userid'=>$id))) {
echo get_string('profilenotshown', 'moodle').'<hr />';
} else {
-
+
$user->description = file_rewrite_pluginfile_urls($user->description, 'pluginfile.php', $usercontext->id, 'user_profile', $id);
echo format_text($user->description, $user->descriptionformat)."<hr />";
}
echo "\n<tr><td class=\"label c0\">$left</td><td class=\"info c1\">$right</td></tr>\n";
}
-?>
+