diff --git a/admin/environment.xml b/admin/environment.xml index 4b9f4568d63..004cab09808 100644 --- a/admin/environment.xml +++ b/admin/environment.xml @@ -214,11 +214,7 @@ - - - - - + @@ -335,11 +331,7 @@ - - - - - + @@ -449,11 +441,7 @@ - - - - - + @@ -563,11 +551,7 @@ - - - - - + diff --git a/admin/settings/development.php b/admin/settings/development.php index 5c41b86340b..cb77515a84c 100644 --- a/admin/settings/development.php +++ b/admin/settings/development.php @@ -14,7 +14,10 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page $temp->add(new admin_setting_configcheckbox('enablegroupmembersonly', new lang_string('enablegroupmembersonly', 'admin'), new lang_string('configenablegroupmembersonly', 'admin'), 0)); $temp->add(new admin_setting_configcheckbox('dndallowtextandlinks', new lang_string('dndallowtextandlinks', 'admin'), new lang_string('configdndallowtextandlinks', 'admin'), 0)); - $temp->add(new admin_setting_configcheckbox('enablecssoptimiser', new lang_string('enablecssoptimiser','admin'), new lang_string('enablecssoptimiser_desc','admin'), 0)); + // The CSS optimiser setting. When changed we need to reset the theme caches in order to ensure they are regenerated through the optimiser. + $enablecssoptimiser = new admin_setting_configcheckbox('enablecssoptimiser', new lang_string('enablecssoptimiser','admin'), new lang_string('enablecssoptimiser_desc','admin'), 0); + $enablecssoptimiser->set_updatedcallback('theme_reset_all_caches'); + $temp->add($enablecssoptimiser); $ADMIN->add('experimental', $temp); diff --git a/admin/tool/uploaduser/index.php b/admin/tool/uploaduser/index.php index 9787ebb93af..ec692e227fa 100644 --- a/admin/tool/uploaduser/index.php +++ b/admin/tool/uploaduser/index.php @@ -86,7 +86,7 @@ $today = make_timestamp(date('Y', $today), date('m', $today), date('d', $today), // array of all valid fields for validation $STD_FIELDS = array('id', 'firstname', 'lastname', 'username', 'email', 'city', 'country', 'lang', 'timezone', 'mailformat', - 'maildisplay', 'maildigest', 'htmleditor', 'ajax', 'autosubscribe', + 'maildisplay', 'maildigest', 'htmleditor', 'autosubscribe', 'institution', 'department', 'idnumber', 'skype', 'msn', 'aim', 'yahoo', 'icq', 'phone1', 'phone2', 'address', 'url', 'description', 'descriptionformat', 'password', diff --git a/admin/tool/uploaduser/user_form.php b/admin/tool/uploaduser/user_form.php index 7fb74b0641b..7e7d790fd97 100644 --- a/admin/tool/uploaduser/user_form.php +++ b/admin/tool/uploaduser/user_form.php @@ -248,15 +248,6 @@ class admin_uploaduser_form2 extends moodleform { $mform->setType('htmleditor', PARAM_INT); } - if (empty($CFG->enableajax)) { - $mform->addElement('static', 'ajax', get_string('ajaxuse'), get_string('ajaxno')); - } else { - $choices = array( 0 => get_string('ajaxno'), 1 => get_string('ajaxyes')); - $mform->addElement('select', 'ajax', get_string('ajaxuse'), $choices); - $mform->setDefault('ajax', 1); - } - $mform->setAdvanced('ajax'); - $mform->addElement('text', 'city', get_string('city'), 'maxlength="100" size="25"'); $mform->setType('city', PARAM_MULTILANG); if (empty($CFG->defaultcity)) { diff --git a/admin/tool/xmldb/actions/XMLDBAction.class.php b/admin/tool/xmldb/actions/XMLDBAction.class.php index d984894fabf..3c7ca7a52ce 100644 --- a/admin/tool/xmldb/actions/XMLDBAction.class.php +++ b/admin/tool/xmldb/actions/XMLDBAction.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -27,35 +26,35 @@ * Main xmldb action class. It implements all the basic * functionalities to be shared by each action. * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class XMLDBAction { - var $does_generate; //Type of value returned by the invoke method - //ACTION_GENERATE_HTML have contents to show - //set by each specialized invoke + /** @var bool Type of value returned by the invoke method, ACTION_GENERATE_HTML have contents to show, set by each specialized invoke*/ + protected $does_generate; - var $title; //Title of the Action (class name, by default) - //set by parent init automatically + /** @var string Title of the Action (class name, by default), set by parent init automatically*/ + protected $title; - var $str; //Strings used by the action - //set by each specialized init, calling loadStrings + /** @var string Strings used by the action set by each specialized init, calling loadStrings*/ + protected $str; - var $output; //Output of the action - //set by each specialized invoke, get with getOutput + /** @var string Output of the action, set by each specialized invoke, get with getOutput*/ + protected $output; - var $errormsg; //Last Error produced. Check when any invoke returns false - //get with getError + /** @var string Last Error produced. Check when any invoke returns false, get with getError*/ + protected $errormsg; - var $postaction; //Action to execute at the end of the invoke script + /** @var string Action to execute at the end of the invoke script*/ + protected $postaction; - var $sesskey_protected; // Actions must be protected by sesskey mechanism + /** @var bool Actions must be protected by sesskey mechanism*/ + protected $sesskey_protected; /** - * Constructor to keep PHP5 happy + * Constructor */ function __construct() { $this->init(); @@ -76,7 +75,8 @@ class XMLDBAction { } /** - * returns the type of output of the file + * Returns the type of output of the file + * @return bool */ function getDoesGenerate() { return $this->does_generate; @@ -85,6 +85,7 @@ class XMLDBAction { /** * getError method, returns the last error string. * Used if the invoke() methods returns false + * @return string */ function getError() { return $this->errormsg; @@ -93,6 +94,7 @@ class XMLDBAction { /** * getOutput method, returns the output generated by the action. * Used after execution of the invoke() methods if they return true + * @return string */ function getOutput() { return $this->output; @@ -101,6 +103,7 @@ class XMLDBAction { /** * getPostAction method, returns the action to launch after executing * another one + * @return string */ function getPostAction() { return $this->postaction; @@ -109,6 +112,7 @@ class XMLDBAction { /** * getTitle method returns the title of the action (that is part * of the $str array attribute + * @return string */ function getTitle() { return $this->str['title']; @@ -117,6 +121,7 @@ class XMLDBAction { /** * loadStrings method, loads the required strings specified in the * array parameter + * @params array $strings */ function loadStrings($strings) { // Load some commonly used strings @@ -162,6 +167,8 @@ class XMLDBAction { /** * launch method, used to easily call invoke methods between actions + * @param string $action + * @return mixed */ function launch($action) { diff --git a/admin/tool/xmldb/actions/XMLDBCheckAction.class.php b/admin/tool/xmldb/actions/XMLDBCheckAction.class.php index 547f00e9877..06787a64256 100644 --- a/admin/tool/xmldb/actions/XMLDBCheckAction.class.php +++ b/admin/tool/xmldb/actions/XMLDBCheckAction.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2008 onwards Tim Hunt * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -25,14 +24,13 @@ * This is a base class for the various actions that interate over all the * tables and check some aspect of their definition. * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2008 onwards Tim Hunt * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ abstract class XMLDBCheckAction extends XMLDBAction { /** - * This string is displayed with a yes/no choice before the report is run. + * @var string This string is displayed with a yes/no choice before the report is run. * You must set this to the name of a lang string in xmldb.php before calling init. */ protected $introstr = ''; @@ -117,7 +115,7 @@ abstract class XMLDBCheckAction extends XMLDBAction { // Iterate over $XMLDB->dbdirs, loading their XML data to memory if ($XMLDB->dbdirs) { - $dbdirs =& $XMLDB->dbdirs; + $dbdirs = $XMLDB->dbdirs; $o='
    '; foreach ($dbdirs as $dbdir) { // Only if the directory exists diff --git a/admin/tool/xmldb/actions/check_bigints/check_bigints.class.php b/admin/tool/xmldb/actions/check_bigints/check_bigints.class.php index 18b49957366..ef7b622525d 100644 --- a/admin/tool/xmldb/actions/check_bigints/check_bigints.class.php +++ b/admin/tool/xmldb/actions/check_bigints/check_bigints.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -25,8 +24,7 @@ * reporting about the ones not physically implemented as BIGINTs * and providing one SQL script to fix all them. MDL-11038 * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/admin/tool/xmldb/actions/check_defaults/check_defaults.class.php b/admin/tool/xmldb/actions/check_defaults/check_defaults.class.php index 7365326a163..15a93651d4b 100644 --- a/admin/tool/xmldb/actions/check_defaults/check_defaults.class.php +++ b/admin/tool/xmldb/actions/check_defaults/check_defaults.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -26,8 +25,7 @@ * match those specified in the xml specs * and providing one SQL script to fix all them. * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/admin/tool/xmldb/actions/check_foreign_keys/check_foreign_keys.class.php b/admin/tool/xmldb/actions/check_foreign_keys/check_foreign_keys.class.php index 272c2855966..cd897d43124 100644 --- a/admin/tool/xmldb/actions/check_foreign_keys/check_foreign_keys.class.php +++ b/admin/tool/xmldb/actions/check_foreign_keys/check_foreign_keys.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -30,8 +29,7 @@ * Each 0 in that column will violate the foreign key, but we ignore them. * If you want a strict check performed, then add &strict=1 to the URL. * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/admin/tool/xmldb/actions/check_indexes/check_indexes.class.php b/admin/tool/xmldb/actions/check_indexes/check_indexes.class.php index 4c787fd162e..dc6ec905203 100644 --- a/admin/tool/xmldb/actions/check_indexes/check_indexes.class.php +++ b/admin/tool/xmldb/actions/check_indexes/check_indexes.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -26,8 +25,7 @@ * with the physical DB implementation, reporting about all the missing * indexes to be created to be 100% ok. * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/admin/tool/xmldb/actions/check_oracle_semantics/check_oracle_semantics.class.php b/admin/tool/xmldb/actions/check_oracle_semantics/check_oracle_semantics.class.php index 97248cd1bed..f7488c15c02 100644 --- a/admin/tool/xmldb/actions/check_oracle_semantics/check_oracle_semantics.class.php +++ b/admin/tool/xmldb/actions/check_oracle_semantics/check_oracle_semantics.class.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * @package xmldb-editor + * @package tool_xmldb * @copyright 2011 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -28,7 +28,7 @@ * them by changing to cross-db (CHAR) length semantics. * See MDL-29322 for more details. * - * @package xmldb-editor + * @package tool_xmldb * @copyright 2011 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/admin/tool/xmldb/actions/create_xml_file/create_xml_file.class.php b/admin/tool/xmldb/actions/create_xml_file/create_xml_file.class.php index 632d12ea2d0..40a93da904a 100644 --- a/admin/tool/xmldb/actions/create_xml_file/create_xml_file.class.php +++ b/admin/tool/xmldb/actions/create_xml_file/create_xml_file.class.php @@ -15,15 +15,13 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/admin/tool/xmldb/actions/delete_field/delete_field.class.php b/admin/tool/xmldb/actions/delete_field/delete_field.class.php index f2a201dc289..1d8d4148c65 100644 --- a/admin/tool/xmldb/actions/delete_field/delete_field.class.php +++ b/admin/tool/xmldb/actions/delete_field/delete_field.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -24,8 +23,7 @@ /** * This class will delete completely one field * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -96,21 +94,21 @@ class delete_field extends XMLDBAction { // Get the edited dir if (!empty($XMLDB->editeddirs)) { if (isset($XMLDB->editeddirs[$dirpath])) { - $dbdir =& $XMLDB->dbdirs[$dirpath]; - $editeddir =& $XMLDB->editeddirs[$dirpath]; + $dbdir = $XMLDB->dbdirs[$dirpath]; + $editeddir = $XMLDB->editeddirs[$dirpath]; if ($editeddir) { - $structure =& $editeddir->xml_file->getStructure(); + $structure = $editeddir->xml_file->getStructure(); // Move adjacent fields prev and next attributes - $tables =& $structure->getTables(); - $table =& $structure->getTable($tableparam); - $fields =& $table->getFields(); - $field =& $table->getField($fieldparam); + $tables = $structure->getTables(); + $table = $structure->getTable($tableparam); + $fields = $table->getFields(); + $field = $table->getField($fieldparam); if ($field->getPrevious()) { - $prev =& $table->getField($field->getPrevious()); + $prev = $table->getField($field->getPrevious()); $prev->setNext($field->getNext()); } if ($field->getNext()) { - $next =& $table->getField($field->getNext()); + $next = $table->getField($field->getNext()); $next->setPrevious($field->getPrevious()); } // Remove the field @@ -121,7 +119,7 @@ class delete_field extends XMLDBAction { // If the hash has changed from the original one, change the version // and mark the structure as changed - $origstructure =& $dbdir->xml_file->getStructure(); + $origstructure = $dbdir->xml_file->getStructure(); if ($structure->getHash() != $origstructure->getHash()) { $structure->setVersion(userdate(time(), '%Y%m%d', 99, false)); $structure->setChanged(true); diff --git a/admin/tool/xmldb/actions/delete_index/delete_index.class.php b/admin/tool/xmldb/actions/delete_index/delete_index.class.php index 05327d0d472..7dadedc95e5 100644 --- a/admin/tool/xmldb/actions/delete_index/delete_index.class.php +++ b/admin/tool/xmldb/actions/delete_index/delete_index.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -24,8 +23,7 @@ /** * This class will delete completely one index * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -96,21 +94,21 @@ class delete_index extends XMLDBAction { // Get the edited dir if (!empty($XMLDB->editeddirs)) { if (isset($XMLDB->editeddirs[$dirpath])) { - $dbdir =& $XMLDB->dbdirs[$dirpath]; - $editeddir =& $XMLDB->editeddirs[$dirpath]; + $dbdir = $XMLDB->dbdirs[$dirpath]; + $editeddir = $XMLDB->editeddirs[$dirpath]; if ($editeddir) { - $structure =& $editeddir->xml_file->getStructure(); + $structure = $editeddir->xml_file->getStructure(); // Move adjacent indexes prev and next attributes - $tables =& $structure->getTables(); - $table =& $structure->getTable($tableparam); - $indexes =& $table->getIndexes(); - $index =& $table->getIndex($indexparam); + $tables = $structure->getTables(); + $table = $structure->getTable($tableparam); + $indexes = $table->getIndexes(); + $index = $table->getIndex($indexparam); if ($index->getPrevious()) { - $prev =& $table->getIndex($index->getPrevious()); + $prev = $table->getIndex($index->getPrevious()); $prev->setNext($index->getNext()); } if ($index->getNext()) { - $next =& $table->getIndex($index->getNext()); + $next = $table->getIndex($index->getNext()); $next->setPrevious($index->getPrevious()); } // Remove the index @@ -121,7 +119,7 @@ class delete_index extends XMLDBAction { // If the hash has changed from the original one, change the version // and mark the structure as changed - $origstructure =& $dbdir->xml_file->getStructure(); + $origstructure = $dbdir->xml_file->getStructure(); if ($structure->getHash() != $origstructure->getHash()) { $structure->setVersion(userdate(time(), '%Y%m%d', 99, false)); $structure->setChanged(true); diff --git a/admin/tool/xmldb/actions/delete_key/delete_key.class.php b/admin/tool/xmldb/actions/delete_key/delete_key.class.php index 1bf9dc0ba50..3c1b232d836 100644 --- a/admin/tool/xmldb/actions/delete_key/delete_key.class.php +++ b/admin/tool/xmldb/actions/delete_key/delete_key.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -24,8 +23,7 @@ /** * This class will delete completely one key * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -96,21 +94,21 @@ class delete_key extends XMLDBAction { // Get the edited dir if (!empty($XMLDB->editeddirs)) { if (isset($XMLDB->editeddirs[$dirpath])) { - $dbdir =& $XMLDB->dbdirs[$dirpath]; - $editeddir =& $XMLDB->editeddirs[$dirpath]; + $dbdir = $XMLDB->dbdirs[$dirpath]; + $editeddir = $XMLDB->editeddirs[$dirpath]; if ($editeddir) { - $structure =& $editeddir->xml_file->getStructure(); + $structure = $editeddir->xml_file->getStructure(); // Move adjacent keys prev and next attributes - $tables =& $structure->getTables(); - $table =& $structure->getTable($tableparam); - $keys =& $table->getKeys(); - $key =& $table->getKey($keyparam); + $tables = $structure->getTables(); + $table = $structure->getTable($tableparam); + $keys = $table->getKeys(); + $key = $table->getKey($keyparam); if ($key->getPrevious()) { - $prev =& $table->getKey($key->getPrevious()); + $prev = $table->getKey($key->getPrevious()); $prev->setNext($key->getNext()); } if ($key->getNext()) { - $next =& $table->getKey($key->getNext()); + $next = $table->getKey($key->getNext()); $next->setPrevious($key->getPrevious()); } // Remove the key @@ -121,7 +119,7 @@ class delete_key extends XMLDBAction { // If the hash has changed from the original one, change the version // and mark the structure as changed - $origstructure =& $dbdir->xml_file->getStructure(); + $origstructure = $dbdir->xml_file->getStructure(); if ($structure->getHash() != $origstructure->getHash()) { $structure->setVersion(userdate(time(), '%Y%m%d', 99, false)); $structure->setChanged(true); diff --git a/admin/tool/xmldb/actions/delete_table/delete_table.class.php b/admin/tool/xmldb/actions/delete_table/delete_table.class.php index 27bcab63e15..9d32eec1d20 100644 --- a/admin/tool/xmldb/actions/delete_table/delete_table.class.php +++ b/admin/tool/xmldb/actions/delete_table/delete_table.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -24,8 +23,7 @@ /** * This class will delete completely one table * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -95,10 +93,10 @@ class delete_table extends XMLDBAction { // Get the edited dir if (!empty($XMLDB->editeddirs)) { if (isset($XMLDB->editeddirs[$dirpath])) { - $dbdir =& $XMLDB->dbdirs[$dirpath]; - $editeddir =& $XMLDB->editeddirs[$dirpath]; + $dbdir = $XMLDB->dbdirs[$dirpath]; + $editeddir = $XMLDB->editeddirs[$dirpath]; if ($editeddir) { - $structure =& $editeddir->xml_file->getStructure(); + $structure = $editeddir->xml_file->getStructure(); // Remove the table $structure->deleteTable($tableparam); } diff --git a/admin/tool/xmldb/actions/delete_xml_file/delete_xml_file.class.php b/admin/tool/xmldb/actions/delete_xml_file/delete_xml_file.class.php index c1431274981..02a2bc4182a 100644 --- a/admin/tool/xmldb/actions/delete_xml_file/delete_xml_file.class.php +++ b/admin/tool/xmldb/actions/delete_xml_file/delete_xml_file.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -24,8 +23,7 @@ /** * This class will delete completely one XML file * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -94,7 +92,7 @@ class delete_xml_file extends XMLDBAction { // Get the original dir and delete the xml file if (!empty($XMLDB->dbdirs)) { if (isset($XMLDB->dbdirs[$dirpath])) { - $dbdir =& $XMLDB->dbdirs[$dirpath]; + $dbdir = $XMLDB->dbdirs[$dirpath]; if ($dbdir) { @unlink($dirpath . '/install.xml'); } diff --git a/admin/tool/xmldb/actions/edit_field/edit_field.class.php b/admin/tool/xmldb/actions/edit_field/edit_field.class.php index f13ec300bf6..5900d3287c1 100644 --- a/admin/tool/xmldb/actions/edit_field/edit_field.class.php +++ b/admin/tool/xmldb/actions/edit_field/edit_field.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -24,8 +23,7 @@ /** * This class will provide the interface for all the edit field actions * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -75,30 +73,30 @@ class edit_field extends XMLDBAction { // Get the correct dirs if (!empty($XMLDB->dbdirs)) { - $dbdir =& $XMLDB->dbdirs[$dirpath]; + $dbdir = $XMLDB->dbdirs[$dirpath]; } else { return false; } if (!empty($XMLDB->editeddirs)) { - $editeddir =& $XMLDB->editeddirs[$dirpath]; - $structure =& $editeddir->xml_file->getStructure(); + $editeddir = $XMLDB->editeddirs[$dirpath]; + $structure = $editeddir->xml_file->getStructure(); } // Fetch request data $tableparam = required_param('table', PARAM_CLEAN); - if (!$table =& $structure->getTable($tableparam)) { + if (!$table = $structure->getTable($tableparam)) { $this->errormsg = 'Wrong table specified: ' . $tableparam; return false; } $fieldparam = required_param('field', PARAM_CLEAN); - if (!$field =& $table->getField($fieldparam)) { + if (!$field = $table->getField($fieldparam)) { // Arriving here from a name change, looking for the new field name $fieldparam = required_param('name', PARAM_CLEAN); - $field =& $table->getField($fieldparam); + $field = $table->getField($fieldparam); } - $dbdir =& $XMLDB->dbdirs[$dirpath]; - $origstructure =& $dbdir->xml_file->getStructure(); + $dbdir = $XMLDB->dbdirs[$dirpath]; + $origstructure = $dbdir->xml_file->getStructure(); $o = ''; // Output starts @@ -136,9 +134,9 @@ class edit_field extends XMLDBAction { XMLDB_TYPE_CHAR => $field->getXMLDBTypeName(XMLDB_TYPE_CHAR), XMLDB_TYPE_TEXT => $field->getXMLDBTypeName(XMLDB_TYPE_TEXT), XMLDB_TYPE_BINARY => $field->getXMLDBTypeName(XMLDB_TYPE_BINARY)); - // If current field isnt float, delete such column type to avoid its creation from the interface + // If current field isn't float, delete such column type to avoid its creation from the interface // Note that float fields are supported completely but it's possible than in a next future - // we delete them completely from Moodle DB, using, exlusively, number(x,y) types + // we delete them completely from Moodle DB, using, exclusively, number(x,y) types if ($field->getType() != XMLDB_TYPE_FLOAT) { unset ($typeoptions[XMLDB_TYPE_FLOAT]); } diff --git a/admin/tool/xmldb/actions/edit_field/edit_field.js b/admin/tool/xmldb/actions/edit_field/edit_field.js index 264c39d6dcb..e816350ad7a 100644 --- a/admin/tool/xmldb/actions/edit_field/edit_field.js +++ b/admin/tool/xmldb/actions/edit_field/edit_field.js @@ -14,8 +14,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/admin/tool/xmldb/actions/edit_field_save/edit_field_save.class.php b/admin/tool/xmldb/actions/edit_field_save/edit_field_save.class.php index 3a60be0645c..aaabf94f20f 100644 --- a/admin/tool/xmldb/actions/edit_field_save/edit_field_save.class.php +++ b/admin/tool/xmldb/actions/edit_field_save/edit_field_save.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -25,8 +24,7 @@ * This class verifies all the data introduced when editing a field for correctness, * performing changes / displaying errors depending of the results. * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -99,10 +97,10 @@ class edit_field_save extends XMLDBAction { $default = optional_param('default', NULL, PARAM_PATH); $default = trim($default); - $editeddir =& $XMLDB->editeddirs[$dirpath]; - $structure =& $editeddir->xml_file->getStructure(); - $table =& $structure->getTable($tableparam); - $field =& $table->getField($fieldparam); + $editeddir = $XMLDB->editeddirs[$dirpath]; + $structure = $editeddir->xml_file->getStructure(); + $table = $structure->getTable($tableparam); + $field = $table->getField($fieldparam); $oldhash = $field->getHash(); $errors = array(); // To store all the errors found @@ -225,12 +223,12 @@ class edit_field_save extends XMLDBAction { if ($fieldparam != $name) { $field->setName($name); if ($field->getPrevious()) { - $prev =& $table->getField($field->getPrevious()); + $prev = $table->getField($field->getPrevious()); $prev->setNext($name); $prev->setChanged(true); } if ($field->getNext()) { - $next =& $table->getField($field->getNext()); + $next = $table->getField($field->getNext()); $next->setPrevious($name); $next->setChanged(true); } diff --git a/admin/tool/xmldb/actions/edit_index/edit_index.class.php b/admin/tool/xmldb/actions/edit_index/edit_index.class.php index 87c9ebba7b7..42b020e1925 100644 --- a/admin/tool/xmldb/actions/edit_index/edit_index.class.php +++ b/admin/tool/xmldb/actions/edit_index/edit_index.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -24,7 +23,7 @@ /** * This class will provide the interface for all the edit index actions * - * @package xmldb-editor + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -73,30 +72,30 @@ class edit_index extends XMLDBAction { // Get the correct dirs if (!empty($XMLDB->dbdirs)) { - $dbdir =& $XMLDB->dbdirs[$dirpath]; + $dbdir = $XMLDB->dbdirs[$dirpath]; } else { return false; } if (!empty($XMLDB->editeddirs)) { - $editeddir =& $XMLDB->editeddirs[$dirpath]; - $structure =& $editeddir->xml_file->getStructure(); + $editeddir = $XMLDB->editeddirs[$dirpath]; + $structure = $editeddir->xml_file->getStructure(); } // Fetch request data $tableparam = required_param('table', PARAM_CLEAN); - if (!$table =& $structure->getTable($tableparam)) { + if (!$table = $structure->getTable($tableparam)) { $this->errormsg = 'Wrong table specified: ' . $tableparam; return false; } $indexparam = required_param('index', PARAM_CLEAN); - if (!$index =& $table->getIndex($indexparam)) { + if (!$index = $table->getIndex($indexparam)) { // Arriving here from a name change, looking for the new key name $indexparam = required_param('name', PARAM_CLEAN); - $index =& $table->getIndex($indexparam); + $index = $table->getIndex($indexparam); } - $dbdir =& $XMLDB->dbdirs[$dirpath]; - $origstructure =& $dbdir->xml_file->getStructure(); + $dbdir = $XMLDB->dbdirs[$dirpath]; + $origstructure = $dbdir->xml_file->getStructure(); // Add the main form $o = '
    '; diff --git a/admin/tool/xmldb/actions/edit_index_save/edit_index_save.class.php b/admin/tool/xmldb/actions/edit_index_save/edit_index_save.class.php index f6a57fa0d19..87d2804bb1f 100644 --- a/admin/tool/xmldb/actions/edit_index_save/edit_index_save.class.php +++ b/admin/tool/xmldb/actions/edit_index_save/edit_index_save.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -25,8 +24,7 @@ * This class verifies all the data introduced when editing an index for correctness, * performing changes / displaying errors depending of the results. * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -93,10 +91,10 @@ class edit_index_save extends XMLDBAction { $fields = required_param('fields', PARAM_CLEAN); $fields = str_replace(' ', '', trim(strtolower($fields))); - $editeddir =& $XMLDB->editeddirs[$dirpath]; - $structure =& $editeddir->xml_file->getStructure(); - $table =& $structure->getTable($tableparam); - $index =& $table->getIndex($indexparam); + $editeddir = $XMLDB->editeddirs[$dirpath]; + $structure = $editeddir->xml_file->getStructure(); + $table = $structure->getTable($tableparam); + $index = $table->getIndex($indexparam); $oldhash = $index->getHash(); $errors = array(); // To store all the errors found @@ -182,12 +180,12 @@ class edit_index_save extends XMLDBAction { if ($indexparam != $name) { $index->setName($name); if ($index->getPrevious()) { - $prev =& $table->getIndex($index->getPrevious()); + $prev = $table->getIndex($index->getPrevious()); $prev->setNext($name); $prev->setChanged(true); } if ($index->getNext()) { - $next =& $table->getIndex($index->getNext()); + $next = $table->getIndex($index->getNext()); $next->setPrevious($name); $next->setChanged(true); } diff --git a/admin/tool/xmldb/actions/edit_key/edit_key.class.php b/admin/tool/xmldb/actions/edit_key/edit_key.class.php index 39ee4489c75..c1d1c3b7d56 100644 --- a/admin/tool/xmldb/actions/edit_key/edit_key.class.php +++ b/admin/tool/xmldb/actions/edit_key/edit_key.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -24,8 +23,7 @@ /** * This class will provide the interface for all the edit key actions * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -74,30 +72,30 @@ class edit_key extends XMLDBAction { // Get the correct dirs if (!empty($XMLDB->dbdirs)) { - $dbdir =& $XMLDB->dbdirs[$dirpath]; + $dbdir = $XMLDB->dbdirs[$dirpath]; } else { return false; } if (!empty($XMLDB->editeddirs)) { - $editeddir =& $XMLDB->editeddirs[$dirpath]; - $structure =& $editeddir->xml_file->getStructure(); + $editeddir = $XMLDB->editeddirs[$dirpath]; + $structure = $editeddir->xml_file->getStructure(); } // Fetch request data $tableparam = required_param('table', PARAM_CLEAN); - if (!$table =& $structure->getTable($tableparam)) { + if (!$table = $structure->getTable($tableparam)) { $this->errormsg = 'Wrong table specified: ' . $tableparam; return false; } $keyparam = required_param('key', PARAM_CLEAN); - if (!$key =& $table->getKey($keyparam)) { + if (!$key = $table->getKey($keyparam)) { // Arriving here from a name change, looking for the new key name $keyparam = required_param('name', PARAM_CLEAN); - $key =& $table->getKey($keyparam); + $key = $table->getKey($keyparam); } - $dbdir =& $XMLDB->dbdirs[$dirpath]; - $origstructure =& $dbdir->xml_file->getStructure(); + $dbdir = $XMLDB->dbdirs[$dirpath]; + $origstructure = $dbdir->xml_file->getStructure(); // Add the main form $o = ''; diff --git a/admin/tool/xmldb/actions/edit_key/edit_key.js b/admin/tool/xmldb/actions/edit_key/edit_key.js index 0744f08b863..871f707ff16 100644 --- a/admin/tool/xmldb/actions/edit_key/edit_key.js +++ b/admin/tool/xmldb/actions/edit_key/edit_key.js @@ -14,8 +14,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/admin/tool/xmldb/actions/edit_key_save/edit_key_save.class.php b/admin/tool/xmldb/actions/edit_key_save/edit_key_save.class.php index 3822955834d..378754aa104 100644 --- a/admin/tool/xmldb/actions/edit_key_save/edit_key_save.class.php +++ b/admin/tool/xmldb/actions/edit_key_save/edit_key_save.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -25,8 +24,7 @@ * This class verifies all the data introduced when editing a key for correctness, * performing changes / displaying errors depending of the results. * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -106,10 +104,10 @@ class edit_key_save extends XMLDBAction { $reffields = str_replace(' ', '', trim(strtolower($reffields))); } - $editeddir =& $XMLDB->editeddirs[$dirpath]; - $structure =& $editeddir->xml_file->getStructure(); - $table =& $structure->getTable($tableparam); - $key =& $table->getKey($keyparam); + $editeddir = $XMLDB->editeddirs[$dirpath]; + $structure = $editeddir->xml_file->getStructure(); + $table = $structure->getTable($tableparam); + $key = $table->getKey($keyparam); $oldhash = $key->getHash(); $errors = array(); // To store all the errors found @@ -254,16 +252,16 @@ class edit_key_save extends XMLDBAction { // Continue if we aren't under errors if (empty($errors)) { // If there is one name change, do it, changing the prev and next - // atributes of the adjacent fields + // attributes of the adjacent fields if ($keyparam != $name) { $key->setName($name); if ($key->getPrevious()) { - $prev =& $table->getKey($key->getPrevious()); + $prev = $table->getKey($key->getPrevious()); $prev->setNext($name); $prev->setChanged(true); } if ($key->getNext()) { - $next =& $table->getKey($key->getNext()); + $next = $table->getKey($key->getNext()); $next->setPrevious($name); $next->setChanged(true); } diff --git a/admin/tool/xmldb/actions/edit_table/edit_table.class.php b/admin/tool/xmldb/actions/edit_table/edit_table.class.php index bc6afbb389f..4199a6c6f1d 100644 --- a/admin/tool/xmldb/actions/edit_table/edit_table.class.php +++ b/admin/tool/xmldb/actions/edit_table/edit_table.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -28,8 +27,7 @@ * can be invoked, plus links to PHP code generator, view SQL, rearrange * elements and so on. * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -93,7 +91,7 @@ class edit_table extends XMLDBAction { // Get the correct dirs if (!empty($XMLDB->dbdirs)) { - $dbdir =& $XMLDB->dbdirs[$dirpath]; + $dbdir = $XMLDB->dbdirs[$dirpath]; } else { return false; } @@ -104,19 +102,19 @@ class edit_table extends XMLDBAction { } if (!empty($XMLDB->editeddirs)) { - $editeddir =& $XMLDB->editeddirs[$dirpath]; - $structure =& $editeddir->xml_file->getStructure(); + $editeddir = $XMLDB->editeddirs[$dirpath]; + $structure = $editeddir->xml_file->getStructure(); } $tableparam = required_param('table', PARAM_CLEAN); - if (!$table =& $structure->getTable($tableparam)) { + if (!$table = $structure->getTable($tableparam)) { // Arriving here from a name change, looking for the new table name $tableparam = required_param('name', PARAM_CLEAN); - $table =& $structure->getTable($tableparam); + $table = $structure->getTable($tableparam); } - $dbdir =& $XMLDB->dbdirs[$dirpath]; - $origstructure =& $dbdir->xml_file->getStructure(); + $dbdir = $XMLDB->dbdirs[$dirpath]; + $origstructure = $dbdir->xml_file->getStructure(); // Add the main form $o = ''; @@ -193,7 +191,7 @@ class edit_table extends XMLDBAction { $table->deleteIndex('changeme'); // Add the fields list - $fields =& $table->getFields(); + $fields = $table->getFields(); if (!empty($fields)) { $o .= '

    ' . $this->str['fields'] . '

    '; $o .= ''; @@ -251,7 +249,7 @@ class edit_table extends XMLDBAction { $o .= '
    '; } // Add the keys list - $keys =& $table->getKeys(); + $keys = $table->getKeys(); if (!empty($keys)) { $o .= '

    ' . $this->str['keys'] . '

    '; $o .= ''; @@ -304,7 +302,7 @@ class edit_table extends XMLDBAction { $o .= '
    '; } // Add the indexes list - $indexes =& $table->getIndexes(); + $indexes = $table->getIndexes(); if (!empty($indexes)) { $o .= '

    ' . $this->str['indexes'] . '

    '; $o .= ''; diff --git a/admin/tool/xmldb/actions/edit_table_save/edit_table_save.class.php b/admin/tool/xmldb/actions/edit_table_save/edit_table_save.class.php index 3e5267d6c4c..929e26fa0f0 100644 --- a/admin/tool/xmldb/actions/edit_table_save/edit_table_save.class.php +++ b/admin/tool/xmldb/actions/edit_table_save/edit_table_save.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -24,8 +23,7 @@ /** * This class will save changes in table name and/or comments * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -81,11 +79,11 @@ class edit_table_save extends XMLDBAction { $comment = required_param('comment', PARAM_CLEAN); $comment = $comment; - $dbdir =& $XMLDB->dbdirs[$dirpath]; + $dbdir = $XMLDB->dbdirs[$dirpath]; - $editeddir =& $XMLDB->editeddirs[$dirpath]; - $structure =& $editeddir->xml_file->getStructure(); - $table =& $structure->getTable($tableparam); + $editeddir = $XMLDB->editeddirs[$dirpath]; + $structure = $editeddir->xml_file->getStructure(); + $table = $structure->getTable($tableparam); $errors = array(); // To store all the errors found @@ -120,12 +118,12 @@ class edit_table_save extends XMLDBAction { if ($tableparam != $name) { $table->setName($name); if ($table->getPrevious()) { - $prev =& $structure->getTable($table->getPrevious()); + $prev = $structure->getTable($table->getPrevious()); $prev->setNext($name); $prev->setChanged(true); } if ($table->getNext()) { - $next =& $structure->getTable($table->getNext()); + $next = $structure->getTable($table->getNext()); $next->setPrevious($name); $next->setChanged(true); } @@ -145,7 +143,7 @@ class edit_table_save extends XMLDBAction { // If the hash has changed from the original one, change the version // and mark the structure as changed - $origstructure =& $dbdir->xml_file->getStructure(); + $origstructure = $dbdir->xml_file->getStructure(); if ($structure->getHash() != $origstructure->getHash()) { $structure->setVersion(userdate(time(), '%Y%m%d', 99, false)); $structure->setChanged(true); diff --git a/admin/tool/xmldb/actions/edit_xml_file/edit_xml_file.class.php b/admin/tool/xmldb/actions/edit_xml_file/edit_xml_file.class.php index eb4d3a1bb2e..1fdd4cb1b53 100644 --- a/admin/tool/xmldb/actions/edit_xml_file/edit_xml_file.class.php +++ b/admin/tool/xmldb/actions/edit_xml_file/edit_xml_file.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -27,8 +26,7 @@ * Main page to start editing one XML file. From here it's possible to access * to tables edition plus PHP code generation and other utilities * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -90,7 +88,7 @@ class edit_xml_file extends XMLDBAction { // Get the correct dir if (!empty($XMLDB->dbdirs)) { - $dbdir =& $XMLDB->dbdirs[$dirpath]; + $dbdir = $XMLDB->dbdirs[$dirpath]; if ($dbdir) { // Only if the directory exists and it has been loaded if (!$dbdir->path_exists || !$dbdir->xml_loaded) { @@ -105,8 +103,8 @@ class edit_xml_file extends XMLDBAction { $XMLDB->editeddirs[$dirpath] = unserialize(serialize($dbdir)); } // Get it - $editeddir =& $XMLDB->editeddirs[$dirpath]; - $structure =& $editeddir->xml_file->getStructure(); + $editeddir = $XMLDB->editeddirs[$dirpath]; + $structure = $editeddir->xml_file->getStructure(); // Add the main form $o = ''; diff --git a/admin/tool/xmldb/actions/edit_xml_file_save/edit_xml_file_save.class.php b/admin/tool/xmldb/actions/edit_xml_file_save/edit_xml_file_save.class.php index 1b3cd146e7e..0a52dffab18 100644 --- a/admin/tool/xmldb/actions/edit_xml_file_save/edit_xml_file_save.class.php +++ b/admin/tool/xmldb/actions/edit_xml_file_save/edit_xml_file_save.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -24,8 +23,7 @@ /** * This class will save the changes performed to the comment of one file * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -76,16 +74,16 @@ class edit_xml_file_save extends XMLDBAction { $comment = $comment; // Set comment and recalculate hash - $editeddir =& $XMLDB->editeddirs[$dirpath]; - $structure =& $editeddir->xml_file->getStructure(); + $editeddir = $XMLDB->editeddirs[$dirpath]; + $structure = $editeddir->xml_file->getStructure(); $structure->setComment($comment); $structure->calculateHash(true); // If the hash has changed from the original one, change the version // and mark the structure as changed - $origdir =& $XMLDB->dbdirs[$dirpath]; - $origstructure =& $origdir->xml_file->getStructure(); + $origdir = $XMLDB->dbdirs[$dirpath]; + $origstructure = $origdir->xml_file->getStructure(); if ($structure->getHash() != $origstructure->getHash()) { $structure->setVersion(userdate(time(), '%Y%m%d', 99, false)); $structure->setChanged(true); diff --git a/admin/tool/xmldb/actions/generate_all_documentation/generate_all_documentation.class.php b/admin/tool/xmldb/actions/generate_all_documentation/generate_all_documentation.class.php index 14fd5d6effd..8fffd02eaeb 100644 --- a/admin/tool/xmldb/actions/generate_all_documentation/generate_all_documentation.class.php +++ b/admin/tool/xmldb/actions/generate_all_documentation/generate_all_documentation.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright (C) 2001-3001 Eloy Lafuente (stronk7) {@link http://contiento.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -25,8 +24,7 @@ * This class will produce the documentation for all the XMLDB files in the server, * via XSL, performing the output in HTML format. * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright (C) 2001-3001 Eloy Lafuente (stronk7) {@link http://contiento.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/admin/tool/xmldb/actions/generate_documentation/generate_documentation.class.php b/admin/tool/xmldb/actions/generate_documentation/generate_documentation.class.php index 4436a88ebcf..30667991f82 100644 --- a/admin/tool/xmldb/actions/generate_documentation/generate_documentation.class.php +++ b/admin/tool/xmldb/actions/generate_documentation/generate_documentation.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -24,8 +23,7 @@ /** * This class will produce XSL documentation for the loaded XML file * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/admin/tool/xmldb/actions/get_db_directories/get_db_directories.class.php b/admin/tool/xmldb/actions/get_db_directories/get_db_directories.class.php index db6ed82339c..cd1eafd45f6 100644 --- a/admin/tool/xmldb/actions/get_db_directories/get_db_directories.class.php +++ b/admin/tool/xmldb/actions/get_db_directories/get_db_directories.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -25,8 +24,7 @@ * This class will will check all the db directories existing under the * current Moodle installation, sending them to the SESSION->dbdirs array * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/admin/tool/xmldb/actions/load_xml_file/load_xml_file.class.php b/admin/tool/xmldb/actions/load_xml_file/load_xml_file.class.php index cf03bf711a5..a6384153941 100644 --- a/admin/tool/xmldb/actions/load_xml_file/load_xml_file.class.php +++ b/admin/tool/xmldb/actions/load_xml_file/load_xml_file.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -24,8 +23,7 @@ /** * This class will load one XML file to memory if necessary * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -74,7 +72,7 @@ class load_xml_file extends XMLDBAction { // Get the correct dir if (!empty($XMLDB->dbdirs)) { - $dbdir =& $XMLDB->dbdirs[$dirpath]; + $dbdir = $XMLDB->dbdirs[$dirpath]; if ($dbdir) { // Set some defaults $dbdir->xml_exists = false; diff --git a/admin/tool/xmldb/actions/load_xml_files/load_xml_files.class.php b/admin/tool/xmldb/actions/load_xml_files/load_xml_files.class.php index 967a5d45ef5..42df0b47210 100644 --- a/admin/tool/xmldb/actions/load_xml_files/load_xml_files.class.php +++ b/admin/tool/xmldb/actions/load_xml_files/load_xml_files.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -24,8 +23,7 @@ /** * This class will load every XML file to memory if necessary * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -69,7 +67,7 @@ class load_xml_files extends XMLDBAction { // Iterate over $XMLDB->dbdirs, loading their XML data to memory if ($XMLDB->dbdirs) { - $dbdirs =& $XMLDB->dbdirs; + $dbdirs = $XMLDB->dbdirs; foreach ($dbdirs as $dbdir) { // Set some defaults $dbdir->xml_exists = false; diff --git a/admin/tool/xmldb/actions/main_view/main_view.class.php b/admin/tool/xmldb/actions/main_view/main_view.class.php index 30af5871962..9d4e00222e0 100644 --- a/admin/tool/xmldb/actions/main_view/main_view.class.php +++ b/admin/tool/xmldb/actions/main_view/main_view.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -27,8 +26,7 @@ * From here, files can be created, edited, saved and deleted, plus some * extra utilities like displaying docs, xml info and performing various consistency tests * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -60,6 +58,7 @@ class main_view extends XMLDBAction { 'checkbigints' => 'tool_xmldb', 'checkoraclesemantics' => 'tool_xmldb', 'doc' => 'tool_xmldb', + 'filemodifiedoutfromeditor' => 'tool_xmldb', 'viewxml' => 'tool_xmldb', 'pendingchangescannotbesavedreload' => 'tool_xmldb' )); @@ -134,9 +133,9 @@ class main_view extends XMLDBAction { if (!isset($dbdir->has_changed) && isset($dbdir->xml_loaded)) { $dbdir->xml_changed = false; if (isset($XMLDB->editeddirs[$key])) { - $editeddir =& $XMLDB->editeddirs[$key]; + $editeddir = $XMLDB->editeddirs[$key]; if (isset($editeddir->xml_file)) { - $structure =& $editeddir->xml_file->getStructure(); + $structure = $editeddir->xml_file->getStructure(); if ($structure->hasChanged()) { $dbdir->xml_changed = true; $editeddir->xml_changed = true; @@ -196,10 +195,8 @@ class main_view extends XMLDBAction { $b .= '[' . $this->str['save'] . ']'; // Check if the file has been manually edited while being modified in the editor if ($dbdir->filemtime != filemtime($key . '/install.xml')) { - // File manually modified. Add to errors. - if ($structure =& $dbdir->xml_file->getStructure()) { - $structure->errormsg = 'Warning: File locally modified while using the XMLDB Editor. Saving will overwrite local changes'; - } + // File manually modified. Add to action error, will be displayed inline. + $this->errormsg = $this->str['filemodifiedoutfromeditor']; } } else { $b .= '[' . $this->str['save'] . ']'; @@ -267,8 +264,13 @@ class main_view extends XMLDBAction { $row = ($row + 1) % 2; // show errors if they exist if (isset($dbdir->xml_file)) { - if ($structure =& $dbdir->xml_file->getStructure()) { - if ($errors = $structure->getAllErrors()) { + if ($structure = $dbdir->xml_file->getStructure()) { + $errors = !empty($this->errormsg) ? array($this->errormsg) : array(); + $structureerrors = $structure->getAllErrors(); + if ($structureerrors) { + $errors = array_merge($errors, $structureerrors); + } + if (!empty($errors)) { if ($hithis) { $o .= ''; } else { diff --git a/admin/tool/xmldb/actions/move_updown_field/move_updown_field.class.php b/admin/tool/xmldb/actions/move_updown_field/move_updown_field.class.php index 042ed094e6b..90188a6007f 100644 --- a/admin/tool/xmldb/actions/move_updown_field/move_updown_field.class.php +++ b/admin/tool/xmldb/actions/move_updown_field/move_updown_field.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -24,8 +23,7 @@ /** * This class will will move one field up/down * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -69,13 +67,13 @@ class move_updown_field extends XMLDBAction { // Get the correct dirs if (!empty($XMLDB->dbdirs)) { - $dbdir =& $XMLDB->dbdirs[$dirpath]; + $dbdir = $XMLDB->dbdirs[$dirpath]; } else { return false; } if (!empty($XMLDB->editeddirs)) { - $editeddir =& $XMLDB->editeddirs[$dirpath]; - $structure =& $editeddir->xml_file->getStructure(); + $editeddir = $XMLDB->editeddirs[$dirpath]; + $structure = $editeddir->xml_file->getStructure(); } $prev = NULL; @@ -83,20 +81,20 @@ class move_updown_field extends XMLDBAction { $tableparam = required_param('table', PARAM_CLEAN); $fieldparam = required_param('field', PARAM_CLEAN); $direction = required_param('direction', PARAM_ALPHA); - $tables =& $structure->getTables(); - $table =& $structure->getTable($tableparam); - $fields =& $table->getFields(); + $tables = $structure->getTables(); + $table = $structure->getTable($tableparam); + $fields = $table->getFields(); if ($direction == 'down') { - $field =& $table->getField($fieldparam); - $swap =& $table->getField($field->getNext()); + $field = $table->getField($fieldparam); + $swap = $table->getField($field->getNext()); } else { - $swap =& $table->getField($fieldparam); - $field =& $table->getField($swap->getPrevious()); + $swap = $table->getField($fieldparam); + $field = $table->getField($swap->getPrevious()); } // Change the field before the pair if ($field->getPrevious()) { - $prev =& $table->getField($field->getPrevious()); + $prev = $table->getField($field->getPrevious()); $prev->setNext($swap->getName()); $swap->setPrevious($prev->getName()); $prev->setChanged(true); @@ -105,7 +103,7 @@ class move_updown_field extends XMLDBAction { } // Change the field after the pair if ($swap->getNext()) { - $next =& $table->getField($swap->getNext()); + $next = $table->getField($swap->getNext()); $next->setPrevious($field->getName()); $field->setNext($next->getName()); $next->setChanged(true); @@ -124,14 +122,14 @@ class move_updown_field extends XMLDBAction { $table->setChanged(true); // Reorder the fields - $table->orderFields($fields); + $table->orderFields(); // Recalculate the hash $structure->calculateHash(true); // If the hash has changed from the original one, change the version // and mark the structure as changed - $origstructure =& $dbdir->xml_file->getStructure(); + $origstructure = $dbdir->xml_file->getStructure(); if ($structure->getHash() != $origstructure->getHash()) { $structure->setVersion(userdate(time(), '%Y%m%d', 99, false)); $structure->setChanged(true); diff --git a/admin/tool/xmldb/actions/move_updown_index/move_updown_index.class.php b/admin/tool/xmldb/actions/move_updown_index/move_updown_index.class.php index 083d34c30f8..280adebc2aa 100644 --- a/admin/tool/xmldb/actions/move_updown_index/move_updown_index.class.php +++ b/admin/tool/xmldb/actions/move_updown_index/move_updown_index.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -24,8 +23,7 @@ /** * This class will will move one index up/down * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -69,13 +67,13 @@ class move_updown_index extends XMLDBAction { // Get the correct dirs if (!empty($XMLDB->dbdirs)) { - $dbdir =& $XMLDB->dbdirs[$dirpath]; + $dbdir = $XMLDB->dbdirs[$dirpath]; } else { return false; } if (!empty($XMLDB->editeddirs)) { - $editeddir =& $XMLDB->editeddirs[$dirpath]; - $structure =& $editeddir->xml_file->getStructure(); + $editeddir = $XMLDB->editeddirs[$dirpath]; + $structure = $editeddir->xml_file->getStructure(); } $prev = NULL; @@ -83,20 +81,20 @@ class move_updown_index extends XMLDBAction { $tableparam = required_param('table', PARAM_CLEAN); $indexparam = required_param('index', PARAM_CLEAN); $direction = required_param('direction', PARAM_ALPHA); - $tables =& $structure->getTables(); - $table =& $structure->getTable($tableparam); - $indexes =& $table->getIndexes(); + $tables = $structure->getTables(); + $table = $structure->getTable($tableparam); + $indexes = $table->getIndexes(); if ($direction == 'down') { - $index =& $table->getIndex($indexparam); - $swap =& $table->getIndex($index->getNext()); + $index = $table->getIndex($indexparam); + $swap = $table->getIndex($index->getNext()); } else { - $swap =& $table->getIndex($indexparam); - $index =& $table->getIndex($swap->getPrevious()); + $swap = $table->getIndex($indexparam); + $index = $table->getIndex($swap->getPrevious()); } // Change the index before the pair if ($index->getPrevious()) { - $prev =& $table->getIndex($index->getPrevious()); + $prev = $table->getIndex($index->getPrevious()); $prev->setNext($swap->getName()); $swap->setPrevious($prev->getName()); $prev->setChanged(true); @@ -105,7 +103,7 @@ class move_updown_index extends XMLDBAction { } // Change the field after the pair if ($swap->getNext()) { - $next =& $table->getIndex($swap->getNext()); + $next = $table->getIndex($swap->getNext()); $next->setPrevious($index->getName()); $index->setNext($next->getName()); $next->setChanged(true); @@ -124,14 +122,14 @@ class move_updown_index extends XMLDBAction { $table->setChanged(true); // Reorder the indexes - $table->orderIndexes($indexes); + $table->orderIndexes(); // Recalculate the hash $structure->calculateHash(true); // If the hash has changed from the original one, change the version // and mark the structure as changed - $origstructure =& $dbdir->xml_file->getStructure(); + $origstructure = $dbdir->xml_file->getStructure(); if ($structure->getHash() != $origstructure->getHash()) { $structure->setVersion(userdate(time(), '%Y%m%d', 99, false)); $structure->setChanged(true); diff --git a/admin/tool/xmldb/actions/move_updown_key/move_updown_key.class.php b/admin/tool/xmldb/actions/move_updown_key/move_updown_key.class.php index 018b344437e..821c867b3a8 100644 --- a/admin/tool/xmldb/actions/move_updown_key/move_updown_key.class.php +++ b/admin/tool/xmldb/actions/move_updown_key/move_updown_key.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -24,8 +23,7 @@ /** * This class will will move one key up/down * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -69,13 +67,13 @@ class move_updown_key extends XMLDBAction { // Get the correct dirs if (!empty($XMLDB->dbdirs)) { - $dbdir =& $XMLDB->dbdirs[$dirpath]; + $dbdir = $XMLDB->dbdirs[$dirpath]; } else { return false; } if (!empty($XMLDB->editeddirs)) { - $editeddir =& $XMLDB->editeddirs[$dirpath]; - $structure =& $editeddir->xml_file->getStructure(); + $editeddir = $XMLDB->editeddirs[$dirpath]; + $structure = $editeddir->xml_file->getStructure(); } $prev = NULL; @@ -83,20 +81,20 @@ class move_updown_key extends XMLDBAction { $tableparam = required_param('table', PARAM_CLEAN); $keyparam = required_param('key', PARAM_CLEAN); $direction = required_param('direction', PARAM_ALPHA); - $tables =& $structure->getTables(); - $table =& $structure->getTable($tableparam); - $keys =& $table->getKeys(); + $tables = $structure->getTables(); + $table = $structure->getTable($tableparam); + $keys = $table->getKeys(); if ($direction == 'down') { - $key =& $table->getKey($keyparam); - $swap =& $table->getKey($key->getNext()); + $key = $table->getKey($keyparam); + $swap = $table->getKey($key->getNext()); } else { - $swap =& $table->getKey($keyparam); - $key =& $table->getKey($swap->getPrevious()); + $swap = $table->getKey($keyparam); + $key = $table->getKey($swap->getPrevious()); } // Change the key before the pair if ($key->getPrevious()) { - $prev =& $table->getKey($key->getPrevious()); + $prev = $table->getKey($key->getPrevious()); $prev->setNext($swap->getName()); $swap->setPrevious($prev->getName()); $prev->setChanged(true); @@ -105,7 +103,7 @@ class move_updown_key extends XMLDBAction { } // Change the key after the pair if ($swap->getNext()) { - $next =& $table->getKey($swap->getNext()); + $next = $table->getKey($swap->getNext()); $next->setPrevious($key->getName()); $key->setNext($next->getName()); $next->setChanged(true); @@ -124,14 +122,14 @@ class move_updown_key extends XMLDBAction { $table->setChanged(true); // Reorder the keys - $table->orderKeys($keys); + $table->orderKeys(); // Recalculate the hash $structure->calculateHash(true); // If the hash has changed from the original one, change the version // and mark the structure as changed - $origstructure =& $dbdir->xml_file->getStructure(); + $origstructure = $dbdir->xml_file->getStructure(); if ($structure->getHash() != $origstructure->getHash()) { $structure->setVersion(userdate(time(), '%Y%m%d', 99, false)); $structure->setChanged(true); diff --git a/admin/tool/xmldb/actions/move_updown_table/move_updown_table.class.php b/admin/tool/xmldb/actions/move_updown_table/move_updown_table.class.php index 6af0ae41536..61bec04908b 100644 --- a/admin/tool/xmldb/actions/move_updown_table/move_updown_table.class.php +++ b/admin/tool/xmldb/actions/move_updown_table/move_updown_table.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -24,8 +23,7 @@ /** * This class will will move table up/down * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -69,31 +67,31 @@ class move_updown_table extends XMLDBAction { // Get the correct dirs if (!empty($XMLDB->dbdirs)) { - $dbdir =& $XMLDB->dbdirs[$dirpath]; + $dbdir = $XMLDB->dbdirs[$dirpath]; } else { return false; } if (!empty($XMLDB->editeddirs)) { - $editeddir =& $XMLDB->editeddirs[$dirpath]; - $structure =& $editeddir->xml_file->getStructure(); + $editeddir = $XMLDB->editeddirs[$dirpath]; + $structure = $editeddir->xml_file->getStructure(); } $prev = NULL; $next = NULL; $tableparam = required_param('table', PARAM_CLEAN); $direction = required_param('direction', PARAM_ALPHA); - $tables =& $structure->getTables(); + $tables = $structure->getTables(); if ($direction == 'down') { - $table =& $structure->getTable($tableparam); - $swap =& $structure->getTable($table->getNext()); + $table = $structure->getTable($tableparam); + $swap = $structure->getTable($table->getNext()); } else { - $swap =& $structure->getTable($tableparam); - $table =& $structure->getTable($swap->getPrevious()); + $swap = $structure->getTable($tableparam); + $table = $structure->getTable($swap->getPrevious()); } // Change the table before the pair if ($table->getPrevious()) { - $prev =& $structure->getTable($table->getPrevious()); + $prev = $structure->getTable($table->getPrevious()); $prev->setNext($swap->getName()); $swap->setPrevious($prev->getName()); $prev->setChanged(true); @@ -102,7 +100,7 @@ class move_updown_table extends XMLDBAction { } // Change the table after the pair if ($swap->getNext()) { - $next =& $structure->getTable($swap->getNext()); + $next = $structure->getTable($swap->getNext()); $next->setPrevious($table->getName()); $table->setNext($next->getName()); $next->setChanged(true); @@ -117,15 +115,14 @@ class move_updown_table extends XMLDBAction { $table->setChanged(true); // Reorder the structure - $structure->orderTables($tables); - // Send tables back to structure (the order above break refs) - $structure->setTables($tables); + $structure->orderTables(); + // Recalculate the hash $structure->calculateHash(true); // If the hash has changed from the original one, change the version // and mark the structure as changed - $origstructure =& $dbdir->xml_file->getStructure(); + $origstructure = $dbdir->xml_file->getStructure(); if ($structure->getHash() != $origstructure->getHash()) { $structure->setVersion(userdate(time(), '%Y%m%d', 99, false)); $structure->setChanged(true); diff --git a/admin/tool/xmldb/actions/new_field/new_field.class.php b/admin/tool/xmldb/actions/new_field/new_field.class.php index 6e8ff0f07ac..66fc2de4fe4 100644 --- a/admin/tool/xmldb/actions/new_field/new_field.class.php +++ b/admin/tool/xmldb/actions/new_field/new_field.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -24,8 +23,7 @@ /** * This class will create a new default field to be edited * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -69,23 +67,23 @@ class new_field extends XMLDBAction { // Get the correct dirs if (!empty($XMLDB->dbdirs)) { - $dbdir =& $XMLDB->dbdirs[$dirpath]; + $dbdir = $XMLDB->dbdirs[$dirpath]; } else { return false; } if (!empty($XMLDB->editeddirs)) { - $editeddir =& $XMLDB->editeddirs[$dirpath]; - $structure =& $editeddir->xml_file->getStructure(); + $editeddir = $XMLDB->editeddirs[$dirpath]; + $structure = $editeddir->xml_file->getStructure(); } $tableparam = required_param('table', PARAM_CLEAN); - $table =& $structure->getTable($tableparam); + $table = $structure->getTable($tableparam); // If the changeme field exists, just get it and continue $changeme_exists = false; - if ($fields =& $table->getFields()) { - if ($field =& $table->getField('changeme')) { + if ($fields = $table->getFields()) { + if ($field = $table->getField('changeme')) { $changeme_exists = true; } } diff --git a/admin/tool/xmldb/actions/new_index/new_index.class.php b/admin/tool/xmldb/actions/new_index/new_index.class.php index 500ff96d37c..4d829061430 100644 --- a/admin/tool/xmldb/actions/new_index/new_index.class.php +++ b/admin/tool/xmldb/actions/new_index/new_index.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -24,8 +23,7 @@ /** * This class will create a new default index to be edited * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -69,23 +67,23 @@ class new_index extends XMLDBAction { // Get the correct dirs if (!empty($XMLDB->dbdirs)) { - $dbdir =& $XMLDB->dbdirs[$dirpath]; + $dbdir = $XMLDB->dbdirs[$dirpath]; } else { return false; } if (!empty($XMLDB->editeddirs)) { - $editeddir =& $XMLDB->editeddirs[$dirpath]; - $structure =& $editeddir->xml_file->getStructure(); + $editeddir = $XMLDB->editeddirs[$dirpath]; + $structure = $editeddir->xml_file->getStructure(); } $tableparam = required_param('table', PARAM_CLEAN); - $table =& $structure->getTable($tableparam); + $table = $structure->getTable($tableparam); // If the changeme index exists, just get it and continue $changeme_exists = false; - if ($indexes =& $table->getIndexes()) { - if ($index =& $table->getIndex('changeme')) { + if ($indexes = $table->getIndexes()) { + if ($index = $table->getIndex('changeme')) { $changeme_exists = true; } } diff --git a/admin/tool/xmldb/actions/new_key/new_key.class.php b/admin/tool/xmldb/actions/new_key/new_key.class.php index e19aa720323..3499a0033eb 100644 --- a/admin/tool/xmldb/actions/new_key/new_key.class.php +++ b/admin/tool/xmldb/actions/new_key/new_key.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -24,8 +23,7 @@ /** * This class will create a new default key to be edited * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -69,23 +67,23 @@ class new_key extends XMLDBAction { // Get the correct dirs if (!empty($XMLDB->dbdirs)) { - $dbdir =& $XMLDB->dbdirs[$dirpath]; + $dbdir = $XMLDB->dbdirs[$dirpath]; } else { return false; } if (!empty($XMLDB->editeddirs)) { - $editeddir =& $XMLDB->editeddirs[$dirpath]; - $structure =& $editeddir->xml_file->getStructure(); + $editeddir = $XMLDB->editeddirs[$dirpath]; + $structure = $editeddir->xml_file->getStructure(); } $tableparam = required_param('table', PARAM_CLEAN); - $table =& $structure->getTable($tableparam); + $table = $structure->getTable($tableparam); // If the changeme key exists, just get it and continue $changeme_exists = false; - if ($keys =& $table->getKeys()) { - if ($key =& $table->getKey('changeme')) { + if ($keys = $table->getKeys()) { + if ($key = $table->getKey('changeme')) { $changeme_exists = true; } } diff --git a/admin/tool/xmldb/actions/new_table/new_table.class.php b/admin/tool/xmldb/actions/new_table/new_table.class.php index cfdb38522ba..276b263ec13 100644 --- a/admin/tool/xmldb/actions/new_table/new_table.class.php +++ b/admin/tool/xmldb/actions/new_table/new_table.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -24,8 +23,7 @@ /** * This class will create a new default table to be edited * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -69,19 +67,19 @@ class new_table extends XMLDBAction { // Get the correct dirs if (!empty($XMLDB->dbdirs)) { - $dbdir =& $XMLDB->dbdirs[$dirpath]; + $dbdir = $XMLDB->dbdirs[$dirpath]; } else { return false; } if (!empty($XMLDB->editeddirs)) { - $editeddir =& $XMLDB->editeddirs[$dirpath]; - $structure =& $editeddir->xml_file->getStructure(); + $editeddir = $XMLDB->editeddirs[$dirpath]; + $structure = $editeddir->xml_file->getStructure(); } // If the changeme table exists, just get it and continue $changeme_exists = false; - if ($tables =& $structure->getTables()) { - if ($table =& $structure->getTable('changeme')) { + if ($tables = $structure->getTables()) { + if ($table = $structure->getTable('changeme')) { $changeme_exists = true; } } diff --git a/admin/tool/xmldb/actions/new_table_from_mysql/new_table_from_mysql.class.php b/admin/tool/xmldb/actions/new_table_from_mysql/new_table_from_mysql.class.php index 1473cc45267..4dca286a024 100644 --- a/admin/tool/xmldb/actions/new_table_from_mysql/new_table_from_mysql.class.php +++ b/admin/tool/xmldb/actions/new_table_from_mysql/new_table_from_mysql.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -25,8 +24,7 @@ * This class will ask and retrofit all the information from one * mysql table present in the Moodle DB to one xmldb_table structure * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -72,13 +70,13 @@ class new_table_from_mysql extends XMLDBAction { // Get the correct dirs if (!empty($XMLDB->dbdirs)) { - $dbdir =& $XMLDB->dbdirs[$dirpath]; + $dbdir = $XMLDB->dbdirs[$dirpath]; } else { return false; } if (!empty($XMLDB->editeddirs)) { - $editeddir =& $XMLDB->editeddirs[$dirpath]; - $structure =& $editeddir->xml_file->getStructure(); + $editeddir = $XMLDB->editeddirs[$dirpath]; + $structure = $editeddir->xml_file->getStructure(); } $tableparam = optional_param('table', NULL, PARAM_CLEAN); @@ -98,7 +96,7 @@ class new_table_from_mysql extends XMLDBAction { } // Get list of after tables $aftertables = array(); - if ($tables =& $structure->getTables()) { + if ($tables = $structure->getTables()) { foreach ($tables as $aftertable) { $aftertables[$aftertable->getName()] = $aftertable->getName(); } diff --git a/admin/tool/xmldb/actions/revert_changes/revert_changes.class.php b/admin/tool/xmldb/actions/revert_changes/revert_changes.class.php index 6a9b6d9ad9e..a9d1ef987f4 100644 --- a/admin/tool/xmldb/actions/revert_changes/revert_changes.class.php +++ b/admin/tool/xmldb/actions/revert_changes/revert_changes.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -24,8 +23,7 @@ /** * This class will revert changes (delete the editeddb) * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -94,7 +92,7 @@ class revert_changes extends XMLDBAction { // Get the original dir and delete some elements if (!empty($XMLDB->dbdirs)) { if (isset($XMLDB->dbdirs[$dirpath])) { - $dbdir =& $XMLDB->dbdirs[$dirpath]; + $dbdir = $XMLDB->dbdirs[$dirpath]; if ($dbdir) { unset($dbdir->xml_changed); } diff --git a/admin/tool/xmldb/actions/save_xml_file/save_xml_file.class.php b/admin/tool/xmldb/actions/save_xml_file/save_xml_file.class.php index 79bfb9537e9..c1ca3725ef7 100644 --- a/admin/tool/xmldb/actions/save_xml_file/save_xml_file.class.php +++ b/admin/tool/xmldb/actions/save_xml_file/save_xml_file.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -29,8 +28,7 @@ * is going to continue (unload=false). Else (default) the * file is unloaded once saved. * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -76,18 +74,18 @@ class save_xml_file extends XMLDBAction { // Get the edited dir if (!empty($XMLDB->editeddirs)) { if (isset($XMLDB->editeddirs[$dirpath])) { - $editeddir =& $XMLDB->editeddirs[$dirpath]; + $editeddir = $XMLDB->editeddirs[$dirpath]; } } // Copy the edited dir over the original one if (!empty($XMLDB->dbdirs)) { if (isset($XMLDB->dbdirs[$dirpath])) { $XMLDB->dbdirs[$dirpath] = unserialize(serialize($editeddir)); - $dbdir =& $XMLDB->dbdirs[$dirpath]; + $dbdir = $XMLDB->dbdirs[$dirpath]; } } - // Chech for perms + // Check for perms if (!is_writeable($dirpath . '/install.xml')) { $this->errormsg = $this->str['filenotwriteable'] . '(' . $dirpath . '/install.xml)'; return false; diff --git a/admin/tool/xmldb/actions/template/template.class.php b/admin/tool/xmldb/actions/template/template.class.php index ad171f8b955..07ab9c13228 100644 --- a/admin/tool/xmldb/actions/template/template.class.php +++ b/admin/tool/xmldb/actions/template/template.class.php @@ -15,15 +15,13 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -68,13 +66,13 @@ class template extends XMLDBAction { // Get the correct dirs if (!empty($XMLDB->dbdirs)) { - $dbdir =& $XMLDB->dbdirs[$dirpath]; + $dbdir = $XMLDB->dbdirs[$dirpath]; } else { return false; } if (!empty($XMLDB->editeddirs)) { - $editeddir =& $XMLDB->editeddirs[$dirpath]; - $structure =& $editeddir->xml_file->getStructure(); + $editeddir = $XMLDB->editeddirs[$dirpath]; + $structure = $editeddir->xml_file->getStructure(); } // ADD YOUR CODE HERE diff --git a/admin/tool/xmldb/actions/unload_xml_file/unload_xml_file.class.php b/admin/tool/xmldb/actions/unload_xml_file/unload_xml_file.class.php index 8a454cabc6e..0468cb2ca5d 100644 --- a/admin/tool/xmldb/actions/unload_xml_file/unload_xml_file.class.php +++ b/admin/tool/xmldb/actions/unload_xml_file/unload_xml_file.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -24,8 +23,7 @@ /** * This class will unload one loaded file completely * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -71,7 +69,7 @@ class unload_xml_file extends XMLDBAction { // Get the original dir and delete some elements if (!empty($XMLDB->dbdirs)) { if (isset($XMLDB->dbdirs[$dirpath])) { - $dbdir =& $XMLDB->dbdirs[$dirpath]; + $dbdir = $XMLDB->dbdirs[$dirpath]; if ($dbdir) { unset($dbdir->xml_file); unset($dbdir->xml_loaded); diff --git a/admin/tool/xmldb/actions/view_field_xml/view_field_xml.class.php b/admin/tool/xmldb/actions/view_field_xml/view_field_xml.class.php index f745c0fc992..92d5d36afd3 100644 --- a/admin/tool/xmldb/actions/view_field_xml/view_field_xml.class.php +++ b/admin/tool/xmldb/actions/view_field_xml/view_field_xml.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -24,8 +23,7 @@ /** * This class will display the XML for one field being edited * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -75,11 +73,11 @@ class view_field_xml extends XMLDBAction { // Get the correct dir if ($select == 'original') { if (!empty($XMLDB->dbdirs)) { - $base =& $XMLDB->dbdirs[$dirpath]; + $base = $XMLDB->dbdirs[$dirpath]; } } else if ($select == 'edited') { if (!empty($XMLDB->editeddirs)) { - $base =& $XMLDB->editeddirs[$dirpath]; + $base = $XMLDB->editeddirs[$dirpath]; } } else { $this->errormsg = 'Cannot access to ' . $select . ' info'; @@ -98,14 +96,14 @@ class view_field_xml extends XMLDBAction { // Get the structure if ($result) { - if (!$structure =& $base->xml_file->getStructure()) { + if (!$structure = $base->xml_file->getStructure()) { $this->errormsg = 'Error retrieving ' . $select . ' structure'; $result = false; } } // Get the tables if ($result) { - if (!$tables =& $structure->getTables()) { + if (!$tables = $structure->getTables()) { $this->errormsg = 'Error retrieving ' . $select . ' tables'; $result = false; } @@ -117,7 +115,7 @@ class view_field_xml extends XMLDBAction { } // Get the fields if ($result) { - if (!$fields =& $t->getFields()) { + if (!$fields = $t->getFields()) { $this->errormsg = 'Error retrieving ' . $select . ' fields'; $result = false; } diff --git a/admin/tool/xmldb/actions/view_index_xml/view_index_xml.class.php b/admin/tool/xmldb/actions/view_index_xml/view_index_xml.class.php index 82d5ec03461..568377c1687 100644 --- a/admin/tool/xmldb/actions/view_index_xml/view_index_xml.class.php +++ b/admin/tool/xmldb/actions/view_index_xml/view_index_xml.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -24,8 +23,7 @@ /** * This class will display the XML for one index being edited * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -75,11 +73,11 @@ class view_index_xml extends XMLDBAction { // Get the correct dir if ($select == 'original') { if (!empty($XMLDB->dbdirs)) { - $base =& $XMLDB->dbdirs[$dirpath]; + $base = $XMLDB->dbdirs[$dirpath]; } } else if ($select == 'edited') { if (!empty($XMLDB->editeddirs)) { - $base =& $XMLDB->editeddirs[$dirpath]; + $base = $XMLDB->editeddirs[$dirpath]; } } else { $this->errormsg = 'Cannot access to ' . $select . ' info'; @@ -98,26 +96,26 @@ class view_index_xml extends XMLDBAction { // Get the structure if ($result) { - if (!$structure =& $base->xml_file->getStructure()) { + if (!$structure = $base->xml_file->getStructure()) { $this->errormsg = 'Error retrieving ' . $select . ' structure'; $result = false; } } // Get the tables if ($result) { - if (!$tables =& $structure->getTables()) { + if (!$tables = $structure->getTables()) { $this->errormsg = 'Error retrieving ' . $select . ' tables'; $result = false; } } // Get the table - if ($result && !$t =& $structure->getTable($table)) { + if ($result && !$t = $structure->getTable($table)) { $this->errormsg = 'Error retrieving ' . $table . ' table'; $result = false; } // Get the indexes if ($result) { - if (!$indexes =& $t->getIndexes()) { + if (!$indexes = $t->getIndexes()) { $this->errormsg = 'Error retrieving ' . $select . ' indexes'; $result = false; } diff --git a/admin/tool/xmldb/actions/view_key_xml/view_key_xml.class.php b/admin/tool/xmldb/actions/view_key_xml/view_key_xml.class.php index e3e9f6e6399..408fe1a4d1f 100644 --- a/admin/tool/xmldb/actions/view_key_xml/view_key_xml.class.php +++ b/admin/tool/xmldb/actions/view_key_xml/view_key_xml.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -24,8 +23,7 @@ /** * This class will display the XML for one key being edited * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -75,11 +73,11 @@ class view_key_xml extends XMLDBAction { // Get the correct dir if ($select == 'original') { if (!empty($XMLDB->dbdirs)) { - $base =& $XMLDB->dbdirs[$dirpath]; + $base = $XMLDB->dbdirs[$dirpath]; } } else if ($select == 'edited') { if (!empty($XMLDB->editeddirs)) { - $base =& $XMLDB->editeddirs[$dirpath]; + $base = $XMLDB->editeddirs[$dirpath]; } } else { $this->errormsg = 'Cannot access to ' . $select . ' info'; @@ -98,26 +96,26 @@ class view_key_xml extends XMLDBAction { // Get the structure if ($result) { - if (!$structure =& $base->xml_file->getStructure()) { + if (!$structure = $base->xml_file->getStructure()) { $this->errormsg = 'Error retrieving ' . $select . ' structure'; $result = false; } } // Get the tables if ($result) { - if (!$tables =& $structure->getTables()) { + if (!$tables = $structure->getTables()) { $this->errormsg = 'Error retrieving ' . $select . ' tables'; $result = false; } } // Get the table - if ($result && !$t =& $structure->getTable($table)) { + if ($result && !$t = $structure->getTable($table)) { $this->errormsg = 'Error retrieving ' . $table . ' table'; $result = false; } // Get the keys if ($result) { - if (!$keys =& $t->getKeys()) { + if (!$keys = $t->getKeys()) { $this->errormsg = 'Error retrieving ' . $select . ' keys'; $result = false; } diff --git a/admin/tool/xmldb/actions/view_reserved_words/view_reserved_words.class.php b/admin/tool/xmldb/actions/view_reserved_words/view_reserved_words.class.php index 3fcdc96b0d2..2d40ea1d0ed 100644 --- a/admin/tool/xmldb/actions/view_reserved_words/view_reserved_words.class.php +++ b/admin/tool/xmldb/actions/view_reserved_words/view_reserved_words.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -27,8 +26,7 @@ * http://docs.moodle.org/en/Database_reserved_words * Also, it introspects te DB looking for such words and informing about * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/admin/tool/xmldb/actions/view_structure_php/view_structure_php.class.php b/admin/tool/xmldb/actions/view_structure_php/view_structure_php.class.php index 5d98a3ac9cf..11d779cf008 100644 --- a/admin/tool/xmldb/actions/view_structure_php/view_structure_php.class.php +++ b/admin/tool/xmldb/actions/view_structure_php/view_structure_php.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -25,8 +24,7 @@ * This class will show the PHP needed (upgrade block) to perform * the desired DDL action with the specified table * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -73,16 +71,16 @@ class view_structure_php extends XMLDBAction { // Get the correct dirs if (!empty($XMLDB->dbdirs)) { - $dbdir =& $XMLDB->dbdirs[$dirpath]; + $dbdir = $XMLDB->dbdirs[$dirpath]; } else { return false; } if (!empty($XMLDB->editeddirs)) { - $editeddir =& $XMLDB->editeddirs[$dirpath]; - $structure =& $editeddir->xml_file->getStructure(); + $editeddir = $XMLDB->editeddirs[$dirpath]; + $structure = $editeddir->xml_file->getStructure(); } - $tables =& $structure->getTables(); + $tables = $structure->getTables(); $table = reset($tables); $defaulttable = null; if ($table) { diff --git a/admin/tool/xmldb/actions/view_structure_sql/view_structure_sql.class.php b/admin/tool/xmldb/actions/view_structure_sql/view_structure_sql.class.php index 55158de5110..377b915e8c1 100644 --- a/admin/tool/xmldb/actions/view_structure_sql/view_structure_sql.class.php +++ b/admin/tool/xmldb/actions/view_structure_sql/view_structure_sql.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -25,8 +24,7 @@ * This class will show the SQL generated for the selected RDBMS for * the entire XMLDB file * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -72,13 +70,13 @@ class view_structure_sql extends XMLDBAction { // Get the correct dirs if (!empty($XMLDB->dbdirs)) { - $dbdir =& $XMLDB->dbdirs[$dirpath]; + $dbdir = $XMLDB->dbdirs[$dirpath]; } else { return false; } if (!empty($XMLDB->editeddirs)) { - $editeddir =& $XMLDB->editeddirs[$dirpath]; - $structure =& $editeddir->xml_file->getStructure(); + $editeddir = $XMLDB->editeddirs[$dirpath]; + $structure = $editeddir->xml_file->getStructure(); } // The back to edit table button diff --git a/admin/tool/xmldb/actions/view_structure_xml/view_structure_xml.class.php b/admin/tool/xmldb/actions/view_structure_xml/view_structure_xml.class.php index a0c66c6be81..31b948c4a4a 100644 --- a/admin/tool/xmldb/actions/view_structure_xml/view_structure_xml.class.php +++ b/admin/tool/xmldb/actions/view_structure_xml/view_structure_xml.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -24,8 +23,7 @@ /** * This class will display the XML for one structure * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -73,11 +71,11 @@ class view_structure_xml extends XMLDBAction { // Get the correct dir if ($select == 'original') { if (!empty($XMLDB->dbdirs)) { - $base =& $XMLDB->dbdirs[$dirpath]; + $base = $XMLDB->dbdirs[$dirpath]; } } else if ($select == 'edited') { if (!empty($XMLDB->editeddirs)) { - $base =& $XMLDB->editeddirs[$dirpath]; + $base = $XMLDB->editeddirs[$dirpath]; } } else { $this->errormsg = 'Cannot access to ' . $select . ' info'; @@ -96,7 +94,7 @@ class view_structure_xml extends XMLDBAction { // Get the structure if ($result) { - if (!$structure =& $base->xml_file->getStructure()) { + if (!$structure = $base->xml_file->getStructure()) { $this->errormsg = 'Error retrieving ' . $select . ' structure'; $result = false; } diff --git a/admin/tool/xmldb/actions/view_table_php/view_table_php.class.php b/admin/tool/xmldb/actions/view_table_php/view_table_php.class.php index 7ce215793fe..132c881bc10 100644 --- a/admin/tool/xmldb/actions/view_table_php/view_table_php.class.php +++ b/admin/tool/xmldb/actions/view_table_php/view_table_php.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -25,8 +24,7 @@ * This class will show the PHP needed (upgrade block) to perform * the desired DDL action with the specified field/key/index * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -79,18 +77,18 @@ class view_table_php extends XMLDBAction { // Get the correct dirs if (!empty($XMLDB->dbdirs)) { - $dbdir =& $XMLDB->dbdirs[$dirpath]; + $dbdir = $XMLDB->dbdirs[$dirpath]; } else { return false; } if (!empty($XMLDB->editeddirs)) { - $editeddir =& $XMLDB->editeddirs[$dirpath]; - $structure =& $editeddir->xml_file->getStructure(); + $editeddir = $XMLDB->editeddirs[$dirpath]; + $structure = $editeddir->xml_file->getStructure(); } $tableparam = required_param('table', PARAM_PATH); - $table =& $structure->getTable($tableparam); + $table = $structure->getTable($tableparam); $fields = $table->getFields(); $field = reset($fields); $defaultfieldkeyindex = null; diff --git a/admin/tool/xmldb/actions/view_table_php/view_table_php.js b/admin/tool/xmldb/actions/view_table_php/view_table_php.js index 49aafa4a293..59a76f0ddee 100644 --- a/admin/tool/xmldb/actions/view_table_php/view_table_php.js +++ b/admin/tool/xmldb/actions/view_table_php/view_table_php.js @@ -14,8 +14,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/admin/tool/xmldb/actions/view_table_sql/view_table_sql.class.php b/admin/tool/xmldb/actions/view_table_sql/view_table_sql.class.php index 0f45fb502ca..a3f25660e36 100644 --- a/admin/tool/xmldb/actions/view_table_sql/view_table_sql.class.php +++ b/admin/tool/xmldb/actions/view_table_sql/view_table_sql.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -25,8 +24,7 @@ * This class will show the SQL generated for the selected RDBMS for * one table * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -72,13 +70,13 @@ class view_table_sql extends XMLDBAction { // Get the correct dirs if (!empty($XMLDB->dbdirs)) { - $dbdir =& $XMLDB->dbdirs[$dirpath]; + $dbdir = $XMLDB->dbdirs[$dirpath]; } else { return false; } if (!empty($XMLDB->editeddirs)) { - $editeddir =& $XMLDB->editeddirs[$dirpath]; - $structure =& $editeddir->xml_file->getStructure(); + $editeddir = $XMLDB->editeddirs[$dirpath]; + $structure = $editeddir->xml_file->getStructure(); } // Get parameters diff --git a/admin/tool/xmldb/actions/view_table_xml/view_table_xml.class.php b/admin/tool/xmldb/actions/view_table_xml/view_table_xml.class.php index 1c7cc635073..90d74866ad1 100644 --- a/admin/tool/xmldb/actions/view_table_xml/view_table_xml.class.php +++ b/admin/tool/xmldb/actions/view_table_xml/view_table_xml.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -24,8 +23,7 @@ /** * This class will display the XML for one table being edited * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -74,11 +72,11 @@ class view_table_xml extends XMLDBAction { // Get the correct dir if ($select == 'original') { if (!empty($XMLDB->dbdirs)) { - $base =& $XMLDB->dbdirs[$dirpath]; + $base = $XMLDB->dbdirs[$dirpath]; } } else if ($select == 'edited') { if (!empty($XMLDB->editeddirs)) { - $base =& $XMLDB->editeddirs[$dirpath]; + $base = $XMLDB->editeddirs[$dirpath]; } } else { $this->errormsg = 'Cannot access to ' . $select . ' info'; @@ -97,20 +95,20 @@ class view_table_xml extends XMLDBAction { // Get the structure if ($result) { - if (!$structure =& $base->xml_file->getStructure()) { + if (!$structure = $base->xml_file->getStructure()) { $this->errormsg = 'Error retrieving ' . $select . ' structure'; $result = false; } } // Get the tables if ($result) { - if (!$tables =& $structure->getTables()) { + if (!$tables = $structure->getTables()) { $this->errormsg = 'Error retrieving ' . $select . ' tables'; $result = false; } } // Get the table - if ($result && !$t =& $structure->getTable($table)) { + if ($result && !$t = $structure->getTable($table)) { $this->errormsg = 'Error retrieving ' . $table . ' table'; $result = false; } diff --git a/admin/tool/xmldb/actions/view_xml/view_xml.class.php b/admin/tool/xmldb/actions/view_xml/view_xml.class.php index 9b3fb031050..9e6bd0c909f 100644 --- a/admin/tool/xmldb/actions/view_xml/view_xml.class.php +++ b/admin/tool/xmldb/actions/view_xml/view_xml.class.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -24,8 +23,7 @@ /** * This class will display one XML file * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -53,6 +51,7 @@ class view_xml extends XMLDBAction { * Invoke method, every class will have its own * returns true/false on completion, setting both * errormsg and output as necessary + * @return mixed */ function invoke() { parent::invoke(); diff --git a/admin/tool/xmldb/index.php b/admin/tool/xmldb/index.php index 76495e3055a..e5a61477e45 100644 --- a/admin/tool/xmldb/index.php +++ b/admin/tool/xmldb/index.php @@ -18,109 +18,108 @@ * This is the main script for the complete XMLDB interface. From here * all the actions supported will be launched. * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com, * (C) 2001-3001 Eloy Lafuente (stronk7) http://contiento.com * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ - require('../../../config.php'); - require_once($CFG->libdir.'/adminlib.php'); - require_once($CFG->libdir.'/ddllib.php'); - // Add required XMLDB action classes - require_once('actions/XMLDBAction.class.php'); - require_once('actions/XMLDBCheckAction.class.php'); +require('../../../config.php'); +require_once($CFG->libdir.'/adminlib.php'); +require_once($CFG->libdir.'/ddllib.php'); +// Add required XMLDB action classes +require_once('actions/XMLDBAction.class.php'); +require_once('actions/XMLDBCheckAction.class.php'); - admin_externalpage_setup('toolxmld'); +admin_externalpage_setup('toolxmld'); - // Add other used libraries - require_once($CFG->libdir . '/xmlize.php'); +// Add other used libraries +require_once($CFG->libdir . '/xmlize.php'); - // Handle session data - global $XMLDB; +// Handle session data +global $XMLDB; - // State is stored in session - we have to serialise it because the classes are not loaded when creating session - if (!isset($SESSION->xmldb)) { - $XMLDB = new stdClass; - } else { - $XMLDB = unserialize($SESSION->xmldb); - } +// State is stored in session - we have to serialise it because the classes are not loaded when creating session +if (!isset($SESSION->xmldb)) { + $XMLDB = new stdClass; +} else { + $XMLDB = unserialize($SESSION->xmldb); +} - // Some previous checks - $site = get_site(); +// Some previous checks +$site = get_site(); - require_login(); - require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM)); +require_login(); +require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM)); - // Body of the script, based on action, we delegate the work - $action = optional_param ('action', 'main_view', PARAM_ALPHAEXT); +// Body of the script, based on action, we delegate the work +$action = optional_param ('action', 'main_view', PARAM_ALPHAEXT); - // Get the action path and invoke it - $actionsroot = "$CFG->dirroot/$CFG->admin/tool/xmldb/actions"; - $actionclass = $action . '.class.php'; - $actionpath = "$actionsroot/$action/$actionclass"; +// Get the action path and invoke it +$actionsroot = "$CFG->dirroot/$CFG->admin/tool/xmldb/actions"; +$actionclass = $action . '.class.php'; +$actionpath = "$actionsroot/$action/$actionclass"; - // Load and invoke the proper action - if (file_exists($actionpath) && is_readable($actionpath)) { - require_once($actionpath); - if ($xmldb_action = new $action) { - // Invoke it - $result = $xmldb_action->invoke(); - // store the result in session - $SESSION->xmldb = serialize($XMLDB); +// Load and invoke the proper action +if (file_exists($actionpath) && is_readable($actionpath)) { + require_once($actionpath); + if ($xmldb_action = new $action) { + // Invoke it + $result = $xmldb_action->invoke(); + // store the result in session + $SESSION->xmldb = serialize($XMLDB); - if ($result) { - // Based on getDoesGenerate() - switch ($xmldb_action->getDoesGenerate()) { - case ACTION_GENERATE_HTML: + if ($result) { + // Based on getDoesGenerate() + switch ($xmldb_action->getDoesGenerate()) { + case ACTION_GENERATE_HTML: - $action = optional_param('action', '', PARAM_ALPHAEXT); - $postaction = optional_param('postaction', '', PARAM_ALPHAEXT); - // If the js exists, load it - if ($action) { - $script = $CFG->admin . '/tool/xmldb/actions/' . $action . '/' . $action . '.js'; + $action = optional_param('action', '', PARAM_ALPHAEXT); + $postaction = optional_param('postaction', '', PARAM_ALPHAEXT); + // If the js exists, load it + if ($action) { + $script = $CFG->admin . '/tool/xmldb/actions/' . $action . '/' . $action . '.js'; + $file = $CFG->dirroot . '/' . $script; + if (file_exists($file) && is_readable($file)) { + $PAGE->requires->js('/'.$script); + } else if ($postaction) { + // Try to load the postaction javascript if exists + $script = $CFG->admin . '/tool/xmldb/actions/' . $postaction . '/' . $postaction . '.js'; $file = $CFG->dirroot . '/' . $script; if (file_exists($file) && is_readable($file)) { $PAGE->requires->js('/'.$script); - } else if ($postaction) { - // Try to load the postaction javascript if exists - $script = $CFG->admin . '/tool/xmldb/actions/' . $postaction . '/' . $postaction . '.js'; - $file = $CFG->dirroot . '/' . $script; - if (file_exists($file) && is_readable($file)) { - $PAGE->requires->js('/'.$script); - } } } + } - // Go with standard admin header - echo $OUTPUT->header(); - echo $OUTPUT->heading($xmldb_action->getTitle()); - echo $xmldb_action->getOutput(); - echo $OUTPUT->footer(); - break; - case ACTION_GENERATE_XML: - header('Content-type: application/xhtml+xml; charset=utf-8'); - echo $xmldb_action->getOutput(); - break; - } - } else { - // TODO: need more detailed error info - print_error('xmldberror'); + // Go with standard admin header + echo $OUTPUT->header(); + echo $OUTPUT->heading($xmldb_action->getTitle()); + echo $xmldb_action->getOutput(); + echo $OUTPUT->footer(); + break; + case ACTION_GENERATE_XML: + header('Content-type: application/xhtml+xml; charset=utf-8'); + echo $xmldb_action->getOutput(); + break; } } else { - $a = new stdClass(); - $a->action = $action; - $a->actionclass = $actionclass; - print_error('cannotinstantiateclass', 'tool_xmldb', '', $a); + // TODO: need more detailed error info + print_error('xmldberror'); } } else { - print_error('invalidaction'); + $a = new stdClass(); + $a->action = $action; + $a->actionclass = $actionclass; + print_error('cannotinstantiateclass', 'tool_xmldb', '', $a); } +} else { + print_error('invalidaction'); +} - if ($xmldb_action->getDoesGenerate() != ACTION_GENERATE_XML) { - if (debugging()) { - // print_object($XMLDB); - } +if ($xmldb_action->getDoesGenerate() != ACTION_GENERATE_XML) { + if (debugging()) { + // print_object($XMLDB); } +} diff --git a/admin/tool/xmldb/lang/en/tool_xmldb.php b/admin/tool/xmldb/lang/en/tool_xmldb.php index 4c502d42ab2..7b384b23147 100644 --- a/admin/tool/xmldb/lang/en/tool_xmldb.php +++ b/admin/tool/xmldb/lang/en/tool_xmldb.php @@ -17,8 +17,7 @@ /** * Strings for component 'tool_xmldb', language 'en', branch 'MOODLE_22_STABLE' * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -91,6 +90,7 @@ $string['fields'] = 'Fields'; $string['fieldsnotintable'] = 'Field doesn\'t exist in table'; $string['fieldsusedinindex'] = 'This field is used as index'; $string['fieldsusedinkey'] = 'This field is used as key.'; +$string['filemodifiedoutfromeditor'] = 'Warning: File locally modified while using the XMLDB Editor. Saving will overwrite local changes.'; $string['filenotwriteable'] = 'File not writeable'; $string['fkviolationdetails'] = 'Foreign key {$a->keyname} on table {$a->tablename} is violated by {$a->numviolations} out of {$a->numrows} rows.'; $string['floatincorrectdecimals'] = 'Incorrect number of decimals for float field'; diff --git a/admin/tool/xmldb/settings.php b/admin/tool/xmldb/settings.php index e68771e5061..c037512c2e6 100644 --- a/admin/tool/xmldb/settings.php +++ b/admin/tool/xmldb/settings.php @@ -17,8 +17,7 @@ /** * Link to xmldb editor * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/admin/tool/xmldb/version.php b/admin/tool/xmldb/version.php index 577c79b1dcd..ddfc858a8d1 100644 --- a/admin/tool/xmldb/version.php +++ b/admin/tool/xmldb/version.php @@ -17,8 +17,7 @@ /** * Plugin version info * - * @package tool - * @subpackage xmldb + * @package tool_xmldb * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/backup/cc/cc2moodle.php b/backup/cc/cc2moodle.php index 013d89123eb..05e8239f12d 100644 --- a/backup/cc/cc2moodle.php +++ b/backup/cc/cc2moodle.php @@ -620,15 +620,23 @@ class cc2moodle { $array_index++; if ($item->nodeName == "item") { + $identifierref = ''; + if ($item->hasAttribute('identifierref')) { + $identifierref = $item->getAttribute('identifierref'); + } - $identifierref = $xpath->query('@identifierref', $item); - $identifierref = !empty($identifierref->item(0)->nodeValue) ? $identifierref->item(0)->nodeValue : ''; - - $title = $xpath->query('imscc:title', $item); - $title = !empty($title->item(0)->nodeValue) ? $title->item(0)->nodeValue : ''; + $title = ''; + $titles = $xpath->query('imscc:title', $item); + if ($titles->length > 0) { + $title = $titles->item(0)->nodeValue; + } $cc_type = $this->get_item_cc_type($identifierref); $moodle_type = $this->convert_to_moodle_type($cc_type); + //Fix the label issue - MDL-33523 + if (empty($identifierref) && empty($title)) { + $moodle_type = TYPE_UNKNOWN; + } } elseif ($item->nodeName == "resource") { diff --git a/backup/cc/entities.class.php b/backup/cc/entities.class.php index 625d390bc3b..e0737fdca11 100644 --- a/backup/cc/entities.class.php +++ b/backup/cc/entities.class.php @@ -262,14 +262,14 @@ class entities { if (!empty($labels) && ($labels->length > 0)) { $tname = 'course_files'; $dpath = cc2moodle::$path_to_manifest_folder . DIRECTORY_SEPARATOR . $tname; - $rfpath = 'folder.gif'; + $rfpath = 'files.gif'; $fpath = $dpath . DIRECTORY_SEPARATOR . $rfpath; if (!file_exists($dpath)) { mkdir($dpath); } //copy the folder.gif file - $folder_gif = "{$CFG->dirroot}/pix/f/folder.gif"; + $folder_gif = "{$CFG->dirroot}/pix/i/files.gif"; copy($folder_gif, $fpath); $all_files[] = $rfpath; } diff --git a/backup/cc/entities11.class.php b/backup/cc/entities11.class.php index 9af9f3c89c0..e9873da72a6 100644 --- a/backup/cc/entities11.class.php +++ b/backup/cc/entities11.class.php @@ -62,13 +62,13 @@ class entities11 extends entities { if (!empty($labels) && ($labels->length > 0)) { $tname = 'course_files'; $dpath = cc2moodle::$path_to_manifest_folder . DIRECTORY_SEPARATOR . $tname; - $rfpath = 'folder.gif'; - $fpath = $dpath . DIRECTORY_SEPARATOR . 'folder.gif'; + $rfpath = 'files.gif'; + $fpath = $dpath . DIRECTORY_SEPARATOR . 'files.gif'; if (!file_exists($dpath)) { mkdir($dpath); } //copy the folder.gif file - $folder_gif = "{$CFG->dirroot}/pix/f/folder.gif"; + $folder_gif = "{$CFG->dirroot}/pix/i/files.gif"; copy($folder_gif, $fpath); $all_files[] = $rfpath; } diff --git a/backup/cc/entity.label.class.php b/backup/cc/entity.label.class.php index 6c27bf2b27b..e8dfe82efcb 100644 --- a/backup/cc/entity.label.class.php +++ b/backup/cc/entity.label.class.php @@ -52,7 +52,7 @@ class cc_label extends entities { '[#date_now#]'); $title = isset($instance['title']) && !empty($instance['title']) ? $instance['title'] : 'Untitled'; - $content = "\"Folder\" {$title}"; + $content = "\"Folder\" {$title}"; $replace_values = array($instance['instance'], self::safexml($title), self::safexml($content), diff --git a/backup/moodle2/backup_stepslib.php b/backup/moodle2/backup_stepslib.php index a2fa9488605..7169e1903c2 100644 --- a/backup/moodle2/backup_stepslib.php +++ b/backup/moodle2/backup_stepslib.php @@ -1069,7 +1069,7 @@ class backup_users_structure_step extends backup_structure_step { 'lang', 'theme', 'timezone', 'firstaccess', 'lastaccess', 'lastlogin', 'currentlogin', 'mailformat', 'maildigest', 'maildisplay', 'htmleditor', - 'ajax', 'autosubscribe', 'trackforums', 'timecreated', + 'autosubscribe', 'trackforums', 'timecreated', 'timemodified', 'trustbitmask', 'screenreader'); // Then, the fields potentially needing anonymization @@ -1404,7 +1404,8 @@ class backup_final_files_structure_step extends backup_structure_step { 'contenthash', 'contextid', 'component', 'filearea', 'itemid', 'filepath', 'filename', 'userid', 'filesize', 'mimetype', 'status', 'timecreated', 'timemodified', - 'source', 'author', 'license', 'sortorder', 'reference', 'repositoryid')); + 'source', 'author', 'license', 'sortorder', + 'repositorytype', 'repositoryid', 'reference')); // Build the tree @@ -1412,12 +1413,12 @@ class backup_final_files_structure_step extends backup_structure_step { // Define sources - $file->set_source_sql("SELECT f.*, r.repositoryid, r.reference + $file->set_source_sql("SELECT f.*, r.type AS repositorytype, fr.repositoryid, fr.reference FROM {files} f - LEFT JOIN {files_reference} r - ON r.id = f.referencefileid - JOIN {backup_ids_temp} bi - ON f.id = bi.itemid + LEFT JOIN {files_reference} fr ON fr.id = f.referencefileid + LEFT JOIN {repository_instances} ri ON ri.id = fr.repositoryid + LEFT JOIN {repository} r ON r.id = ri.typeid + JOIN {backup_ids_temp} bi ON f.id = bi.itemid WHERE bi.backupid = ? AND bi.itemname = 'filefinal'", array(backup::VAR_BACKUPID)); diff --git a/backup/moodle2/restore_final_task.class.php b/backup/moodle2/restore_final_task.class.php index 3f627bf16af..d336631eb5e 100644 --- a/backup/moodle2/restore_final_task.class.php +++ b/backup/moodle2/restore_final_task.class.php @@ -83,9 +83,15 @@ class restore_final_task extends restore_task { // executing it to perform some final adjustments of information // not available when the task was executed. // This step is always the last one performing modifications on restored information - // Don't add any new step after it. Only cache rebuild and clean are allowed. + // Don't add any new step after it. Only aliases queue, cache rebuild and clean are allowed. $this->add_step(new restore_execute_after_restore('executing_after_restore')); + // All files were sent to the filepool by now. We need to process + // the aliases yet as they were not actually created but stashed for us instead. + // We execute this step after executing_after_restore so that there can't be no + // more files sent to the filepool after this. + $this->add_step(new restore_process_file_aliases_queue('process_file_aliases_queue')); + // Rebuild course cache to see results, whoah! $this->add_step(new restore_rebuild_course_cache('rebuild_course_cache')); diff --git a/backup/moodle2/restore_stepslib.php b/backup/moodle2/restore_stepslib.php index 60a4086d6c8..adb3cd6b968 100644 --- a/backup/moodle2/restore_stepslib.php +++ b/backup/moodle2/restore_stepslib.php @@ -591,22 +591,14 @@ class restore_load_included_files extends restore_structure_step { } /** - * Processing functions go here + * Process one element from files.xml * - * @param array $data one file record including repositoryid and reference + * @param array $data the element data */ public function process_file($data) { $data = (object)$data; // handy - $isreference = !empty($data->repositoryid); - $issamesite = $this->task->is_samesite(); - - // If it's not samesite, we skip file refernces - if (!$issamesite && $isreference) { - return; - } - // load it if needed: // - it it is one of the annotated inforef files (course/section/activity/block) // - it is one "user", "group", "grouping", "grade", "question" or "qtype_xxxx" component file (that aren't sent to inforef ever) @@ -617,7 +609,6 @@ class restore_load_included_files extends restore_structure_step { $data->component == 'grouping' || $data->component == 'grade' || $data->component == 'question' || substr($data->component, 0, 5) == 'qtype'); if ($isfileref || $iscomponent) { - // Process files restore_dbops::set_backup_files_record($this->get_restoreid(), $data); } } @@ -3102,6 +3093,331 @@ class restore_create_question_files extends restore_execution_step { } } + +/** + * Try to restore aliases and references to external files. + * + * The queue of these files was prepared for us in {@link restore_dbops::send_files_to_pool()}. + * We expect that all regular (non-alias) files have already been restored. Make sure + * there is no restore step executed after this one that would call send_files_to_pool() again. + * + * You may notice we have hardcoded support for Server files, Legacy course files + * and user Private files here at the moment. This could be eventually replaced with a set of + * callbacks in the future if needed. + * + * @copyright 2012 David Mudrak + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class restore_process_file_aliases_queue extends restore_execution_step { + + /** @var array internal cache for {@link choose_repository() */ + private $cachereposbyid = array(); + + /** @var array internal cache for {@link choose_repository() */ + private $cachereposbytype = array(); + + /** + * What to do when this step is executed. + */ + protected function define_execution() { + global $DB; + + $this->log('processing file aliases queue', backup::LOG_INFO); + + $fs = get_file_storage(); + + // Load the queue. + $rs = $DB->get_recordset('backup_ids_temp', + array('backupid' => $this->get_restoreid(), 'itemname' => 'file_aliases_queue'), + '', 'info'); + + // Iterate over aliases in the queue. + foreach ($rs as $record) { + $info = unserialize(base64_decode($record->info)); + + // Try to pick a repository instance that should serve the alias. + $repository = $this->choose_repository($info); + + if (is_null($repository)) { + $this->notify_failure($info, 'unable to find a matching repository instance'); + continue; + } + + if ($info->oldfile->repositorytype === 'local' or $info->oldfile->repositorytype === 'coursefiles') { + // Aliases to Server files and Legacy course files may refer to a file + // contained in the backup file or to some existing file (if we are on the + // same site). + try { + $reference = file_storage::unpack_reference($info->oldfile->reference); + } catch (Exception $e) { + $this->notify_failure($info, 'invalid reference field format'); + continue; + } + + // Let's see if the referred source file was also included in the backup. + $candidates = $DB->get_recordset('backup_files_temp', array( + 'backupid' => $this->get_restoreid(), + 'contextid' => $reference['contextid'], + 'component' => $reference['component'], + 'filearea' => $reference['filearea'], + 'itemid' => $reference['itemid'], + ), '', 'info, newcontextid, newitemid'); + + $source = null; + + foreach ($candidates as $candidate) { + $candidateinfo = unserialize(base64_decode($candidate->info)); + if ($candidateinfo->filename === $reference['filename'] + and $candidateinfo->filepath === $reference['filepath'] + and !is_null($candidate->newcontextid) + and !is_null($candidate->newitemid) ) { + $source = $candidateinfo; + $source->contextid = $candidate->newcontextid; + $source->itemid = $candidate->newitemid; + break; + } + } + $candidates->close(); + + if ($source) { + // We have an alias that refers to another file also included in + // the backup. Let us change the reference field so that it refers + // to the restored copy of the original file. + $reference = file_storage::pack_reference($source); + + // Send the new alias to the filepool. + $fs->create_file_from_reference($info->newfile, $repository->id, $reference); + $this->notify_success($info); + continue; + + } else { + // This is a reference to some moodle file that was not contained in the backup + // file. If we are restoring to the same site, keep the reference untouched + // and restore the alias as is if the referenced file exists. + if ($this->task->is_samesite()) { + if ($fs->file_exists($reference['contextid'], $reference['component'], $reference['filearea'], + $reference['itemid'], $reference['filepath'], $reference['filename'])) { + $reference = file_storage::pack_reference($reference); + $fs->create_file_from_reference($info->newfile, $repository->id, $reference); + $this->notify_success($info); + continue; + } else { + $this->notify_failure($info, 'referenced file not found'); + continue; + } + + // If we are at other site, we can't restore this alias. + } else { + $this->notify_failure($info, 'referenced file not included'); + continue; + } + } + + } else if ($info->oldfile->repositorytype === 'user') { + if ($this->task->is_samesite()) { + // For aliases to user Private files at the same site, we have a chance to check + // if the referenced file still exists. + try { + $reference = file_storage::unpack_reference($info->oldfile->reference); + } catch (Exception $e) { + $this->notify_failure($info, 'invalid reference field format'); + continue; + } + if ($fs->file_exists($reference['contextid'], $reference['component'], $reference['filearea'], + $reference['itemid'], $reference['filepath'], $reference['filename'])) { + $reference = file_storage::pack_reference($reference); + $fs->create_file_from_reference($info->newfile, $repository->id, $reference); + $this->notify_success($info); + continue; + } else { + $this->notify_failure($info, 'referenced file not found'); + continue; + } + + // If we are at other site, we can't restore this alias. + } else { + $this->notify_failure($info, 'restoring at another site'); + continue; + } + + } else { + // This is a reference to some external file such as in boxnet or dropbox. + // If we are restoring to the same site, keep the reference untouched and + // restore the alias as is. + if ($this->task->is_samesite()) { + $fs->create_file_from_reference($info->newfile, $repository->id, $info->oldfile->reference); + $this->notify_success($info); + continue; + + // If we are at other site, we can't restore this alias. + } else { + $this->notify_failure($info, 'restoring at another site'); + continue; + } + } + } + $rs->close(); + } + + /** + * Choose the repository instance that should handle the alias. + * + * At the same site, we can rely on repository instance id and we just + * check it still exists. On other site, try to find matching Server files or + * Legacy course files repository instance. Return null if no matching + * repository instance can be found. + * + * @param stdClass $info + * @return repository|null + */ + private function choose_repository(stdClass $info) { + global $DB, $CFG; + require_once($CFG->dirroot.'/repository/lib.php'); + + if ($this->task->is_samesite()) { + // We can rely on repository instance id. + + if (array_key_exists($info->oldfile->repositoryid, $this->cachereposbyid)) { + return $this->cachereposbyid[$info->oldfile->repositoryid]; + } + + $this->log('looking for repository instance by id', backup::LOG_DEBUG, $info->oldfile->repositoryid, 1); + + try { + $this->cachereposbyid[$info->oldfile->repositoryid] = repository::get_repository_by_id($info->oldfile->repositoryid, SYSCONTEXTID); + return $this->cachereposbyid[$info->oldfile->repositoryid]; + } catch (Exception $e) { + $this->cachereposbyid[$info->oldfile->repositoryid] = null; + return null; + } + + } else { + // We can rely on repository type only. + + if (empty($info->oldfile->repositorytype)) { + return null; + } + + if (array_key_exists($info->oldfile->repositorytype, $this->cachereposbytype)) { + return $this->cachereposbytype[$info->oldfile->repositorytype]; + } + + $this->log('looking for repository instance by type', backup::LOG_DEBUG, $info->oldfile->repositorytype, 1); + + // Both Server files and Legacy course files repositories have a single + // instance at the system context to use. Let us try to find it. + if ($info->oldfile->repositorytype === 'local' or $info->oldfile->repositorytype === 'coursefiles') { + $sql = "SELECT ri.id + FROM {repository} r + JOIN {repository_instances} ri ON ri.typeid = r.id + WHERE r.type = ? AND ri.contextid = ?"; + $ris = $DB->get_records_sql($sql, array($info->oldfile->repositorytype, SYSCONTEXTID)); + if (empty($ris)) { + return null; + } + $repoids = array_keys($ris); + $repoid = reset($repoids); + try { + $this->cachereposbytype[$info->oldfile->repositorytype] = repository::get_repository_by_id($repoid, SYSCONTEXTID); + return $this->cachereposbytype[$info->oldfile->repositorytype]; + } catch (Exception $e) { + $this->cachereposbytype[$info->oldfile->repositorytype] = null; + return null; + } + } + + $this->cachereposbytype[$info->oldfile->repositorytype] = null; + return null; + } + } + + /** + * Let the user know that the given alias was successfully restored + * + * @param stdClass $info + */ + private function notify_success(stdClass $info) { + $filedesc = $this->describe_alias($info); + $this->log('successfully restored alias', backup::LOG_DEBUG, $filedesc, 1); + } + + /** + * Let the user know that the given alias can't be restored + * + * @param stdClass $info + * @param string $reason detailed reason to be logged + */ + private function notify_failure(stdClass $info, $reason = '') { + $filedesc = $this->describe_alias($info); + if ($reason) { + $reason = ' ('.$reason.')'; + } + $this->log('unable to restore alias'.$reason, backup::LOG_WARNING, $filedesc, 1); + $this->add_result_item('file_aliases_restore_failures', $filedesc); + } + + /** + * Return a human readable description of the alias file + * + * @param stdClass $info + * @return string + */ + private function describe_alias(stdClass $info) { + + $filedesc = $this->expected_alias_location($info->newfile); + + if (!is_null($info->oldfile->source)) { + $filedesc .= ' ('.$info->oldfile->source.')'; + } + + return $filedesc; + } + + /** + * Return the expected location of a file + * + * Please note this may and may not work as a part of URL to pluginfile.php + * (depends on how the given component/filearea deals with the itemid). + * + * @param stdClass $filerecord + * @return string + */ + private function expected_alias_location($filerecord) { + + $filedesc = '/'.$filerecord->contextid.'/'.$filerecord->component.'/'.$filerecord->filearea; + if (!is_null($filerecord->itemid)) { + $filedesc .= '/'.$filerecord->itemid; + } + $filedesc .= $filerecord->filepath.$filerecord->filename; + + return $filedesc; + } + + /** + * Append a value to the given resultset + * + * @param string $name name of the result containing a list of values + * @param mixed $value value to add as another item in that result + */ + private function add_result_item($name, $value) { + + $results = $this->task->get_results(); + + if (isset($results[$name])) { + if (!is_array($results[$name])) { + throw new coding_exception('Unable to append a result item into a non-array structure.'); + } + $current = $results[$name]; + $current[] = $value; + $this->task->add_result(array($name => $current)); + + } else { + $this->task->add_result(array($name => array($value))); + } + } +} + + /** * Abstract structure step, to be used by all the activities using core questions stuff * (like the quiz module), to support qtype plugins, states and sessions diff --git a/backup/util/dbops/restore_dbops.class.php b/backup/util/dbops/restore_dbops.class.php index 4254e698e90..2e73e8fcee1 100644 --- a/backup/util/dbops/restore_dbops.class.php +++ b/backup/util/dbops/restore_dbops.class.php @@ -808,6 +808,17 @@ abstract class restore_dbops { * Given one component/filearea/context and * optionally one source itemname to match itemids * put the corresponding files in the pool + * + * @param string $basepath the full path to the root of unzipped backup file + * @param string $restoreid the restore job's identification + * @param string $component + * @param string $filearea + * @param int $oldcontextid + * @param int $dfltuserid default $file->user if the old one can't be mapped + * @param string|null $itemname + * @param int|null $olditemid + * @param int|null $forcenewcontextid explicit value for the new contextid (skip mapping) + * @param bool $skipparentitemidctxmatch */ public static function send_files_to_pool($basepath, $restoreid, $component, $filearea, $oldcontextid, $dfltuserid, $itemname = null, $olditemid = null, $forcenewcontextid = null, $skipparentitemidctxmatch = false) { global $DB; @@ -839,17 +850,17 @@ abstract class restore_dbops { // itemname = null, we are going to match only by context, no need to use itemid (all them are 0) if ($itemname == null) { - $sql = 'SELECT contextid, component, filearea, itemid, itemid AS newitemid, info + $sql = "SELECT id AS bftid, contextid, component, filearea, itemid, itemid AS newitemid, info FROM {backup_files_temp} WHERE backupid = ? AND contextid = ? AND component = ? - AND filearea = ?'; + AND filearea = ?"; $params = array($restoreid, $oldcontextid, $component, $filearea); // itemname not null, going to join with backup_ids to perform the old-new mapping of itemids } else { - $sql = "SELECT f.contextid, f.component, f.filearea, f.itemid, i.newitemid, f.info + $sql = "SELECT f.id AS bftid, f.contextid, f.component, f.filearea, f.itemid, i.newitemid, f.info FROM {backup_files_temp} f JOIN {backup_ids_temp} i ON i.backupid = f.backupid $parentitemctxmatchsql @@ -872,47 +883,80 @@ abstract class restore_dbops { foreach ($rs as $rec) { $file = (object)unserialize(base64_decode($rec->info)); - $isreference = !empty($file->repositoryid); - // ignore root dirs (they are created automatically) if ($file->filepath == '/' && $file->filename == '.') { continue; } + // set the best possible user $mappeduser = self::get_backup_ids_record($restoreid, 'user', $file->userid); - $file->userid = !empty($mappeduser) ? $mappeduser->newitemid : $dfltuserid; - // dir found (and not root one), let's create if + $mappeduserid = !empty($mappeduser) ? $mappeduser->newitemid : $dfltuserid; + + // dir found (and not root one), let's create it if ($file->filename == '.') { - $fs->create_directory($newcontextid, $component, $filearea, $rec->newitemid, $file->filepath, $file->userid); + $fs->create_directory($newcontextid, $component, $filearea, $rec->newitemid, $file->filepath, $mappeduserid); continue; } - // arrived here, file found - // Find file in backup pool - $backuppath = $basepath . backup_file_manager::get_backup_content_file_location($file->contenthash); + if (empty($file->repositoryid)) { + // this is a regular file, it must be present in the backup pool + $backuppath = $basepath . backup_file_manager::get_backup_content_file_location($file->contenthash); - if (!file_exists($backuppath) && !$isreference) { - throw new restore_dbops_exception('file_not_found_in_pool', $file); - } - if (!$fs->file_exists($newcontextid, $component, $filearea, $rec->newitemid, $file->filepath, $file->filename)) { - $file_record = array( - 'contextid' => $newcontextid, - 'component' => $component, - 'filearea' => $filearea, - 'itemid' => $rec->newitemid, - 'filepath' => $file->filepath, - 'filename' => $file->filename, - 'timecreated' => $file->timecreated, - 'timemodified'=> $file->timemodified, - 'userid' => $file->userid, - 'author' => $file->author, - 'license' => $file->license, - 'sortorder' => $file->sortorder); - if ($isreference) { - $fs->create_file_from_reference($file_record, $file->repositoryid, $file->reference); - } else { + if (!file_exists($backuppath)) { + throw new restore_dbops_exception('file_not_found_in_pool', $file); + } + + // create the file in the filepool if it does not exist yet + if (!$fs->file_exists($newcontextid, $component, $filearea, $rec->newitemid, $file->filepath, $file->filename)) { + $file_record = array( + 'contextid' => $newcontextid, + 'component' => $component, + 'filearea' => $filearea, + 'itemid' => $rec->newitemid, + 'filepath' => $file->filepath, + 'filename' => $file->filename, + 'timecreated' => $file->timecreated, + 'timemodified'=> $file->timemodified, + 'userid' => $mappeduserid, + 'author' => $file->author, + 'license' => $file->license, + 'sortorder' => $file->sortorder + ); $fs->create_file_from_pathname($file_record, $backuppath); } + + // store the the new contextid and the new itemid in case we need to remap + // references to this file later + $DB->update_record('backup_files_temp', array( + 'id' => $rec->bftid, + 'newcontextid' => $newcontextid, + 'newitemid' => $rec->newitemid), true); + + } else { + // this is an alias - we can't create it yet so we stash it in a temp + // table and will let the final task to deal with it + if (!$fs->file_exists($newcontextid, $component, $filearea, $rec->newitemid, $file->filepath, $file->filename)) { + $info = new stdClass(); + // oldfile holds the raw information stored in MBZ (including reference-related info) + $info->oldfile = $file; + // newfile holds the info for the new file_record with the context, user and itemid mapped + $info->newfile = (object)array( + 'contextid' => $newcontextid, + 'component' => $component, + 'filearea' => $filearea, + 'itemid' => $rec->newitemid, + 'filepath' => $file->filepath, + 'filename' => $file->filename, + 'timecreated' => $file->timecreated, + 'timemodified'=> $file->timemodified, + 'userid' => $mappeduserid, + 'author' => $file->author, + 'license' => $file->license, + 'sortorder' => $file->sortorder + ); + + restore_dbops::set_backup_ids_record($restoreid, 'file_aliases_queue', $file->id, 0, null, $info); + } } } $rs->close(); diff --git a/backup/util/plan/base_plan.class.php b/backup/util/plan/base_plan.class.php index eab1869d6d3..d8c4b4d7c98 100644 --- a/backup/util/plan/base_plan.class.php +++ b/backup/util/plan/base_plan.class.php @@ -75,10 +75,27 @@ abstract class base_plan implements checksumable, executable { return $this->tasks; } + /** + * Add the passed info to the plan results + * + * At the moment we expect an associative array structure to be merged into + * the current results. In the future, some sort of base_result class may + * be introduced. + * + * @param array $result associative array describing a result of a task/step + */ public function add_result($result) { + if (!is_array($result)) { + throw new coding_exception('Associative array is expected as a parameter of add_result()'); + } $this->results = array_merge($this->results, $result); } + /** + * Return the results collected via {@link self::add_result()} method + * + * @return array + */ public function get_results() { return $this->results; } diff --git a/backup/util/plan/base_task.class.php b/backup/util/plan/base_task.class.php index 1527634713f..440521b54de 100644 --- a/backup/util/plan/base_task.class.php +++ b/backup/util/plan/base_task.class.php @@ -154,7 +154,7 @@ abstract class base_task implements checksumable, executable, loggable { // If step returns array, it will be forwarded to plan // (TODO: shouldn't be array but proper result object) if (is_array($result) and !empty($result)) { - $this->plan->add_result($result); + $this->add_result($result); } } // Mark as executed if any step has been executed @@ -191,6 +191,34 @@ abstract class base_task implements checksumable, executable, loggable { backup_general_helper::array_checksum_recursive($this->steps)); } + /** + * Add the given info to the current plan's results. + * + * @see base_plan::add_result() + * @param array $result associative array describing a result of a task/step + */ + public function add_result($result) { + if (!is_null($this->plan)) { + $this->plan->add_result($result); + } else { + debugging('Attempting to add a result of a task not binded with a plan', DEBUG_DEVELOPER); + } + } + + /** + * Return the current plan's results + * + * @return array|null + */ + public function get_results() { + if (!is_null($this->plan)) { + return $this->plan->get_results(); + } else { + debugging('Attempting to get results of a task not binded with a plan', DEBUG_DEVELOPER); + return null; + } + } + // Protected API starts here /** diff --git a/backup/util/ui/restore_ui_stage.class.php b/backup/util/ui/restore_ui_stage.class.php index c8ecc9eab50..7e920695502 100644 --- a/backup/util/ui/restore_ui_stage.class.php +++ b/backup/util/ui/restore_ui_stage.class.php @@ -757,6 +757,20 @@ class restore_ui_stage_complete extends restore_ui_stage_process { public function display(core_backup_renderer $renderer) { $html = ''; + if (!empty($this->results['file_aliases_restore_failures'])) { + $html .= $renderer->box_start('generalbox filealiasesfailures'); + $html .= $renderer->heading_with_help(get_string('filealiasesrestorefailures', 'core_backup'), + 'filealiasesrestorefailures', 'core_backup'); + $html .= $renderer->container(get_string('filealiasesrestorefailuresinfo', 'core_backup')); + $html .= $renderer->container_start('aliaseslist'); + $html .= html_writer::start_tag('ul'); + foreach ($this->results['file_aliases_restore_failures'] as $alias) { + $html .= html_writer::tag('li', s($alias)); + } + $html .= html_writer::end_tag('ul'); + $html .= $renderer->container_end(); + $html .= $renderer->box_end(); + } $html .= $renderer->box_start(); $html .= $renderer->notification(get_string('restoreexecutionsuccess', 'backup'), 'notifysuccess'); $html .= $renderer->continue_button(new moodle_url('/course/view.php', array( diff --git a/blocks/blog_recent/block_blog_recent.php b/blocks/blog_recent/block_blog_recent.php index 20313b626a0..b3d564fde7f 100644 --- a/blocks/blog_recent/block_blog_recent.php +++ b/blocks/blog_recent/block_blog_recent.php @@ -69,6 +69,10 @@ class block_blog_recent extends block_base { require_once($CFG->dirroot .'/blog/lib.php'); require_once($CFG->dirroot .'/blog/locallib.php'); + if (empty($this->config)) { + $this->config = new stdClass(); + } + if (empty($this->config->recentbloginterval)) { $this->config->recentbloginterval = 8400; } diff --git a/blocks/blog_tags/block_blog_tags.php b/blocks/blog_tags/block_blog_tags.php index c3fa8d8f2d7..c84f9d2e02f 100644 --- a/blocks/blog_tags/block_blog_tags.php +++ b/blocks/blog_tags/block_blog_tags.php @@ -93,6 +93,10 @@ class block_blog_tags extends block_base { // require the libs and do the work require_once($CFG->dirroot .'/blog/lib.php'); + if (empty($this->config)) { + $this->config = new stdClass(); + } + if (empty($this->config->timewithin)) { $this->config->timewithin = BLOCK_BLOG_TAGS_DEFAULTTIMEWITHIN; } diff --git a/course/delete_category_form.php b/course/delete_category_form.php index f2d394cd907..0ceeb8e59a7 100644 --- a/course/delete_category_form.php +++ b/course/delete_category_form.php @@ -102,8 +102,10 @@ class delete_category_form extends moodleform { /// Give the options for what to do. $mform->addElement('select', 'fulldelete', get_string('whattodo'), $options); if (count($options) == 1) { + $optionkeys = array_keys($options); + $option = reset($optionkeys); $mform->hardFreeze('fulldelete'); - $mform->setConstant('fulldelete', reset(array_keys($options))); + $mform->setConstant('fulldelete', $option); } if ($displaylist) { diff --git a/course/format/renderer.php b/course/format/renderer.php index 8de249c6286..b7c0e21a5a6 100644 --- a/course/format/renderer.php +++ b/course/format/renderer.php @@ -296,7 +296,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base { $o.= html_writer::start_tag('div', array('class' => 'summarytext')); $o.= $this->format_summary_text($section); $o.= html_writer::end_tag('div'); - $o.= $this->section_activity_summary($section, $mods); + $o.= $this->section_activity_summary($section, $course, $mods); $o.= $this->section_availability_message($section); @@ -310,16 +310,21 @@ abstract class format_section_renderer_base extends plugin_renderer_base { * Generate a summary of the activites in a section * * @param stdClass $section The course_section entry from DB + * @param stdClass $course the course record from DB * @param array $mods course modules indexed by id (from get_all_mods) * @return string HTML to output. */ - private function section_activity_summary($section, $mods) { + private function section_activity_summary($section, $course, $mods) { if (empty($section->sequence)) { return ''; } // Generate array with count of activities in this section: $sectionmods = array(); + $total = 0; + $complete = 0; + $cancomplete = isloggedin() && !isguestuser(); + $completioninfo = new completion_info($course); $modsequence = explode(',', $section->sequence); foreach ($modsequence as $cmid) { $thismod = $mods[$cmid]; @@ -336,6 +341,13 @@ abstract class format_section_renderer_base extends plugin_renderer_base { $sectionmods[$thismod->modname]['name'] = $thismod->modplural; $sectionmods[$thismod->modname]['count'] = 1; } + if ($cancomplete && $completioninfo->is_enabled($thismod) != COMPLETION_TRACKING_NONE) { + $total++; + $completiondata = $completioninfo->get_data($thismod, true); + if ($completiondata->completionstate == COMPLETION_COMPLETE) { + $complete++; + } + } } } @@ -353,6 +365,18 @@ abstract class format_section_renderer_base extends plugin_renderer_base { $o.= html_writer::end_tag('span'); } $o.= html_writer::end_tag('div'); + + // Output section completion data + if ($total > 0) { + $a = new stdClass; + $a->complete = $complete; + $a->total = $total; + + $o.= html_writer::start_tag('div', array('class' => 'section-summary-activities mdl-right')); + $o.= html_writer::tag('span', get_string('progresstotal', 'completion', $a), array('class' => 'activity-count')); + $o.= html_writer::end_tag('div'); + } + return $o; } diff --git a/course/lib.php b/course/lib.php index 1f47a83c0fe..82f2b8cb2f6 100644 --- a/course/lib.php +++ b/course/lib.php @@ -3031,20 +3031,13 @@ function move_section_to($course, $section, $destination) { } } - // Adjust destination to reflect the actual section - $moveup = false; - if ($section > $destination) { - $destination++; - $moveup = true; - } - // If we move the highlighted section itself, then just highlight the destination. // Adjust the higlighted section location if we move something over it either direction. if ($section == $course->marker) { course_set_marker($course->id, $destination); - } elseif ($moveup && $section > $course->marker && $course->marker >= $destination) { + } elseif ($section > $course->marker && $course->marker >= $destination) { course_set_marker($course->id, $course->marker+1); - } elseif (!$moveup && $section < $course->marker && $course->marker <= $destination) { + } elseif ($section < $course->marker && $course->marker <= $destination) { course_set_marker($course->id, $course->marker-1); } diff --git a/course/tests/courselib_test.php b/course/tests/courselib_test.php index 2274e6d2ffb..42b8057ed93 100644 --- a/course/tests/courselib_test.php +++ b/course/tests/courselib_test.php @@ -66,7 +66,7 @@ class courselib_testcase extends advanced_testcase { $this->assertFalse($neworder); } - public function test_move_section() { + public function test_move_section_down() { global $DB; $this->resetAfterTest(true); @@ -78,6 +78,7 @@ class courselib_testcase extends advanced_testcase { } ksort($oldsections); + // Test move section down.. move_section_to($course, 2, 4); $sections = array(); foreach ($DB->get_records('course_sections', array('course'=>$course->id)) as $section) { @@ -94,6 +95,77 @@ class courselib_testcase extends advanced_testcase { $this->assertEquals($oldsections[6], $sections[6]); } + public function test_move_section_up() { + global $DB; + $this->resetAfterTest(true); + + $this->getDataGenerator()->create_course(array('numsections'=>5), array('createsections'=>true)); + $course = $this->getDataGenerator()->create_course(array('numsections'=>10), array('createsections'=>true)); + $oldsections = array(); + foreach ($DB->get_records('course_sections', array('course'=>$course->id)) as $section) { + $oldsections[$section->section] = $section->id; + } + ksort($oldsections); + + // Test move section up.. + move_section_to($course, 6, 4); + $sections = array(); + foreach ($DB->get_records('course_sections', array('course'=>$course->id)) as $section) { + $sections[$section->section] = $section->id; + } + ksort($sections); + + $this->assertEquals($oldsections[0], $sections[0]); + $this->assertEquals($oldsections[1], $sections[1]); + $this->assertEquals($oldsections[2], $sections[2]); + $this->assertEquals($oldsections[3], $sections[3]); + $this->assertEquals($oldsections[4], $sections[5]); + $this->assertEquals($oldsections[5], $sections[6]); + $this->assertEquals($oldsections[6], $sections[4]); + } + + public function test_move_section_marker() { + global $DB; + $this->resetAfterTest(true); + + $this->getDataGenerator()->create_course(array('numsections'=>5), array('createsections'=>true)); + $course = $this->getDataGenerator()->create_course(array('numsections'=>10), array('createsections'=>true)); + + // Set course marker to the section we are going to move.. + course_set_marker($course->id, 2); + // Verify that the course marker is set correctly. + $course = $DB->get_record('course', array('id' => $course->id)); + $this->assertEquals(2, $course->marker); + + // Test move the marked section down.. + move_section_to($course, 2, 4); + + // Verify that the coruse marker has been moved along with the section.. + $course = $DB->get_record('course', array('id' => $course->id)); + $this->assertEquals(4, $course->marker); + + // Test move the marked section up.. + move_section_to($course, 4, 3); + + // Verify that the course marker has been moved along with the section.. + $course = $DB->get_record('course', array('id' => $course->id)); + $this->assertEquals(3, $course->marker); + + // Test moving a non-marked section above the marked section.. + move_section_to($course, 4, 2); + + // Verify that the course marker has been moved down to accomodate.. + $course = $DB->get_record('course', array('id' => $course->id)); + $this->assertEquals(4, $course->marker); + + // Test moving a non-marked section below the marked section.. + move_section_to($course, 3, 6); + + // Verify that the course marker has been up to accomodate.. + $course = $DB->get_record('course', array('id' => $course->id)); + $this->assertEquals(3, $course->marker); + } + public function test_get_course_display_name_for_list() { global $CFG; $this->resetAfterTest(true); diff --git a/course/yui/dragdrop/dragdrop.js b/course/yui/dragdrop/dragdrop.js index 2b492ada9d6..435b3559bc1 100644 --- a/course/yui/dragdrop/dragdrop.js +++ b/course/yui/dragdrop/dragdrop.js @@ -91,7 +91,7 @@ YUI.add('moodle-course-dragdrop', function(Y) { // Keep it inside the .course-content constrain: '#'+CSS.PAGECONTENT, stickY: true - }); + }).plug(Y.Plugin.DDWinScroll); } } }, this); @@ -306,7 +306,7 @@ YUI.add('moodle-course-dragdrop', function(Y) { }).plug(Y.Plugin.DDConstrained, { // Keep it inside the .course-content constrain: '#'+CSS.PAGECONTENT - }); + }).plug(Y.Plugin.DDWinScroll); } }, this); }, @@ -411,4 +411,4 @@ YUI.add('moodle-course-dragdrop', function(Y) { M.course.init_section_dragdrop = function(params) { new DRAGSECTION(params); } -}, '@VERSION@', {requires:['base', 'node', 'io', 'dom', 'dd', 'moodle-core-dragdrop', 'moodle-enrol-notification', 'moodle-course-coursebase']}); +}, '@VERSION@', {requires:['base', 'node', 'io', 'dom', 'dd', 'dd-scroll', 'moodle-core-dragdrop', 'moodle-enrol-notification', 'moodle-course-coursebase']}); diff --git a/course/yui/modchooser/modchooser.js b/course/yui/modchooser/modchooser.js index 6b73e681d51..aea4040b47a 100644 --- a/course/yui/modchooser/modchooser.js +++ b/course/yui/modchooser/modchooser.js @@ -81,31 +81,30 @@ YUI.add('moodle-course-modchooser', function(Y) { // Setup for site topics Y.one(baseselector).all(CSS.SITETOPIC).each(function(section) { - // The site topic has a sectionid of 1 - this._setup_for_section(section, 1); - }, this); - - // Setup for the site menu - Y.one(baseselector).all(CSS.SITEMENU).each(function(section) { - // The site menu has a sectionid of 0 - this._setup_for_section(section, 0); + this._setup_for_section(section); }, this); // Setup for standard course topics Y.one(baseselector).all(CSS.SECTION).each(function(section) { - // Determine the sectionid for this section - var sectionid = section.get('id').replace('section-', ''); - this._setup_for_section(section, sectionid); + this._setup_for_section(section); + }, this); + + // Setup for the block site menu + Y.one(baseselector).all(CSS.SITEMENU).each(function(section) { + this._setup_for_section(section); }, this); }, _setup_for_section : function(section, sectionid) { var chooserspan = section.one(CSS.SECTIONMODCHOOSER); + if (!chooserspan) { + return; + } var chooserlink = Y.Node.create(""); chooserspan.get('children').each(function(node) { chooserlink.appendChild(node); }); chooserspan.insertBefore(chooserlink); - chooserlink.on('click', this.display_mod_chooser, this, sectionid); + chooserlink.on('click', this.display_mod_chooser, this); }, /** * Display the module chooser @@ -114,9 +113,18 @@ YUI.add('moodle-course-modchooser', function(Y) { * @param secitonid integer The ID of the section triggering the dialogue * @return void */ - display_mod_chooser : function (e, sectionid) { + display_mod_chooser : function (e) { // Set the section for this version of the dialogue - this.sectionid = sectionid; + if (e.target.ancestor(CSS.SITETOPIC)) { + // The site topic has a sectionid of 1 + this.sectionid = 1; + } else if (e.target.ancestor(CSS.SECTION)) { + var section = e.target.ancestor(CSS.SECTION); + this.sectionid = section.get('id').replace('section-', ''); + } else if (e.target.ancestor(CSS.SITEMENU)) { + // The block site menu has a sectionid of 0 + this.sectionid = 0; + } this.display_chooser(e); }, toggle_mod_chooser : function(e) { diff --git a/files/renderer.php b/files/renderer.php index 2f5f5d41221..33a70f6e0f0 100644 --- a/files/renderer.php +++ b/files/renderer.php @@ -279,6 +279,8 @@ class core_files_renderer extends plugin_renderer_base { + + '.$this->pix_icon('i/menu', '▶').' @@ -303,8 +305,8 @@ class core_files_renderer extends plugin_renderer_base { $rv = '
    '.get_string('newfoldername','repository').'
    - '.get_string('makeafolder').' - '.get_string('cancel').' + +
    '; return preg_replace('/\{\!\}/', '', $rv); } @@ -370,12 +372,11 @@ class core_files_renderer extends plugin_renderer_base {

    '.get_string('loading', 'repository').'

    - + + + + +
    ' . implode (', ', $errors) . '
    @@ -391,19 +392,20 @@ class core_files_renderer extends plugin_renderer_base {
    :
    :

    '.$icon_progress.' '.$strloading.'
      +
      + + +
      -

      -
      -

      - '.get_string('update', 'moodle').' - '.get_string('cancel').' -

      -
      -
      -
      '.get_string('lastmodified', 'moodle').':
      -
      '.get_string('datecreated', 'repository').':
      -
      '.get_string('size', 'repository').':
      -
      '.get_string('dimensions', 'repository').':
      +
      +
      +

      +
      +
      '.get_string('lastmodified', 'moodle').':
      +
      '.get_string('datecreated', 'repository').':
      +
      '.get_string('size', 'repository').':
      +
      '.get_string('dimensions', 'repository').':
      +
      '; return preg_replace('/\{\!\}/', '', $rv); @@ -424,8 +426,8 @@ class core_files_renderer extends plugin_renderer_base { $rv = '
      - '.get_string('ok').' - '.get_string('cancel').' + +
      '; return preg_replace('/\{\!\}/', '', $rv); } @@ -455,11 +457,9 @@ class core_files_renderer extends plugin_renderer_base { $maxbytes = display_size($fm->options->maxbytes); if (empty($options->maxfiles) || $options->maxfiles == -1) { $maxsize = get_string('maxfilesize', 'moodle', $maxbytes); - //$string['maxfilesize'] = 'Maximum size for new files: {$a}'; } else { $strparam = (object)array('size' => $maxbytes, 'attachments' => $options->maxfiles); $maxsize = get_string('maxsizeandattachments', 'moodle', $strparam); - //$string['maxsizeandattachments'] = 'Maximum size for new files: {$a->size}, maximum attachments: {$a->attachments}'; } // TODO MDL-32020 also should say about 'File types accepted' return ''. $maxsize. ''; @@ -565,7 +565,11 @@ class core_files_renderer extends plugin_renderer_base { private function fp_js_template_iconfilename() { $rv = ' -
      +
      +
      +
      +
      +

      @@ -661,11 +665,6 @@ class core_files_renderer extends plugin_renderer_base {

      '.get_string('loading', 'repository').'

      - -
      @@ -686,16 +685,23 @@ class core_files_renderer extends plugin_renderer_base {
      :
      +
      + + +
      -

      -
      -
      '.get_string('lastmodified', 'moodle').':
      -
      '.get_string('datecreated', 'repository').':
      -
      '.get_string('size', 'repository').':
      -
      '.get_string('license', 'moodle').':
      -
      '.get_string('author', 'repository').':
      -
      '.get_string('dimensions', 'repository').':
      -
      +
      +
      +

      +
      +
      '.get_string('lastmodified', 'moodle').':
      +
      '.get_string('datecreated', 'repository').':
      +
      '.get_string('size', 'repository').':
      +
      '.get_string('license', 'moodle').':
      +
      '.get_string('author', 'repository').':
      +
      '.get_string('dimensions', 'repository').':
      +
      +
      '; return preg_replace('/\{\!\}/', '', $rv); } @@ -791,7 +797,7 @@ class core_files_renderer extends plugin_renderer_base { $rv = '

      - '.get_string('ok').' +
      '; return preg_replace('/\{\!\}/', '', $rv); } @@ -802,6 +808,34 @@ class core_files_renderer extends plugin_renderer_base { * Must have one top element, CSS for this element must define width and height of the window; * * content of element with class 'fp-dlg-text' will be replaced with dialog text; + * elements with classes 'fp-dlg-butoverwrite', 'fp-dlg-butrename', + * 'fp-dlg-butoverwriteall', 'fp-dlg-butrenameall' and 'fp-dlg-butcancel' will + * hold onclick events; + * + * content of element with class 'fp-dlg-butrename' will be substituted with appropriate string + * (Note that it may have long text) + * + * @return string + */ + private function fp_js_template_processexistingfile() { + $rv = ' +
      +

      +
      + + + +
      +
      '; + return preg_replace('/\{\!\}/', '', $rv); + } + + /** + * FilePicker JS template for popup dialogue window asking for action when file with the same name already exists (multiple-file version). + * + * Must have one top element, CSS for this element must define width and height of the window; + * + * content of element with class 'fp-dlg-text' will be replaced with dialog text; * elements with classes 'fp-dlg-butoverwrite', 'fp-dlg-butrename' and 'fp-dlg-butcancel' will * hold onclick events; * @@ -810,13 +844,16 @@ class core_files_renderer extends plugin_renderer_base { * * @return string */ - private function fp_js_template_processexistingfile() { + private function fp_js_template_processexistingfilemultiple() { $rv = ' '; return preg_replace('/\{\!\}/', '', $rv); } diff --git a/install.php b/install.php index e50e3bc8ccb..098e1323b54 100644 --- a/install.php +++ b/install.php @@ -410,7 +410,7 @@ if ($config->stage == INSTALL_DATABASE) { $disabled = empty($distro->dbhost) ? '' : 'disabled="disabled'; echo '
      '; - echo ''; + echo ''; echo '
      '; echo '
      '; diff --git a/install/lang/af/admin.php b/install/lang/af/admin.php index 3e7e0eed674..4c4bdc11f3f 100644 --- a/install/lang/af/admin.php +++ b/install/lang/af/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/af/langconfig.php b/install/lang/af/langconfig.php index 7e4d4fd4058..3955288832f 100644 --- a/install/lang/af/langconfig.php +++ b/install/lang/af/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/am/install.php b/install/lang/am/install.php index 0d25e3e4842..07817eae5bd 100644 --- a/install/lang/am/install.php +++ b/install/lang/am/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/am/langconfig.php b/install/lang/am/langconfig.php index 6448a2b7869..76e3612d9c2 100644 --- a/install/lang/am/langconfig.php +++ b/install/lang/am/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/am/moodle.php b/install/lang/am/moodle.php index 9b94e9c61cf..2e90b4d6e50 100644 --- a/install/lang/am/moodle.php +++ b/install/lang/am/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ar/admin.php b/install/lang/ar/admin.php index a5496914a7f..e04c8d2c65d 100644 --- a/install/lang/ar/admin.php +++ b/install/lang/ar/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ar/error.php b/install/lang/ar/error.php index c374dffab3b..e82bcb64547 100644 --- a/install/lang/ar/error.php +++ b/install/lang/ar/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ar/install.php b/install/lang/ar/install.php index d422ea0fcf5..1ac6281e749 100644 --- a/install/lang/ar/install.php +++ b/install/lang/ar/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ar/langconfig.php b/install/lang/ar/langconfig.php index 5e241fda978..155594c6f65 100644 --- a/install/lang/ar/langconfig.php +++ b/install/lang/ar/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ar/moodle.php b/install/lang/ar/moodle.php index 4f69811de7a..1ee0080df7b 100644 --- a/install/lang/ar/moodle.php +++ b/install/lang/ar/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ast/admin.php b/install/lang/ast/admin.php index 2e732d283a2..cff5e5e4e35 100644 --- a/install/lang/ast/admin.php +++ b/install/lang/ast/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ast/error.php b/install/lang/ast/error.php index 128aba82158..3b954da91d4 100644 --- a/install/lang/ast/error.php +++ b/install/lang/ast/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ast/install.php b/install/lang/ast/install.php index d0a60ba1cad..94ae04ce525 100644 --- a/install/lang/ast/install.php +++ b/install/lang/ast/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ast/langconfig.php b/install/lang/ast/langconfig.php index 0c8a1e5608e..514270b8650 100644 --- a/install/lang/ast/langconfig.php +++ b/install/lang/ast/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ast/moodle.php b/install/lang/ast/moodle.php index 0877bd2ddca..3f8ddac271c 100644 --- a/install/lang/ast/moodle.php +++ b/install/lang/ast/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/az/admin.php b/install/lang/az/admin.php index 310d4dda90c..138178c6c7f 100644 --- a/install/lang/az/admin.php +++ b/install/lang/az/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/az/error.php b/install/lang/az/error.php index 986fc6d361c..01cbc210321 100644 --- a/install/lang/az/error.php +++ b/install/lang/az/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/az/install.php b/install/lang/az/install.php index 1611a804925..0d5cae1b91c 100644 --- a/install/lang/az/install.php +++ b/install/lang/az/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/az/langconfig.php b/install/lang/az/langconfig.php index 884423cb005..bb2b5d65e48 100644 --- a/install/lang/az/langconfig.php +++ b/install/lang/az/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/az/moodle.php b/install/lang/az/moodle.php index f503f4d305f..033d58b21f3 100644 --- a/install/lang/az/moodle.php +++ b/install/lang/az/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/be/langconfig.php b/install/lang/be/langconfig.php index 5fd35d7993e..0e0648e1b1f 100644 --- a/install/lang/be/langconfig.php +++ b/install/lang/be/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/be/moodle.php b/install/lang/be/moodle.php index 974405214d7..a29658b6f5c 100644 --- a/install/lang/be/moodle.php +++ b/install/lang/be/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/bg/admin.php b/install/lang/bg/admin.php index b35cc865085..b7e5729f83b 100644 --- a/install/lang/bg/admin.php +++ b/install/lang/bg/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/bg/error.php b/install/lang/bg/error.php index 22c14b2bdb4..61ec6624913 100644 --- a/install/lang/bg/error.php +++ b/install/lang/bg/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/bg/install.php b/install/lang/bg/install.php index c9b98b54e8c..f3bdac48fa2 100644 --- a/install/lang/bg/install.php +++ b/install/lang/bg/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/bg/langconfig.php b/install/lang/bg/langconfig.php index f46055556ec..54080de3560 100644 --- a/install/lang/bg/langconfig.php +++ b/install/lang/bg/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/bg/moodle.php b/install/lang/bg/moodle.php index bbcbdb6faf8..6389484f9de 100644 --- a/install/lang/bg/moodle.php +++ b/install/lang/bg/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/bn/admin.php b/install/lang/bn/admin.php index e8eb4917203..2989b524b7e 100644 --- a/install/lang/bn/admin.php +++ b/install/lang/bn/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/bn/install.php b/install/lang/bn/install.php index d3eb440844c..a388864c70a 100644 --- a/install/lang/bn/install.php +++ b/install/lang/bn/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/bn/langconfig.php b/install/lang/bn/langconfig.php index 97e85c1f8f1..ddcaf9eebcb 100644 --- a/install/lang/bn/langconfig.php +++ b/install/lang/bn/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/bn/moodle.php b/install/lang/bn/moodle.php index d4737f7f21f..cefa2c817f5 100644 --- a/install/lang/bn/moodle.php +++ b/install/lang/bn/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/bs/install.php b/install/lang/bs/install.php index 47fc65ce27f..9ea56b64374 100644 --- a/install/lang/bs/install.php +++ b/install/lang/bs/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/bs/langconfig.php b/install/lang/bs/langconfig.php index 1cc76f6060b..21c0ee2742e 100644 --- a/install/lang/bs/langconfig.php +++ b/install/lang/bs/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ca/admin.php b/install/lang/ca/admin.php index 01a0d35cb8a..a2e053ce459 100644 --- a/install/lang/ca/admin.php +++ b/install/lang/ca/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ca/error.php b/install/lang/ca/error.php index 77188d0ab20..e8c7b559b9b 100644 --- a/install/lang/ca/error.php +++ b/install/lang/ca/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ca/install.php b/install/lang/ca/install.php index d57d69d67c3..2b156524149 100644 --- a/install/lang/ca/install.php +++ b/install/lang/ca/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ca/langconfig.php b/install/lang/ca/langconfig.php index 8672b5715c6..92aa8d09515 100644 --- a/install/lang/ca/langconfig.php +++ b/install/lang/ca/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ca/moodle.php b/install/lang/ca/moodle.php index 1c76f6d8383..6725972b8bb 100644 --- a/install/lang/ca/moodle.php +++ b/install/lang/ca/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ca_valencia/admin.php b/install/lang/ca_valencia/admin.php index 8343647de13..56540222446 100644 --- a/install/lang/ca_valencia/admin.php +++ b/install/lang/ca_valencia/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ca_valencia/langconfig.php b/install/lang/ca_valencia/langconfig.php index 82852804455..a8b433a5ef7 100644 --- a/install/lang/ca_valencia/langconfig.php +++ b/install/lang/ca_valencia/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ckb/langconfig.php b/install/lang/ckb/langconfig.php index fcfc54d074f..759ffd98bfd 100644 --- a/install/lang/ckb/langconfig.php +++ b/install/lang/ckb/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/cs/admin.php b/install/lang/cs/admin.php index d66e30f805d..0b2657d812b 100644 --- a/install/lang/cs/admin.php +++ b/install/lang/cs/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/cs/error.php b/install/lang/cs/error.php index 1dcb28bd165..a370667f03b 100644 --- a/install/lang/cs/error.php +++ b/install/lang/cs/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/cs/install.php b/install/lang/cs/install.php index c63205bee14..bf1040d0d92 100644 --- a/install/lang/cs/install.php +++ b/install/lang/cs/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/cs/langconfig.php b/install/lang/cs/langconfig.php index 09613c57037..2c26f4ec83a 100644 --- a/install/lang/cs/langconfig.php +++ b/install/lang/cs/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/cs/moodle.php b/install/lang/cs/moodle.php index 469d73765e3..102bae08ded 100644 --- a/install/lang/cs/moodle.php +++ b/install/lang/cs/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/cy/admin.php b/install/lang/cy/admin.php index ef0f3bb373e..a9fde51ccf8 100644 --- a/install/lang/cy/admin.php +++ b/install/lang/cy/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/cy/error.php b/install/lang/cy/error.php index 3ba3d5014d9..51baf6d3547 100644 --- a/install/lang/cy/error.php +++ b/install/lang/cy/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/cy/install.php b/install/lang/cy/install.php index 5b0f627e34c..eb3f16fb5fd 100644 --- a/install/lang/cy/install.php +++ b/install/lang/cy/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/cy/langconfig.php b/install/lang/cy/langconfig.php index 8d3783d83cc..29dec470de4 100644 --- a/install/lang/cy/langconfig.php +++ b/install/lang/cy/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/cy/moodle.php b/install/lang/cy/moodle.php index f2f4b6b5ce4..feff12dffe7 100644 --- a/install/lang/cy/moodle.php +++ b/install/lang/cy/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/da/admin.php b/install/lang/da/admin.php index c11ac3879fe..1b24a4e908a 100644 --- a/install/lang/da/admin.php +++ b/install/lang/da/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/da/error.php b/install/lang/da/error.php index ebe9f4e6d50..caa197871dd 100644 --- a/install/lang/da/error.php +++ b/install/lang/da/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/da/install.php b/install/lang/da/install.php index e85ebfaa632..6e431526b6e 100644 --- a/install/lang/da/install.php +++ b/install/lang/da/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/da/langconfig.php b/install/lang/da/langconfig.php index 765da062091..83c7a3da43f 100644 --- a/install/lang/da/langconfig.php +++ b/install/lang/da/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/da/moodle.php b/install/lang/da/moodle.php index ec55822838d..92cfce40450 100644 --- a/install/lang/da/moodle.php +++ b/install/lang/da/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/de/admin.php b/install/lang/de/admin.php index f5b781cbffb..7a9a9fe443c 100644 --- a/install/lang/de/admin.php +++ b/install/lang/de/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/de/error.php b/install/lang/de/error.php index f62cb9cb4b1..b013f2ccdde 100644 --- a/install/lang/de/error.php +++ b/install/lang/de/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/de/install.php b/install/lang/de/install.php index 3484e7a88f2..8c0a737a8e6 100644 --- a/install/lang/de/install.php +++ b/install/lang/de/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/de/langconfig.php b/install/lang/de/langconfig.php index ff65bd4a3dd..7059839aeae 100644 --- a/install/lang/de/langconfig.php +++ b/install/lang/de/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/de/moodle.php b/install/lang/de/moodle.php index 04db977c202..c4bcb013bca 100644 --- a/install/lang/de/moodle.php +++ b/install/lang/de/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/de_comm/langconfig.php b/install/lang/de_comm/langconfig.php index 4b322572857..a5eb7760564 100644 --- a/install/lang/de_comm/langconfig.php +++ b/install/lang/de_comm/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/de_du/error.php b/install/lang/de_du/error.php index 323ec56e3b6..a3f01800f2f 100644 --- a/install/lang/de_du/error.php +++ b/install/lang/de_du/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/de_du/install.php b/install/lang/de_du/install.php index 63609e1ddb9..1154c8cfaf2 100644 --- a/install/lang/de_du/install.php +++ b/install/lang/de_du/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/de_du/langconfig.php b/install/lang/de_du/langconfig.php index f5b15115d8d..191e2cbf458 100644 --- a/install/lang/de_du/langconfig.php +++ b/install/lang/de_du/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/de_kids/langconfig.php b/install/lang/de_kids/langconfig.php index 6610cffea7f..1f508d293d4 100644 --- a/install/lang/de_kids/langconfig.php +++ b/install/lang/de_kids/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/dv/admin.php b/install/lang/dv/admin.php index cebfe87828b..953b88e4b46 100644 --- a/install/lang/dv/admin.php +++ b/install/lang/dv/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/dv/error.php b/install/lang/dv/error.php index ee7a3e76c9b..73ea12c880f 100644 --- a/install/lang/dv/error.php +++ b/install/lang/dv/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/dv/install.php b/install/lang/dv/install.php index 4aa4caf5cc9..73004f419ae 100644 --- a/install/lang/dv/install.php +++ b/install/lang/dv/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/dv/langconfig.php b/install/lang/dv/langconfig.php index d73f6674b7a..19fa62351db 100644 --- a/install/lang/dv/langconfig.php +++ b/install/lang/dv/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/dv/moodle.php b/install/lang/dv/moodle.php index e1f80faaa5d..9b55dfddc7c 100644 --- a/install/lang/dv/moodle.php +++ b/install/lang/dv/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/el/admin.php b/install/lang/el/admin.php index 4bdc3a36c0b..668d5fdc01e 100644 --- a/install/lang/el/admin.php +++ b/install/lang/el/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/el/error.php b/install/lang/el/error.php index 1a0ca356851..2e5ba5916a2 100644 --- a/install/lang/el/error.php +++ b/install/lang/el/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/el/install.php b/install/lang/el/install.php index 5ce4da5696c..ebe32e46aa7 100644 --- a/install/lang/el/install.php +++ b/install/lang/el/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/el/langconfig.php b/install/lang/el/langconfig.php index 647c9b65ad4..6e1a88945a1 100644 --- a/install/lang/el/langconfig.php +++ b/install/lang/el/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/el/moodle.php b/install/lang/el/moodle.php index 932b3598dfb..9917dd6832a 100644 --- a/install/lang/el/moodle.php +++ b/install/lang/el/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/en/admin.php b/install/lang/en/admin.php index a1b495ecd68..d379d73bce5 100644 --- a/install/lang/en/admin.php +++ b/install/lang/en/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/en/error.php b/install/lang/en/error.php index 9dd01780393..8aa8ce1e5fe 100644 --- a/install/lang/en/error.php +++ b/install/lang/en/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/en/install.php b/install/lang/en/install.php index 474907a5166..f1d5f2aa700 100644 --- a/install/lang/en/install.php +++ b/install/lang/en/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/en/langconfig.php b/install/lang/en/langconfig.php index 00b9943d555..b3004881f3b 100644 --- a/install/lang/en/langconfig.php +++ b/install/lang/en/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/en/moodle.php b/install/lang/en/moodle.php index deea583d4d6..98251f0b34c 100644 --- a/install/lang/en/moodle.php +++ b/install/lang/en/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/en_ar/langconfig.php b/install/lang/en_ar/langconfig.php index 809db1ac2bf..78d60d7bcbf 100644 --- a/install/lang/en_ar/langconfig.php +++ b/install/lang/en_ar/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/en_us/install.php b/install/lang/en_us/install.php index 7297a550cb1..0164ca70379 100644 --- a/install/lang/en_us/install.php +++ b/install/lang/en_us/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/en_us/langconfig.php b/install/lang/en_us/langconfig.php index 6c32e579e45..dcd64bc900d 100644 --- a/install/lang/en_us/langconfig.php +++ b/install/lang/en_us/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/es/admin.php b/install/lang/es/admin.php index cf8b468bdf3..63f018a1db9 100644 --- a/install/lang/es/admin.php +++ b/install/lang/es/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/es/error.php b/install/lang/es/error.php index 753173310f3..31096efe6d3 100644 --- a/install/lang/es/error.php +++ b/install/lang/es/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/es/install.php b/install/lang/es/install.php index 750165db5e4..e239a5fb24e 100644 --- a/install/lang/es/install.php +++ b/install/lang/es/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/es/langconfig.php b/install/lang/es/langconfig.php index 6fefc1784f0..4deb64a259c 100644 --- a/install/lang/es/langconfig.php +++ b/install/lang/es/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/es/moodle.php b/install/lang/es/moodle.php index fd0543cce01..2b6d46e9bc0 100644 --- a/install/lang/es/moodle.php +++ b/install/lang/es/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/es_ar/langconfig.php b/install/lang/es_ar/langconfig.php index fc5c484046e..617a3b59d44 100644 --- a/install/lang/es_ar/langconfig.php +++ b/install/lang/es_ar/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/es_es/langconfig.php b/install/lang/es_es/langconfig.php index dbc154cf565..64e5358bd55 100644 --- a/install/lang/es_es/langconfig.php +++ b/install/lang/es_es/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/es_mx/admin.php b/install/lang/es_mx/admin.php index 350e39c4d7e..3a4f225714c 100644 --- a/install/lang/es_mx/admin.php +++ b/install/lang/es_mx/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/es_mx/error.php b/install/lang/es_mx/error.php new file mode 100644 index 00000000000..31096efe6d3 --- /dev/null +++ b/install/lang/es_mx/error.php @@ -0,0 +1,48 @@ +. + +/** + * Automatically generated strings for Moodle installer + * + * Do not edit this file manually! It contains just a subset of strings + * needed during the very first steps of installation. This file was + * generated automatically by export-installer.php (which is part of AMOS + * {@link http://docs.moodle.org/dev/Languages/AMOS}) using the + * list of strings defined in /install/stringnames.txt. + * + * @package installer + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$string['cannotcreatelangdir'] = 'No se puede crear el directorio de idioma.'; +$string['cannotcreatetempdir'] = 'No se puede crear el directorio temp.'; +$string['cannotdownloadcomponents'] = 'No se puede descargar componentes'; +$string['cannotdownloadzipfile'] = 'No se puede descargar el archivo ZIP'; +$string['cannotfindcomponent'] = 'No se puede encontrar el componente.'; +$string['cannotsavemd5file'] = 'No se puede guardar el archivo md5'; +$string['cannotsavezipfile'] = 'No se puede guardar el archivo ZIP'; +$string['cannotunzipfile'] = 'No se puede descomprimir el archivo'; +$string['componentisuptodate'] = 'El componente está actualizado'; +$string['downloadedfilecheckfailed'] = 'Ha fallado la comprobación del archivo descargado'; +$string['invalidmd5'] = 'La variable de verificación MD5 es incorrecta no es valida - trate nuevamente'; +$string['missingrequiredfield'] = 'Falta algún campo necesario'; +$string['remotedownloaderror'] = 'Falló la descarga del componente a su servidor. Se recomienda verificar los ajustes del proxy, extensión PHP cURL.

      Debe descargar el{$a->url} archivo manualmente, copiarlo en "{$a->dest}" en su servidor y descomprimirlo allí.'; +$string['wrongdestpath'] = 'Ruta de destino errónea.'; +$string['wrongsourcebase'] = 'Base de fuente de URL errónea.'; +$string['wrongzipfilename'] = 'Nombre de archivo ZIP erróneo.'; diff --git a/install/lang/es_mx/install.php b/install/lang/es_mx/install.php index 0034c56aeff..91a4a09ca65 100644 --- a/install/lang/es_mx/install.php +++ b/install/lang/es_mx/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was @@ -30,10 +30,67 @@ defined('MOODLE_INTERNAL') || die(); +$string['admindirname'] = 'Directorio Admin'; +$string['availablelangs'] = 'Lista de idiomas disponibles'; +$string['chooselanguagehead'] = 'Seleccionar idioma'; +$string['chooselanguagesub'] = 'Por favor, seleccione un idioma para el proceso de instalación. Este idioma se usará también como idioma por defecto del sitio, si bien puede cambiarse más adelante.'; +$string['clialreadyconfigured'] = 'El archivo config.php ya existe, por favor use admin/cli/install_database.php si desea instalar este sitio'; +$string['clialreadyinstalled'] = 'El archivo config.php ya existe. Por favor, utilice admin/cli/upgrade.php si desea actualizar su sitio web.'; +$string['cliinstallheader'] = 'Programa de instalación Moodle de línea de comando {$a}'; $string['databasehost'] = 'host de la Base de Datos'; +$string['databasename'] = 'Nombre de la base de datos'; +$string['databasetypehead'] = 'Seleccione el controlador de la base de datos'; +$string['dataroot'] = 'Directorio de Datos'; $string['datarootpermission'] = 'Permiso directorios de datos'; +$string['dbprefix'] = 'Prefijo de tablas'; +$string['dirroot'] = 'Directorio Moodle'; +$string['environmenthead'] = 'Comprobando su entorno'; $string['environmentsub2'] = 'Cada versión de Moodle tiene algún requisito mínimo de la versión de PHP y un número obligatorio de extensiones de PHP. Una comprobación del entorno completo se realiza antes de cada instalación y actualización. Por favor, póngase en contacto con el administrador del servidor si no sabe cómo instalar la nueva versión o habilitar las extensiones PHP.'; $string['errorsinenvironment'] = '¡La comprobación del entorno falló!'; +$string['installation'] = 'Instalación'; +$string['langdownloaderror'] = 'El idioma "{$a}" no pudo ser instalado. El proceso de instalación continuará en inglés.'; +$string['memorylimithelp'] = '

      El límite de memoria PHP en su servidor es actualmente {$a}.

      + +

      Esto puede ocasionar que Moodle tenga problemas de memoria más adelante, especialmente si usted tiene activados muchos módulos y/o muchos usuarios.

      + +

      Recomendamos que configure PHP con el límite más alto posible, e.g. 40M. +Hay varias formas de hacer esto:

      +
        +
      1. Si puede hacerlo, recompile PHP con --enable-memory-limit. +Esto hace que Moodle fije por sí mismo el límite de memoria.
      2. +
      3. Si usted tiene acceso al archivo php.ini, puede cambiar el ajuste memory_limit +a, digamos, 40M. Si no lo tiene, pida a su administrador que lo haga por usted.
      4. +
      5. En algunos servidores PHP usted puede crear en el directorio Moodle un archivo .htaccess que contenga esta línea: +

        php_value memory_limit 40M

        +

        Sin embargo, en algunos servidores esto hace que todas las páginas PHP dejen de funcionar +(podrá ver los errores cuando mire las páginas) de modo que tendrá que eliminar el archivo .htaccess.

      6. +
      '; +$string['paths'] = 'Rutas'; +$string['pathserrcreatedataroot'] = 'El directorio de los datos ({$a->dataroot}) no puede ser creado por el instalador.'; +$string['pathshead'] = 'Confirme las rutas'; +$string['pathsrodataroot'] = 'El directorio dataroot no tiene permisos de escritura.'; +$string['pathsroparentdataroot'] = 'El directorio padre ({$a->parent}) no tiene permisos de escritura. El directorio de los datos ({$a->dataroot}) no puede ser creado por el instalador.'; +$string['pathssubadmindir'] = 'Muy pocos servidores web usan /admin como un URL especial para acceder a un +panel de control o algo similar. Lamentablemente, esto entra en conflicto con la ubicación estándar para las páginas de administración de Moodle. Usted puede solucionar este problema, renombrando el directorio admin en su instalación Moodle, poniendo un nuevo nombre aquí. Por ejemplo: moodleadmin . Esto solucionará los enlaces de administración en instalación Moodle.'; +$string['pathssubdataroot'] = 'Usted necesita un espacio donde Moodle puede guardar los archivos subidos. En este directorio debe poder LEER y ESCRIBIR el usuario del servidor web (por lo general \'nobody\', \'apache\' o \'www-data\'), pero no debe poderse acceder a esta carpeta directamente a través de la web. El instalador tratará de crearla si no existe.'; +$string['pathssubdirroot'] = 'Ruta completa del directorio de instalación de Moodle.'; +$string['pathssubwwwroot'] = 'Dirección web completa para acceder a Moodle. No es posible acceder a Moodle utilizando múltiples direcciones. Si su sitio tiene varias direcciones públicas debe configurar redirecciones permanentes en todas ellas, excepto en ésta. Si su sitio web es accesible tanto desde una intranet como desde Internet, escriba aquí la dirección pública y configure su DNS para que los usuarios de su intranet puedan también utilizar la dirección pública.'; +$string['pathsunsecuredataroot'] = 'La ubicación de dataroot no es segura'; +$string['pathswrongadmindir'] = 'El directorio admin no existe'; +$string['phpextension'] = 'Extensión PHP {$a}'; +$string['phpversion'] = 'Versión PHP'; +$string['phpversionhelp'] = '

      Moodle requiere al menos una versión de PHP 4.3.0 o 5.1.0 ((5.0.x tiene una serie de problemas conocidos).

      +

      En este momento está ejecutando la versión {$a}

      +

      ¡Debe actualizar PHP o trasladarse a otro servidor con una versión más reciente de PHP!
      +(En caso de 5.0.x podría también revertir a la versión 4.4.x)

      '; +$string['welcomep10'] = '{$a->installername} ({$a->installerversion})'; $string['welcomep20'] = 'Si está viendo esta página es porque ha podido ejecutar el paquete {$a->packname} {$a->packversion} en su computadora. !Enhorabuena!'; $string['welcomep30'] = 'Esta versión de {$a->installername} incluye las aplicaciones necesarias para que Moodle funcione en su computadora principalmente:'; +$string['welcomep40'] = 'El paquete también incluye Moodle {$a->moodlerelease} ({$a->moodleversion}).'; +$string['welcomep50'] = 'El uso de todas las aplicaciones del paquete está gobernado por sus respectivas + licencias. El programa {$a->installername} es + código abierto y se distribuye + bajo licencia GPL.'; $string['welcomep60'] = 'Las siguientes páginas le guiarán a través de algunos sencillos pasos para configurar y ajustar Moodle en su computadora. Puede utilizar los valores por defecto sugeridos o, de forma opcional, modificarlos para que se ajusten a sus necesidades.'; +$string['welcomep70'] = 'Pulse en el botón "Siguiente" para continuar con la configuración de Moodle.'; +$string['wwwroot'] = 'Dirección Web'; diff --git a/install/lang/es_mx/langconfig.php b/install/lang/es_mx/langconfig.php index 05f1ebd0321..1dfd27c999f 100644 --- a/install/lang/es_mx/langconfig.php +++ b/install/lang/es_mx/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/et/admin.php b/install/lang/et/admin.php index cae3554ab34..3dbf987a882 100644 --- a/install/lang/et/admin.php +++ b/install/lang/et/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/et/error.php b/install/lang/et/error.php index bcb625e2c83..b6ba49548cf 100644 --- a/install/lang/et/error.php +++ b/install/lang/et/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/et/install.php b/install/lang/et/install.php index da6709f562b..e034d3d777e 100644 --- a/install/lang/et/install.php +++ b/install/lang/et/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/et/langconfig.php b/install/lang/et/langconfig.php index bf795114bbe..7ed7a1fc7c5 100644 --- a/install/lang/et/langconfig.php +++ b/install/lang/et/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/et/moodle.php b/install/lang/et/moodle.php index 7b822604f54..49c6c2107fb 100644 --- a/install/lang/et/moodle.php +++ b/install/lang/et/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/eu/admin.php b/install/lang/eu/admin.php index 29f9180147b..51e908ce295 100644 --- a/install/lang/eu/admin.php +++ b/install/lang/eu/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/eu/error.php b/install/lang/eu/error.php index baf17490972..63abc399c7b 100644 --- a/install/lang/eu/error.php +++ b/install/lang/eu/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/eu/install.php b/install/lang/eu/install.php index 682ee9b1108..5f4df030a8d 100644 --- a/install/lang/eu/install.php +++ b/install/lang/eu/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/eu/langconfig.php b/install/lang/eu/langconfig.php index 66f2f201e5f..1edeb1d674f 100644 --- a/install/lang/eu/langconfig.php +++ b/install/lang/eu/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/eu/moodle.php b/install/lang/eu/moodle.php index bfab1ba5c35..b672e38572d 100644 --- a/install/lang/eu/moodle.php +++ b/install/lang/eu/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/fa/admin.php b/install/lang/fa/admin.php index c59c89c69f3..e6c88d160dd 100644 --- a/install/lang/fa/admin.php +++ b/install/lang/fa/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/fa/install.php b/install/lang/fa/install.php index 2ec22533bf0..197c8ca6167 100644 --- a/install/lang/fa/install.php +++ b/install/lang/fa/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/fa/langconfig.php b/install/lang/fa/langconfig.php index cc9eac6c8db..c4c5c60d2fd 100644 --- a/install/lang/fa/langconfig.php +++ b/install/lang/fa/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/fa/moodle.php b/install/lang/fa/moodle.php index 7be18cdfdb1..0748cc8c263 100644 --- a/install/lang/fa/moodle.php +++ b/install/lang/fa/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/fi/admin.php b/install/lang/fi/admin.php index 6fd1b3526aa..ca02ff8dbf5 100644 --- a/install/lang/fi/admin.php +++ b/install/lang/fi/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/fi/error.php b/install/lang/fi/error.php index 38af115f69b..8b7de2ae5e8 100644 --- a/install/lang/fi/error.php +++ b/install/lang/fi/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/fi/install.php b/install/lang/fi/install.php index 00f01dce214..61496e6928b 100644 --- a/install/lang/fi/install.php +++ b/install/lang/fi/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/fi/langconfig.php b/install/lang/fi/langconfig.php index 86b7b7c0828..40a772ad006 100644 --- a/install/lang/fi/langconfig.php +++ b/install/lang/fi/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/fi/moodle.php b/install/lang/fi/moodle.php index 20f77f99bf8..3045e1e087d 100644 --- a/install/lang/fi/moodle.php +++ b/install/lang/fi/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/fil/langconfig.php b/install/lang/fil/langconfig.php index ecabec030ea..29ec638f001 100644 --- a/install/lang/fil/langconfig.php +++ b/install/lang/fil/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/fil/moodle.php b/install/lang/fil/moodle.php index 3a359d09932..ac42c3914c5 100644 --- a/install/lang/fil/moodle.php +++ b/install/lang/fil/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/fj/langconfig.php b/install/lang/fj/langconfig.php index 86774b7ba0d..1f9a9a41394 100644 --- a/install/lang/fj/langconfig.php +++ b/install/lang/fj/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/fo/langconfig.php b/install/lang/fo/langconfig.php index b64efc47399..9395d7d7eed 100644 --- a/install/lang/fo/langconfig.php +++ b/install/lang/fo/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/fr/admin.php b/install/lang/fr/admin.php index fc690dd56a9..240f03232c7 100644 --- a/install/lang/fr/admin.php +++ b/install/lang/fr/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/fr/error.php b/install/lang/fr/error.php index 877fc16a79d..d30b620590b 100644 --- a/install/lang/fr/error.php +++ b/install/lang/fr/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/fr/install.php b/install/lang/fr/install.php index 3c3df5f1596..1b3684c3429 100644 --- a/install/lang/fr/install.php +++ b/install/lang/fr/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/fr/langconfig.php b/install/lang/fr/langconfig.php index ef21459ba0b..e5c1422705c 100644 --- a/install/lang/fr/langconfig.php +++ b/install/lang/fr/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was @@ -30,5 +30,6 @@ defined('MOODLE_INTERNAL') || die(); +$string['parentlanguage'] = ''; $string['thisdirection'] = 'ltr'; $string['thislanguage'] = 'Français'; diff --git a/install/lang/fr/moodle.php b/install/lang/fr/moodle.php index dc9847622f1..58e103ce9d2 100644 --- a/install/lang/fr/moodle.php +++ b/install/lang/fr/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/fr_ca/install.php b/install/lang/fr_ca/install.php index 374567cfe84..55c941d0b27 100644 --- a/install/lang/fr_ca/install.php +++ b/install/lang/fr_ca/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/fr_ca/langconfig.php b/install/lang/fr_ca/langconfig.php index 95516888ef8..1b1e66df7ed 100644 --- a/install/lang/fr_ca/langconfig.php +++ b/install/lang/fr_ca/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/fr_ca/moodle.php b/install/lang/fr_ca/moodle.php index 4f71d44f43b..d07a006fc05 100644 --- a/install/lang/fr_ca/moodle.php +++ b/install/lang/fr_ca/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ga/langconfig.php b/install/lang/ga/langconfig.php index 5fbf52592a2..9cea86ca30f 100644 --- a/install/lang/ga/langconfig.php +++ b/install/lang/ga/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/gd/langconfig.php b/install/lang/gd/langconfig.php index 84921cc9939..25104f97bc8 100644 --- a/install/lang/gd/langconfig.php +++ b/install/lang/gd/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/gl/admin.php b/install/lang/gl/admin.php index 400f2bfe8e8..8257ceab3a7 100644 --- a/install/lang/gl/admin.php +++ b/install/lang/gl/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/gl/error.php b/install/lang/gl/error.php index dcdba565b78..5fac7663f56 100644 --- a/install/lang/gl/error.php +++ b/install/lang/gl/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/gl/install.php b/install/lang/gl/install.php index b1cd753ef06..0785fc3fe4a 100644 --- a/install/lang/gl/install.php +++ b/install/lang/gl/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/gl/langconfig.php b/install/lang/gl/langconfig.php index 52c1df5946b..5daa47cea07 100644 --- a/install/lang/gl/langconfig.php +++ b/install/lang/gl/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/gl/moodle.php b/install/lang/gl/moodle.php index e5474c7ba73..e77ba8343e8 100644 --- a/install/lang/gl/moodle.php +++ b/install/lang/gl/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/gu/error.php b/install/lang/gu/error.php index 4c168c06a0b..1e058b55265 100644 --- a/install/lang/gu/error.php +++ b/install/lang/gu/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/gu/langconfig.php b/install/lang/gu/langconfig.php index 58e1446dc54..8b8ab4f9b04 100644 --- a/install/lang/gu/langconfig.php +++ b/install/lang/gu/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/gu/moodle.php b/install/lang/gu/moodle.php index c0a353ae65c..8d519ffce06 100644 --- a/install/lang/gu/moodle.php +++ b/install/lang/gu/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/he/admin.php b/install/lang/he/admin.php index eb6550f00dd..d63a26764eb 100644 --- a/install/lang/he/admin.php +++ b/install/lang/he/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/he/error.php b/install/lang/he/error.php index 4f967f6b902..6a2e54808e1 100644 --- a/install/lang/he/error.php +++ b/install/lang/he/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/he/install.php b/install/lang/he/install.php index e107fcdc05d..d6cb0aef16d 100644 --- a/install/lang/he/install.php +++ b/install/lang/he/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/he/langconfig.php b/install/lang/he/langconfig.php index 1f14bf5449f..b764fffadb3 100644 --- a/install/lang/he/langconfig.php +++ b/install/lang/he/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/he/moodle.php b/install/lang/he/moodle.php index 44dc4393a6d..cf90fc3e996 100644 --- a/install/lang/he/moodle.php +++ b/install/lang/he/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/hi/langconfig.php b/install/lang/hi/langconfig.php index 7581cfa65d5..599c1055c71 100644 --- a/install/lang/hi/langconfig.php +++ b/install/lang/hi/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/hi/moodle.php b/install/lang/hi/moodle.php index 18843e4bebe..3aa5287ea40 100644 --- a/install/lang/hi/moodle.php +++ b/install/lang/hi/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/hr/admin.php b/install/lang/hr/admin.php index a0291208036..7445a733936 100644 --- a/install/lang/hr/admin.php +++ b/install/lang/hr/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/hr/error.php b/install/lang/hr/error.php index a88b87bae40..0ef97770066 100644 --- a/install/lang/hr/error.php +++ b/install/lang/hr/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/hr/install.php b/install/lang/hr/install.php index 91d10caaca5..042b327acc8 100644 --- a/install/lang/hr/install.php +++ b/install/lang/hr/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/hr/langconfig.php b/install/lang/hr/langconfig.php index d7ccfa50fca..826ce34cde2 100644 --- a/install/lang/hr/langconfig.php +++ b/install/lang/hr/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/hr/moodle.php b/install/lang/hr/moodle.php index 77ad7d9ecbe..62aec644b2c 100644 --- a/install/lang/hr/moodle.php +++ b/install/lang/hr/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/hu/admin.php b/install/lang/hu/admin.php index 00c38511bed..c718db2b33b 100644 --- a/install/lang/hu/admin.php +++ b/install/lang/hu/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/hu/error.php b/install/lang/hu/error.php index 6805dcae58a..52a8c02fba6 100644 --- a/install/lang/hu/error.php +++ b/install/lang/hu/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/hu/install.php b/install/lang/hu/install.php index 2bedea2a6ac..39fdf505610 100644 --- a/install/lang/hu/install.php +++ b/install/lang/hu/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/hu/langconfig.php b/install/lang/hu/langconfig.php index 7a7b36bc090..05963fc4bdc 100644 --- a/install/lang/hu/langconfig.php +++ b/install/lang/hu/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/hu/moodle.php b/install/lang/hu/moodle.php index f1a4a64c550..e3aa83c100a 100644 --- a/install/lang/hu/moodle.php +++ b/install/lang/hu/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/hy/admin.php b/install/lang/hy/admin.php index 670aeb17050..72348c79d9e 100644 --- a/install/lang/hy/admin.php +++ b/install/lang/hy/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/hy/error.php b/install/lang/hy/error.php index d2b51c688df..c99049bd8fc 100644 --- a/install/lang/hy/error.php +++ b/install/lang/hy/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/hy/install.php b/install/lang/hy/install.php index 17a6fc8038c..dd6241f042e 100644 --- a/install/lang/hy/install.php +++ b/install/lang/hy/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/hy/langconfig.php b/install/lang/hy/langconfig.php index 061c876ddc3..57dd669925a 100644 --- a/install/lang/hy/langconfig.php +++ b/install/lang/hy/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/hy/moodle.php b/install/lang/hy/moodle.php index 5fe0ddb0688..3aa527f9ede 100644 --- a/install/lang/hy/moodle.php +++ b/install/lang/hy/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/id/langconfig.php b/install/lang/id/langconfig.php index a630a6dbe13..90306660b32 100644 --- a/install/lang/id/langconfig.php +++ b/install/lang/id/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/id/moodle.php b/install/lang/id/moodle.php index 8a6e42f2364..81eb64bf01a 100644 --- a/install/lang/id/moodle.php +++ b/install/lang/id/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/is/admin.php b/install/lang/is/admin.php index 71556d01267..1b5f34ad242 100644 --- a/install/lang/is/admin.php +++ b/install/lang/is/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/is/error.php b/install/lang/is/error.php index cf9e7d65ff4..b4dfe23d719 100644 --- a/install/lang/is/error.php +++ b/install/lang/is/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/is/install.php b/install/lang/is/install.php index 0f3cab85e57..34ba4aa295d 100644 --- a/install/lang/is/install.php +++ b/install/lang/is/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/is/langconfig.php b/install/lang/is/langconfig.php index 0541eb3ecea..4de4bef0c8b 100644 --- a/install/lang/is/langconfig.php +++ b/install/lang/is/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/is/moodle.php b/install/lang/is/moodle.php index fffa488a486..2c946f49127 100644 --- a/install/lang/is/moodle.php +++ b/install/lang/is/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/it/admin.php b/install/lang/it/admin.php index 62c0f175b91..dbd083572bc 100644 --- a/install/lang/it/admin.php +++ b/install/lang/it/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/it/error.php b/install/lang/it/error.php index b11282781eb..7b9d9c0845f 100644 --- a/install/lang/it/error.php +++ b/install/lang/it/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/it/install.php b/install/lang/it/install.php index 3ff22f79150..3869ff3a715 100644 --- a/install/lang/it/install.php +++ b/install/lang/it/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/it/langconfig.php b/install/lang/it/langconfig.php index 86a2d7b783b..1b8da4463bd 100644 --- a/install/lang/it/langconfig.php +++ b/install/lang/it/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/it/moodle.php b/install/lang/it/moodle.php index 7e8e9b0b0c0..b831e82fe08 100644 --- a/install/lang/it/moodle.php +++ b/install/lang/it/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ja/admin.php b/install/lang/ja/admin.php index fcf6b2ef9d5..0961ea00538 100644 --- a/install/lang/ja/admin.php +++ b/install/lang/ja/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ja/error.php b/install/lang/ja/error.php index 6ceff15ce48..36c40fe7ea3 100644 --- a/install/lang/ja/error.php +++ b/install/lang/ja/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ja/install.php b/install/lang/ja/install.php index eb9e75696fc..dce0b840d5d 100644 --- a/install/lang/ja/install.php +++ b/install/lang/ja/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ja/langconfig.php b/install/lang/ja/langconfig.php index ff4aaa23067..a0245d5dc26 100644 --- a/install/lang/ja/langconfig.php +++ b/install/lang/ja/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was @@ -30,5 +30,6 @@ defined('MOODLE_INTERNAL') || die(); +$string['parentlanguage'] = 'en'; $string['thisdirection'] = 'ltr'; $string['thislanguage'] = '日本語'; diff --git a/install/lang/ja/moodle.php b/install/lang/ja/moodle.php index 98f5c60c699..cee59e15436 100644 --- a/install/lang/ja/moodle.php +++ b/install/lang/ja/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ka/admin.php b/install/lang/ka/admin.php index 7877d346fb0..d7d12a40d59 100644 --- a/install/lang/ka/admin.php +++ b/install/lang/ka/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ka/install.php b/install/lang/ka/install.php index 6c84297ff1b..3ffbdac6f17 100644 --- a/install/lang/ka/install.php +++ b/install/lang/ka/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ka/langconfig.php b/install/lang/ka/langconfig.php index 0525f02b590..85059a861fb 100644 --- a/install/lang/ka/langconfig.php +++ b/install/lang/ka/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ka/moodle.php b/install/lang/ka/moodle.php index 8445a3150ce..dc426a2f4b5 100644 --- a/install/lang/ka/moodle.php +++ b/install/lang/ka/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/kk/install.php b/install/lang/kk/install.php index 021a0bc826b..8b58f148d5e 100644 --- a/install/lang/kk/install.php +++ b/install/lang/kk/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/kk/langconfig.php b/install/lang/kk/langconfig.php index 7179f07fab2..7b83b7672a6 100644 --- a/install/lang/kk/langconfig.php +++ b/install/lang/kk/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/kk/moodle.php b/install/lang/kk/moodle.php index 91c32c86fa1..5c9d42c9bf8 100644 --- a/install/lang/kk/moodle.php +++ b/install/lang/kk/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/kl/langconfig.php b/install/lang/kl/langconfig.php index 06e2ba396da..5f34274f11f 100644 --- a/install/lang/kl/langconfig.php +++ b/install/lang/kl/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/km/admin.php b/install/lang/km/admin.php index f81de8120a1..6b5b2408481 100644 --- a/install/lang/km/admin.php +++ b/install/lang/km/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/km/error.php b/install/lang/km/error.php index b46f53cf694..114fcfe083e 100644 --- a/install/lang/km/error.php +++ b/install/lang/km/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/km/install.php b/install/lang/km/install.php index 7a4519e24a4..eee6bdad8ba 100644 --- a/install/lang/km/install.php +++ b/install/lang/km/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/km/langconfig.php b/install/lang/km/langconfig.php index 7e6932bcd9f..27379cad1d0 100644 --- a/install/lang/km/langconfig.php +++ b/install/lang/km/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/km/moodle.php b/install/lang/km/moodle.php index d0997229469..99166c8387e 100644 --- a/install/lang/km/moodle.php +++ b/install/lang/km/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/kn/langconfig.php b/install/lang/kn/langconfig.php index 3f3f0f6d8b3..b0337947e2a 100644 --- a/install/lang/kn/langconfig.php +++ b/install/lang/kn/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ko/admin.php b/install/lang/ko/admin.php index e2c335b9eb3..5dde0850ef6 100644 --- a/install/lang/ko/admin.php +++ b/install/lang/ko/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ko/error.php b/install/lang/ko/error.php index 03d8b5f6a20..a8c4db7ec6d 100644 --- a/install/lang/ko/error.php +++ b/install/lang/ko/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ko/install.php b/install/lang/ko/install.php index 4670869c0ac..c8574b51f01 100644 --- a/install/lang/ko/install.php +++ b/install/lang/ko/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ko/langconfig.php b/install/lang/ko/langconfig.php index 7f44172282c..8f675eb01be 100644 --- a/install/lang/ko/langconfig.php +++ b/install/lang/ko/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ko/moodle.php b/install/lang/ko/moodle.php index 50241c9401e..358febe30da 100644 --- a/install/lang/ko/moodle.php +++ b/install/lang/ko/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/la/langconfig.php b/install/lang/la/langconfig.php index cdc18ca8216..4eb8ce33dcb 100644 --- a/install/lang/la/langconfig.php +++ b/install/lang/la/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/la/moodle.php b/install/lang/la/moodle.php index 350d11cd98e..de3e13f5644 100644 --- a/install/lang/la/moodle.php +++ b/install/lang/la/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/lo/admin.php b/install/lang/lo/admin.php index a38334e5cc6..09793cf57c4 100644 --- a/install/lang/lo/admin.php +++ b/install/lang/lo/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/lo/install.php b/install/lang/lo/install.php index 1e551c1f995..f0652a77a5d 100644 --- a/install/lang/lo/install.php +++ b/install/lang/lo/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/lo/langconfig.php b/install/lang/lo/langconfig.php index 1a377171505..c93ae35ffe7 100644 --- a/install/lang/lo/langconfig.php +++ b/install/lang/lo/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/lo/moodle.php b/install/lang/lo/moodle.php index 1e2006ecc65..80a8700f086 100644 --- a/install/lang/lo/moodle.php +++ b/install/lang/lo/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/lt/admin.php b/install/lang/lt/admin.php index 61ecc371c92..f97528e931c 100644 --- a/install/lang/lt/admin.php +++ b/install/lang/lt/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/lt/langconfig.php b/install/lang/lt/langconfig.php index a43e3653d91..a95d1e497c7 100644 --- a/install/lang/lt/langconfig.php +++ b/install/lang/lt/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/lt/moodle.php b/install/lang/lt/moodle.php index 2deaa383023..abfff848f60 100644 --- a/install/lang/lt/moodle.php +++ b/install/lang/lt/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/lt_uni/langconfig.php b/install/lang/lt_uni/langconfig.php index 17ae4da61de..1b80a4cccd0 100644 --- a/install/lang/lt_uni/langconfig.php +++ b/install/lang/lt_uni/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/lv/admin.php b/install/lang/lv/admin.php index b5a846e4916..1cf888fd89f 100644 --- a/install/lang/lv/admin.php +++ b/install/lang/lv/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/lv/error.php b/install/lang/lv/error.php index c181e48f293..5d8fab28393 100644 --- a/install/lang/lv/error.php +++ b/install/lang/lv/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/lv/install.php b/install/lang/lv/install.php index 6d24b7e829c..eb533470766 100644 --- a/install/lang/lv/install.php +++ b/install/lang/lv/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/lv/langconfig.php b/install/lang/lv/langconfig.php index 8357875cb30..fb11157c6f7 100644 --- a/install/lang/lv/langconfig.php +++ b/install/lang/lv/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/lv/moodle.php b/install/lang/lv/moodle.php index e09039ed812..ee24963b00a 100644 --- a/install/lang/lv/moodle.php +++ b/install/lang/lv/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/mi_tn/langconfig.php b/install/lang/mi_tn/langconfig.php index 27a572c7215..6642f3e0581 100644 --- a/install/lang/mi_tn/langconfig.php +++ b/install/lang/mi_tn/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/mi_tn/moodle.php b/install/lang/mi_tn/moodle.php index b754d16bf04..8cb8c7053b8 100644 --- a/install/lang/mi_tn/moodle.php +++ b/install/lang/mi_tn/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/mi_wwow/admin.php b/install/lang/mi_wwow/admin.php index bbc6dca2949..21f236e991d 100644 --- a/install/lang/mi_wwow/admin.php +++ b/install/lang/mi_wwow/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/mi_wwow/error.php b/install/lang/mi_wwow/error.php index 76f481f4d15..06ae7b97895 100644 --- a/install/lang/mi_wwow/error.php +++ b/install/lang/mi_wwow/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/mi_wwow/install.php b/install/lang/mi_wwow/install.php index 1e8331fee36..ced09ad17b1 100644 --- a/install/lang/mi_wwow/install.php +++ b/install/lang/mi_wwow/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/mi_wwow/langconfig.php b/install/lang/mi_wwow/langconfig.php index debdd13e09c..f19226321ff 100644 --- a/install/lang/mi_wwow/langconfig.php +++ b/install/lang/mi_wwow/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/mi_wwow/moodle.php b/install/lang/mi_wwow/moodle.php index 5310575943a..1dad84fae49 100644 --- a/install/lang/mi_wwow/moodle.php +++ b/install/lang/mi_wwow/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/mk/admin.php b/install/lang/mk/admin.php index c40d02a0ca4..d14187baa0f 100644 --- a/install/lang/mk/admin.php +++ b/install/lang/mk/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/mk/error.php b/install/lang/mk/error.php index 16a667b6334..ceb6cbc824f 100644 --- a/install/lang/mk/error.php +++ b/install/lang/mk/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/mk/install.php b/install/lang/mk/install.php index 935b4b5d230..58421d5452b 100644 --- a/install/lang/mk/install.php +++ b/install/lang/mk/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/mk/langconfig.php b/install/lang/mk/langconfig.php index b3ace417b97..154927235db 100644 --- a/install/lang/mk/langconfig.php +++ b/install/lang/mk/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/mk/moodle.php b/install/lang/mk/moodle.php index a8e9874aded..713ae267dfa 100644 --- a/install/lang/mk/moodle.php +++ b/install/lang/mk/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ml/langconfig.php b/install/lang/ml/langconfig.php index b35661f8c87..c18ee70c395 100644 --- a/install/lang/ml/langconfig.php +++ b/install/lang/ml/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ml/moodle.php b/install/lang/ml/moodle.php index 1bec73a6b0b..70fe5fcbbb6 100644 --- a/install/lang/ml/moodle.php +++ b/install/lang/ml/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/mn/admin.php b/install/lang/mn/admin.php index ce30732f0c1..198121440ef 100644 --- a/install/lang/mn/admin.php +++ b/install/lang/mn/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/mn/error.php b/install/lang/mn/error.php index 98fc6eac362..6acd4b5195d 100644 --- a/install/lang/mn/error.php +++ b/install/lang/mn/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/mn/install.php b/install/lang/mn/install.php index 7e8947d5b1e..a6e5000c500 100644 --- a/install/lang/mn/install.php +++ b/install/lang/mn/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/mn/langconfig.php b/install/lang/mn/langconfig.php index 88ed237a5ae..eb71580d3cc 100644 --- a/install/lang/mn/langconfig.php +++ b/install/lang/mn/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/mn/moodle.php b/install/lang/mn/moodle.php index 5f241ce40b7..c8037c8c106 100644 --- a/install/lang/mn/moodle.php +++ b/install/lang/mn/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/mr/admin.php b/install/lang/mr/admin.php index ba539db4130..5a5cfb0793d 100644 --- a/install/lang/mr/admin.php +++ b/install/lang/mr/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/mr/error.php b/install/lang/mr/error.php index 9264715fbbe..f75749e3870 100644 --- a/install/lang/mr/error.php +++ b/install/lang/mr/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/mr/install.php b/install/lang/mr/install.php index 48d33dc9c31..060912b04a5 100644 --- a/install/lang/mr/install.php +++ b/install/lang/mr/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/mr/langconfig.php b/install/lang/mr/langconfig.php index 6eee6931331..d59e902d34f 100644 --- a/install/lang/mr/langconfig.php +++ b/install/lang/mr/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/mr/moodle.php b/install/lang/mr/moodle.php index 1164e4d894b..12d4918721e 100644 --- a/install/lang/mr/moodle.php +++ b/install/lang/mr/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ms/langconfig.php b/install/lang/ms/langconfig.php index 38e9c978883..acb0530e5da 100644 --- a/install/lang/ms/langconfig.php +++ b/install/lang/ms/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ne/langconfig.php b/install/lang/ne/langconfig.php index 5642f464a9f..52e8e9e6485 100644 --- a/install/lang/ne/langconfig.php +++ b/install/lang/ne/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/nl/admin.php b/install/lang/nl/admin.php index 8bf5c86f3b3..37d686ab7fa 100644 --- a/install/lang/nl/admin.php +++ b/install/lang/nl/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/nl/error.php b/install/lang/nl/error.php index 438515c9597..7ab273741a4 100644 --- a/install/lang/nl/error.php +++ b/install/lang/nl/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/nl/install.php b/install/lang/nl/install.php index fb5902b91c1..347e4371609 100644 --- a/install/lang/nl/install.php +++ b/install/lang/nl/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/nl/langconfig.php b/install/lang/nl/langconfig.php index 116df4e7b5d..5591fe537f8 100644 --- a/install/lang/nl/langconfig.php +++ b/install/lang/nl/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/nl/moodle.php b/install/lang/nl/moodle.php index 077af25432b..53cc6ea589e 100644 --- a/install/lang/nl/moodle.php +++ b/install/lang/nl/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/nn/langconfig.php b/install/lang/nn/langconfig.php index 3e5523b5a9b..777f1b53c9a 100644 --- a/install/lang/nn/langconfig.php +++ b/install/lang/nn/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/nn/moodle.php b/install/lang/nn/moodle.php index c2d36f78429..520f6f87f90 100644 --- a/install/lang/nn/moodle.php +++ b/install/lang/nn/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/no/admin.php b/install/lang/no/admin.php index 9740caf125b..bc5626a4056 100644 --- a/install/lang/no/admin.php +++ b/install/lang/no/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/no/error.php b/install/lang/no/error.php index a021c9c5e3c..26b992762c1 100644 --- a/install/lang/no/error.php +++ b/install/lang/no/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/no/install.php b/install/lang/no/install.php index 650c985b2d4..795f77d991d 100644 --- a/install/lang/no/install.php +++ b/install/lang/no/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/no/langconfig.php b/install/lang/no/langconfig.php index c84842c2d2f..4312d1966ef 100644 --- a/install/lang/no/langconfig.php +++ b/install/lang/no/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/no/moodle.php b/install/lang/no/moodle.php index de0b76b8233..880f4162091 100644 --- a/install/lang/no/moodle.php +++ b/install/lang/no/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/no_gr/langconfig.php b/install/lang/no_gr/langconfig.php index 76a8d7ce88a..8022f072ad5 100644 --- a/install/lang/no_gr/langconfig.php +++ b/install/lang/no_gr/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/no_gr/moodle.php b/install/lang/no_gr/moodle.php index c2d36f78429..520f6f87f90 100644 --- a/install/lang/no_gr/moodle.php +++ b/install/lang/no_gr/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/oc_es/langconfig.php b/install/lang/oc_es/langconfig.php index 88cf31be0af..14b6b149af7 100644 --- a/install/lang/oc_es/langconfig.php +++ b/install/lang/oc_es/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/pl/admin.php b/install/lang/pl/admin.php index f2b094ba870..61786be4006 100644 --- a/install/lang/pl/admin.php +++ b/install/lang/pl/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/pl/error.php b/install/lang/pl/error.php index de40896d73b..0140964b0d6 100644 --- a/install/lang/pl/error.php +++ b/install/lang/pl/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/pl/install.php b/install/lang/pl/install.php index 92f3b0a2b97..28adfbc8e43 100644 --- a/install/lang/pl/install.php +++ b/install/lang/pl/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/pl/langconfig.php b/install/lang/pl/langconfig.php index 5e459b9a2ac..ff512400183 100644 --- a/install/lang/pl/langconfig.php +++ b/install/lang/pl/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/pl/moodle.php b/install/lang/pl/moodle.php index 46052e60c33..d2044e57e83 100644 --- a/install/lang/pl/moodle.php +++ b/install/lang/pl/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/pt/admin.php b/install/lang/pt/admin.php index c05e227eefe..cd1814f5501 100644 --- a/install/lang/pt/admin.php +++ b/install/lang/pt/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/pt/error.php b/install/lang/pt/error.php index 16f6da4d36a..1107cdc2f6e 100644 --- a/install/lang/pt/error.php +++ b/install/lang/pt/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/pt/install.php b/install/lang/pt/install.php index 28b379e21ec..0645b9e744c 100644 --- a/install/lang/pt/install.php +++ b/install/lang/pt/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/pt/langconfig.php b/install/lang/pt/langconfig.php index 3d56fad87da..58ad62baf13 100644 --- a/install/lang/pt/langconfig.php +++ b/install/lang/pt/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/pt/moodle.php b/install/lang/pt/moodle.php index d1cd360e2dc..9473ac83da4 100644 --- a/install/lang/pt/moodle.php +++ b/install/lang/pt/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/pt_br/admin.php b/install/lang/pt_br/admin.php index be6e4898240..81d6d5681a2 100644 --- a/install/lang/pt_br/admin.php +++ b/install/lang/pt_br/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/pt_br/error.php b/install/lang/pt_br/error.php index 3aaddcd658d..0eb6298836a 100644 --- a/install/lang/pt_br/error.php +++ b/install/lang/pt_br/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/pt_br/install.php b/install/lang/pt_br/install.php index fa8b9b95b99..75418a91e80 100644 --- a/install/lang/pt_br/install.php +++ b/install/lang/pt_br/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/pt_br/langconfig.php b/install/lang/pt_br/langconfig.php index 76d3da6ca2d..9ad1aa42c68 100644 --- a/install/lang/pt_br/langconfig.php +++ b/install/lang/pt_br/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was @@ -30,5 +30,6 @@ defined('MOODLE_INTERNAL') || die(); +$string['parentlanguage'] = ''; $string['thisdirection'] = 'ltr'; $string['thislanguage'] = 'Português - Brasil'; diff --git a/install/lang/pt_br/moodle.php b/install/lang/pt_br/moodle.php index 31546fd3e7b..fcffdffe300 100644 --- a/install/lang/pt_br/moodle.php +++ b/install/lang/pt_br/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/rm_surs/admin.php b/install/lang/rm_surs/admin.php index 46047dd1482..174e6d6d5ca 100644 --- a/install/lang/rm_surs/admin.php +++ b/install/lang/rm_surs/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/rm_surs/langconfig.php b/install/lang/rm_surs/langconfig.php index d913a00f5d8..77f6f0b9ae4 100644 --- a/install/lang/rm_surs/langconfig.php +++ b/install/lang/rm_surs/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/rm_surs/moodle.php b/install/lang/rm_surs/moodle.php index 698cf50c69b..93c7c5747ea 100644 --- a/install/lang/rm_surs/moodle.php +++ b/install/lang/rm_surs/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ro/admin.php b/install/lang/ro/admin.php index 58cf468901d..8d1758c3a2b 100644 --- a/install/lang/ro/admin.php +++ b/install/lang/ro/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ro/error.php b/install/lang/ro/error.php index b5480c05071..b6a702f823b 100644 --- a/install/lang/ro/error.php +++ b/install/lang/ro/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ro/install.php b/install/lang/ro/install.php index 9b9959573b3..1971fb300d1 100644 --- a/install/lang/ro/install.php +++ b/install/lang/ro/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ro/langconfig.php b/install/lang/ro/langconfig.php index faa53393f5e..9f98ed7fa3a 100644 --- a/install/lang/ro/langconfig.php +++ b/install/lang/ro/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ro/moodle.php b/install/lang/ro/moodle.php index f4d13adf55a..be0a958563e 100644 --- a/install/lang/ro/moodle.php +++ b/install/lang/ro/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ru/admin.php b/install/lang/ru/admin.php index ad3d6090bc8..f4499ae7fac 100644 --- a/install/lang/ru/admin.php +++ b/install/lang/ru/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ru/error.php b/install/lang/ru/error.php index f7f5849dbf7..85992c14df2 100644 --- a/install/lang/ru/error.php +++ b/install/lang/ru/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ru/install.php b/install/lang/ru/install.php index a1cab1b9f2e..d675c4f821b 100644 --- a/install/lang/ru/install.php +++ b/install/lang/ru/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ru/langconfig.php b/install/lang/ru/langconfig.php index 19a9c10a6ac..28b8853081e 100644 --- a/install/lang/ru/langconfig.php +++ b/install/lang/ru/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ru/moodle.php b/install/lang/ru/moodle.php index 6e1b9d13985..599a475ae32 100644 --- a/install/lang/ru/moodle.php +++ b/install/lang/ru/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/si/admin.php b/install/lang/si/admin.php index 28681964815..ebd678e5be0 100644 --- a/install/lang/si/admin.php +++ b/install/lang/si/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/si/error.php b/install/lang/si/error.php index 04140c1d1a0..1bb90cc7e58 100644 --- a/install/lang/si/error.php +++ b/install/lang/si/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/si/install.php b/install/lang/si/install.php index ab7767f23c3..46b8bc01545 100644 --- a/install/lang/si/install.php +++ b/install/lang/si/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/si/langconfig.php b/install/lang/si/langconfig.php index 37abe0656ff..3286bc347dd 100644 --- a/install/lang/si/langconfig.php +++ b/install/lang/si/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/si/moodle.php b/install/lang/si/moodle.php index e0f206b27f8..e16375957da 100644 --- a/install/lang/si/moodle.php +++ b/install/lang/si/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sk/admin.php b/install/lang/sk/admin.php index 881eabba17e..f209758baee 100644 --- a/install/lang/sk/admin.php +++ b/install/lang/sk/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sk/error.php b/install/lang/sk/error.php index 5bd03dcfacc..d6f819e55bc 100644 --- a/install/lang/sk/error.php +++ b/install/lang/sk/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sk/install.php b/install/lang/sk/install.php index 2875473bb7d..1bb1c969414 100644 --- a/install/lang/sk/install.php +++ b/install/lang/sk/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sk/langconfig.php b/install/lang/sk/langconfig.php index 4bbd9d209b6..7c66eb63555 100644 --- a/install/lang/sk/langconfig.php +++ b/install/lang/sk/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sk/moodle.php b/install/lang/sk/moodle.php index e931ea95323..419620b1c35 100644 --- a/install/lang/sk/moodle.php +++ b/install/lang/sk/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sl/admin.php b/install/lang/sl/admin.php index 8138129c8f8..47d9907ee43 100644 --- a/install/lang/sl/admin.php +++ b/install/lang/sl/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sl/error.php b/install/lang/sl/error.php index 8ff9b996f9b..9c82a4c8ccb 100644 --- a/install/lang/sl/error.php +++ b/install/lang/sl/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sl/install.php b/install/lang/sl/install.php index 5aac8db9311..73acc58389d 100644 --- a/install/lang/sl/install.php +++ b/install/lang/sl/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sl/langconfig.php b/install/lang/sl/langconfig.php index b56401c1478..7a7b99f061c 100644 --- a/install/lang/sl/langconfig.php +++ b/install/lang/sl/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sl/moodle.php b/install/lang/sl/moodle.php index a69df7df337..a0edc7b3f33 100644 --- a/install/lang/sl/moodle.php +++ b/install/lang/sl/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sm/install.php b/install/lang/sm/install.php index 8eb9d888140..7d686d1e192 100644 --- a/install/lang/sm/install.php +++ b/install/lang/sm/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sm/langconfig.php b/install/lang/sm/langconfig.php index 0592d526a1c..87838461e35 100644 --- a/install/lang/sm/langconfig.php +++ b/install/lang/sm/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sm/moodle.php b/install/lang/sm/moodle.php index 2f238c4aa7f..a6f38983023 100644 --- a/install/lang/sm/moodle.php +++ b/install/lang/sm/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/so/admin.php b/install/lang/so/admin.php index e9af0418ba3..046abc0f4d4 100644 --- a/install/lang/so/admin.php +++ b/install/lang/so/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/so/install.php b/install/lang/so/install.php index 80a739ede15..448fc3fd019 100644 --- a/install/lang/so/install.php +++ b/install/lang/so/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/so/langconfig.php b/install/lang/so/langconfig.php index dd03a15490f..33927b7aa25 100644 --- a/install/lang/so/langconfig.php +++ b/install/lang/so/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/so/moodle.php b/install/lang/so/moodle.php index 73748ee11b7..4e8ed32c744 100644 --- a/install/lang/so/moodle.php +++ b/install/lang/so/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sq/langconfig.php b/install/lang/sq/langconfig.php index bde27b295cd..9617d1f999d 100644 --- a/install/lang/sq/langconfig.php +++ b/install/lang/sq/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sq/moodle.php b/install/lang/sq/moodle.php index 323341fb945..2b38586d738 100644 --- a/install/lang/sq/moodle.php +++ b/install/lang/sq/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sr/langconfig.php b/install/lang/sr/langconfig.php index 30e226f6f26..9e1d4de06ca 100644 --- a/install/lang/sr/langconfig.php +++ b/install/lang/sr/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sr_cr/admin.php b/install/lang/sr_cr/admin.php index d63f6eb1afb..d1434ff3699 100644 --- a/install/lang/sr_cr/admin.php +++ b/install/lang/sr_cr/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sr_cr/error.php b/install/lang/sr_cr/error.php index 10179fc0950..92050fc8870 100644 --- a/install/lang/sr_cr/error.php +++ b/install/lang/sr_cr/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sr_cr/install.php b/install/lang/sr_cr/install.php index b4b78e7234b..bd8a77defb3 100644 --- a/install/lang/sr_cr/install.php +++ b/install/lang/sr_cr/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sr_cr/langconfig.php b/install/lang/sr_cr/langconfig.php index 30e226f6f26..9e1d4de06ca 100644 --- a/install/lang/sr_cr/langconfig.php +++ b/install/lang/sr_cr/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sr_cr/moodle.php b/install/lang/sr_cr/moodle.php index 480124825c8..3c267dd61b4 100644 --- a/install/lang/sr_cr/moodle.php +++ b/install/lang/sr_cr/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sr_cr_bo/langconfig.php b/install/lang/sr_cr_bo/langconfig.php index 30e226f6f26..9e1d4de06ca 100644 --- a/install/lang/sr_cr_bo/langconfig.php +++ b/install/lang/sr_cr_bo/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sr_lt/admin.php b/install/lang/sr_lt/admin.php index 5b5c6337864..b0596cacdb6 100644 --- a/install/lang/sr_lt/admin.php +++ b/install/lang/sr_lt/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sr_lt/error.php b/install/lang/sr_lt/error.php index 0577743056c..262f21c35a0 100644 --- a/install/lang/sr_lt/error.php +++ b/install/lang/sr_lt/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sr_lt/install.php b/install/lang/sr_lt/install.php index 0cfa2e3a55d..8bf648d3529 100644 --- a/install/lang/sr_lt/install.php +++ b/install/lang/sr_lt/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sr_lt/langconfig.php b/install/lang/sr_lt/langconfig.php index b87e54f8ad4..c11ac67ebf2 100644 --- a/install/lang/sr_lt/langconfig.php +++ b/install/lang/sr_lt/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sr_lt/moodle.php b/install/lang/sr_lt/moodle.php index 8151bfb7898..b6a4b62b1ad 100644 --- a/install/lang/sr_lt/moodle.php +++ b/install/lang/sr_lt/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sv/admin.php b/install/lang/sv/admin.php index 1d59617dee2..31ba29520e7 100644 --- a/install/lang/sv/admin.php +++ b/install/lang/sv/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sv/error.php b/install/lang/sv/error.php index f87bedcd9be..6757bc24f8a 100644 --- a/install/lang/sv/error.php +++ b/install/lang/sv/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sv/install.php b/install/lang/sv/install.php index a5a26b37943..40f73b27d32 100644 --- a/install/lang/sv/install.php +++ b/install/lang/sv/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sv/langconfig.php b/install/lang/sv/langconfig.php index 6fbbae96255..a40c5607037 100644 --- a/install/lang/sv/langconfig.php +++ b/install/lang/sv/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sv/moodle.php b/install/lang/sv/moodle.php index c289684f510..6a92867c7b5 100644 --- a/install/lang/sv/moodle.php +++ b/install/lang/sv/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sv_fi/install.php b/install/lang/sv_fi/install.php index 2b93e109437..acdf2ecbc13 100644 --- a/install/lang/sv_fi/install.php +++ b/install/lang/sv_fi/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sv_fi/langconfig.php b/install/lang/sv_fi/langconfig.php index 0548e4f004e..1f4ea5702d1 100644 --- a/install/lang/sv_fi/langconfig.php +++ b/install/lang/sv_fi/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/sw/admin.php b/install/lang/sw/admin.php index f54a6f7e93f..b319b4ff02b 100644 --- a/install/lang/sw/admin.php +++ b/install/lang/sw/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ta/admin.php b/install/lang/ta/admin.php index a38334e5cc6..09793cf57c4 100644 --- a/install/lang/ta/admin.php +++ b/install/lang/ta/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ta/error.php b/install/lang/ta/error.php index e1feb8869f8..de3f9f3fc97 100644 --- a/install/lang/ta/error.php +++ b/install/lang/ta/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ta/install.php b/install/lang/ta/install.php index 05782f1d0b5..fd85740eb67 100644 --- a/install/lang/ta/install.php +++ b/install/lang/ta/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ta/langconfig.php b/install/lang/ta/langconfig.php index b737c566504..0d482e1d0bc 100644 --- a/install/lang/ta/langconfig.php +++ b/install/lang/ta/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ta/moodle.php b/install/lang/ta/moodle.php index de3e4a4a89e..df4f96ffac2 100644 --- a/install/lang/ta/moodle.php +++ b/install/lang/ta/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ta_lk/admin.php b/install/lang/ta_lk/admin.php index 333fce76bfe..78941370c71 100644 --- a/install/lang/ta_lk/admin.php +++ b/install/lang/ta_lk/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ta_lk/error.php b/install/lang/ta_lk/error.php index d8a0f52848c..e8f2c715f10 100644 --- a/install/lang/ta_lk/error.php +++ b/install/lang/ta_lk/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ta_lk/install.php b/install/lang/ta_lk/install.php index 13ebd278847..57ead444be6 100644 --- a/install/lang/ta_lk/install.php +++ b/install/lang/ta_lk/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ta_lk/langconfig.php b/install/lang/ta_lk/langconfig.php index 6dbeb793207..d10a7043317 100644 --- a/install/lang/ta_lk/langconfig.php +++ b/install/lang/ta_lk/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ta_lk/moodle.php b/install/lang/ta_lk/moodle.php index 8fc23f94651..de7a1f08e60 100644 --- a/install/lang/ta_lk/moodle.php +++ b/install/lang/ta_lk/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/te/admin.php b/install/lang/te/admin.php index 38497c99c05..d5b650b0489 100644 --- a/install/lang/te/admin.php +++ b/install/lang/te/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/te/langconfig.php b/install/lang/te/langconfig.php index 602a9e4c7f0..9e67caa9c70 100644 --- a/install/lang/te/langconfig.php +++ b/install/lang/te/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/te/moodle.php b/install/lang/te/moodle.php index fc372ba409c..103843d4903 100644 --- a/install/lang/te/moodle.php +++ b/install/lang/te/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/th/admin.php b/install/lang/th/admin.php index d1799c8ed9f..a4dcd19627b 100644 --- a/install/lang/th/admin.php +++ b/install/lang/th/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/th/install.php b/install/lang/th/install.php index 92d663811b6..f8b51e5df1a 100644 --- a/install/lang/th/install.php +++ b/install/lang/th/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/th/langconfig.php b/install/lang/th/langconfig.php index d85dd0e853b..5515207801a 100644 --- a/install/lang/th/langconfig.php +++ b/install/lang/th/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/th/moodle.php b/install/lang/th/moodle.php index 8a1004ab51a..ea86f2c6d47 100644 --- a/install/lang/th/moodle.php +++ b/install/lang/th/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ti/langconfig.php b/install/lang/ti/langconfig.php index 252174a6e43..53c8de1de4a 100644 --- a/install/lang/ti/langconfig.php +++ b/install/lang/ti/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ti/moodle.php b/install/lang/ti/moodle.php index 166bef902a8..6b6a9496eb4 100644 --- a/install/lang/ti/moodle.php +++ b/install/lang/ti/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/tl/admin.php b/install/lang/tl/admin.php index de61ce18f93..f46e1720aaa 100644 --- a/install/lang/tl/admin.php +++ b/install/lang/tl/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/tl/error.php b/install/lang/tl/error.php index c9959093e74..f921fad7c28 100644 --- a/install/lang/tl/error.php +++ b/install/lang/tl/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/tl/install.php b/install/lang/tl/install.php index f5e241519f9..88249580ecb 100644 --- a/install/lang/tl/install.php +++ b/install/lang/tl/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/tl/langconfig.php b/install/lang/tl/langconfig.php index 7798dd177df..cf377d9cbad 100644 --- a/install/lang/tl/langconfig.php +++ b/install/lang/tl/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/tl/moodle.php b/install/lang/tl/moodle.php index c6470dc8c23..d4054b6aa1f 100644 --- a/install/lang/tl/moodle.php +++ b/install/lang/tl/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/to/install.php b/install/lang/to/install.php index 254fcdb9c3c..27cd3f6390a 100644 --- a/install/lang/to/install.php +++ b/install/lang/to/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/to/langconfig.php b/install/lang/to/langconfig.php index a1cf9715778..cd24d410211 100644 --- a/install/lang/to/langconfig.php +++ b/install/lang/to/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/to/moodle.php b/install/lang/to/moodle.php index 597d7952922..9ad2ce6c3ca 100644 --- a/install/lang/to/moodle.php +++ b/install/lang/to/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/tr/admin.php b/install/lang/tr/admin.php index 93caba60222..f4ea9f8461c 100644 --- a/install/lang/tr/admin.php +++ b/install/lang/tr/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/tr/error.php b/install/lang/tr/error.php index 83117198e3b..28a5c3cbfe9 100644 --- a/install/lang/tr/error.php +++ b/install/lang/tr/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/tr/install.php b/install/lang/tr/install.php index 70d65a3744a..9a210f5e987 100644 --- a/install/lang/tr/install.php +++ b/install/lang/tr/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/tr/langconfig.php b/install/lang/tr/langconfig.php index bb838ca7b78..1a70bfe9320 100644 --- a/install/lang/tr/langconfig.php +++ b/install/lang/tr/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/tr/moodle.php b/install/lang/tr/moodle.php index c94fc9373f7..068fe7571cf 100644 --- a/install/lang/tr/moodle.php +++ b/install/lang/tr/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/tt/langconfig.php b/install/lang/tt/langconfig.php index 813287a6499..be7b69801da 100644 --- a/install/lang/tt/langconfig.php +++ b/install/lang/tt/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/uk/langconfig.php b/install/lang/uk/langconfig.php index 30b9d8c4433..6722a02fbf7 100644 --- a/install/lang/uk/langconfig.php +++ b/install/lang/uk/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/uk/moodle.php b/install/lang/uk/moodle.php index 8b6a38df157..1ca623c5937 100644 --- a/install/lang/uk/moodle.php +++ b/install/lang/uk/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ur/install.php b/install/lang/ur/install.php index 670e16a6d16..d2b27e21007 100644 --- a/install/lang/ur/install.php +++ b/install/lang/ur/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ur/langconfig.php b/install/lang/ur/langconfig.php index f82e3a9059f..19bb1f846ac 100644 --- a/install/lang/ur/langconfig.php +++ b/install/lang/ur/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/ur/moodle.php b/install/lang/ur/moodle.php index 2170fcc74d0..aa6d9c65fde 100644 --- a/install/lang/ur/moodle.php +++ b/install/lang/ur/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/uz/install.php b/install/lang/uz/install.php index e40642f43d4..050900d2999 100644 --- a/install/lang/uz/install.php +++ b/install/lang/uz/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/uz/langconfig.php b/install/lang/uz/langconfig.php index 67359289b93..d9e86dbf823 100644 --- a/install/lang/uz/langconfig.php +++ b/install/lang/uz/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/uz/moodle.php b/install/lang/uz/moodle.php index 758704aa01b..0fbc495868a 100644 --- a/install/lang/uz/moodle.php +++ b/install/lang/uz/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/vi/admin.php b/install/lang/vi/admin.php index 54ba3abe3b5..c9f3c517639 100644 --- a/install/lang/vi/admin.php +++ b/install/lang/vi/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/vi/install.php b/install/lang/vi/install.php index ed369bb22f1..c7dc980ba23 100644 --- a/install/lang/vi/install.php +++ b/install/lang/vi/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/vi/langconfig.php b/install/lang/vi/langconfig.php index 65a9ecb70d4..7455976822c 100644 --- a/install/lang/vi/langconfig.php +++ b/install/lang/vi/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/vi/moodle.php b/install/lang/vi/moodle.php index 62c35464b1e..7cd75d902e3 100644 --- a/install/lang/vi/moodle.php +++ b/install/lang/vi/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/wo/langconfig.php b/install/lang/wo/langconfig.php index cf5af52f0ae..fcc9991eb2f 100644 --- a/install/lang/wo/langconfig.php +++ b/install/lang/wo/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/zh_cn/admin.php b/install/lang/zh_cn/admin.php index 19f04d83405..a9de0f84d1c 100644 --- a/install/lang/zh_cn/admin.php +++ b/install/lang/zh_cn/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/zh_cn/error.php b/install/lang/zh_cn/error.php index b233b303dab..2e53dac19fd 100644 --- a/install/lang/zh_cn/error.php +++ b/install/lang/zh_cn/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/zh_cn/install.php b/install/lang/zh_cn/install.php index 38b59b351d2..c338c8b45b0 100644 --- a/install/lang/zh_cn/install.php +++ b/install/lang/zh_cn/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/zh_cn/langconfig.php b/install/lang/zh_cn/langconfig.php index 8772823d6f3..23878bb831f 100644 --- a/install/lang/zh_cn/langconfig.php +++ b/install/lang/zh_cn/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/zh_cn/moodle.php b/install/lang/zh_cn/moodle.php index bc48d070964..259fc482b3f 100644 --- a/install/lang/zh_cn/moodle.php +++ b/install/lang/zh_cn/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/zh_tw/admin.php b/install/lang/zh_tw/admin.php index f54f682cf55..ef4151257ae 100644 --- a/install/lang/zh_tw/admin.php +++ b/install/lang/zh_tw/admin.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/zh_tw/error.php b/install/lang/zh_tw/error.php index 2371760a937..e678417ac98 100644 --- a/install/lang/zh_tw/error.php +++ b/install/lang/zh_tw/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/zh_tw/install.php b/install/lang/zh_tw/install.php index 20ecf9733ba..07cb23ec64e 100644 --- a/install/lang/zh_tw/install.php +++ b/install/lang/zh_tw/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/zh_tw/langconfig.php b/install/lang/zh_tw/langconfig.php index 67f88e09277..4771cc50228 100644 --- a/install/lang/zh_tw/langconfig.php +++ b/install/lang/zh_tw/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/zh_tw/moodle.php b/install/lang/zh_tw/moodle.php index 7e04cc821d6..e8bc0f59d30 100644 --- a/install/lang/zh_tw/moodle.php +++ b/install/lang/zh_tw/moodle.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/zu/error.php b/install/lang/zu/error.php index 81f611aca5f..75a2204d6f6 100644 --- a/install/lang/zu/error.php +++ b/install/lang/zu/error.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/zu/install.php b/install/lang/zu/install.php index b62de397201..46011117472 100644 --- a/install/lang/zu/install.php +++ b/install/lang/zu/install.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/install/lang/zu/langconfig.php b/install/lang/zu/langconfig.php index 9b0850a3a77..745c956dd8b 100644 --- a/install/lang/zu/langconfig.php +++ b/install/lang/zu/langconfig.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see . /** - * Automatically generated strings for Moodle 2.3dev installer + * Automatically generated strings for Moodle installer * * Do not edit this file manually! It contains just a subset of strings * needed during the very first steps of installation. This file was diff --git a/lang/en/backup.php b/lang/en/backup.php index fa809254ddb..5fde19e8722 100644 --- a/lang/en/backup.php +++ b/lang/en/backup.php @@ -117,6 +117,12 @@ $string['errorinvalidformat'] = 'Unknown backup format'; $string['errorinvalidformatinfo'] = 'The selected file is not a valid Moodle backup file and can\'t be restored.'; $string['executionsuccess'] = 'The backup file was successfully created.'; $string['filename'] = 'Filename'; +$string['filealiasesrestorefailures'] = 'Aliases restore failures'; +$string['filealiasesrestorefailuresinfo'] = 'Some aliases included in the backup file could not be restored. The following list contains their expected location and the source file they were referring to at the original site.'; +$string['filealiasesrestorefailures_help'] = 'Aliases are symbolic links to other files, including those stored in external repositories. In some cases, Moodle cannot restore them - for example when restoring the backup at another site or when the referenced file does not exist. + +More details and the actual reason of the failure can be found in the restore log file.'; +$string['filealiasesrestorefailures_link'] = 'restore/filealiases'; $string['filereferencesincluded'] = 'File references to external contents included in backup package, they won\'t work on other sites.'; $string['filereferencessamesite'] = 'Backup is from the same site, file references can be restored'; $string['filereferencesnotsamesite'] = 'Backup is from other site, file references cannot be restored'; diff --git a/lang/en/completion.php b/lang/en/completion.php index f1de5c03037..0683c79b85b 100644 --- a/lang/en/completion.php +++ b/lang/en/completion.php @@ -78,6 +78,7 @@ $string['err_system'] = 'An internal error occurred in the completion system. (S $string['excelcsvdownload'] = 'Download in Excel-compatible format (.csv)'; $string['progress'] = 'Student progress'; $string['progress-title'] = '{$a->user}, {$a->activity}: {$a->state} {$a->date}'; +$string['progresstotal'] = 'Progress: {$a->complete} / {$a->total}'; $string['reportpage'] = 'Showing users {$a->from} to {$a->to} of {$a->total}.'; $string['restoringcompletiondata'] = 'Writing completion data'; $string['saved'] = 'Saved'; diff --git a/lang/en/moodle.php b/lang/en/moodle.php index ba5553ce062..4b2b34dba71 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -114,9 +114,7 @@ $string['advancedfilter'] = 'Advanced search'; $string['advancedsettings'] = 'Advanced settings'; $string['again'] = 'again'; $string['aimid'] = 'AIM ID'; -$string['ajaxno'] = 'No: use basic web features'; $string['ajaxuse'] = 'AJAX and Javascript'; -$string['ajaxyes'] = 'Yes: use advanced web features'; $string['all'] = 'All'; $string['allactions'] = 'All actions'; $string['allactivities'] = 'All activities'; @@ -684,6 +682,7 @@ $string['failedloginattempts'] = '{$a->attempts} failed logins since your last l $string['failedloginattemptsall'] = '{$a->attempts} failed logins for {$a->accounts} accounts'; $string['feedback'] = 'Feedback'; $string['file'] = 'File'; +$string['fileexists'] = 'There is already a file called {$a}'; $string['filemissing'] = '{$a} is missing'; $string['filetoolarge'] = 'is too large to upload'; $string['files'] = 'Files'; @@ -1714,7 +1713,7 @@ $string['uploadedfiletoobig'] = 'Sorry, but that file is too big (limit is {$a} $string['uploadextension'] = 'File upload stopped by extension'; $string['uploadfailednotrecovering'] = 'Your file upload has failed because there was a problem with one of the files, {$a->name}.
      Here is a log of the problems:
      {$a->problem}
      Not recovering.'; $string['uploadfilelog'] = 'Upload log for file {$a}'; -$string['uploadformlimit'] = 'Uploaded file exceeded the maximum size limit set by the form'; +$string['uploadformlimit'] = 'Uploaded file {$a} exceeded the maximum size limit set by the form'; $string['uploadlabel'] = 'Title:'; $string['uploadnewfile'] = 'Upload new file'; $string['uploadnofilefound'] = 'No file was found - are you sure you selected one to upload?'; diff --git a/lang/en/repository.php b/lang/en/repository.php index d8d90f02fdd..12454261e1f 100644 --- a/lang/en/repository.php +++ b/lang/en/repository.php @@ -163,6 +163,7 @@ $string['openpicker'] = 'Choose a file...'; $string['operation'] = 'Operation'; $string['on'] = 'Enabled and visible'; $string['overwrite'] = 'Overwrite'; +$string['overwriteall'] = 'Overwrite all'; $string['personalrepositories'] = 'Available repository instances'; $string['plugin'] = 'Repository plug-ins'; $string['pluginerror'] = 'Errors in repository plugin.'; @@ -176,6 +177,7 @@ $string['referenceslist'] = 'Aliases/Shortcuts'; $string['refresh'] = 'Refresh'; $string['refreshnonjsfilepicker'] = 'Please close this window and refresh non-javascript file picker'; $string['removed'] = 'Repository removed'; +$string['renameall'] = 'Rename all'; $string['renameto'] = 'Rename to "{$a}"'; $string['repositories'] = 'Repositories'; $string['repository'] = 'Repository'; diff --git a/lib/ajax/ajaxlib.php b/lib/ajax/ajaxlib.php index 098c4966f9f..72eba29539a 100644 --- a/lib/ajax/ajaxlib.php +++ b/lib/ajax/ajaxlib.php @@ -49,7 +49,7 @@ function user_preference_allow_ajax_update($name, $paramtype) { * @return bool */ function ajaxenabled(array $browsers = null) { - global $CFG, $USER; + global $CFG; if (!empty($browsers)) { $valid = false; @@ -77,9 +77,9 @@ function ajaxenabled(array $browsers = null) { return false; } - if (!empty($CFG->enableajax) && (!empty($USER->ajax) || !isloggedin())) { + if (!empty($CFG->enableajax)) { return true; } else { return false; } -} \ No newline at end of file +} diff --git a/lib/ajax/tests/ajaxlib_test.php b/lib/ajax/tests/ajaxlib_test.php index 844fc5df1bc..7bdb28d4737 100644 --- a/lib/ajax/tests/ajaxlib_test.php +++ b/lib/ajax/tests/ajaxlib_test.php @@ -65,12 +65,11 @@ class ajax_testcase extends advanced_testcase { * Uses the array of user agents to test ajax_lib::ajaxenabled */ function test_ajaxenabled() { - global $CFG, $USER; + global $CFG; $this->resetAfterTest(true); $CFG->enableajax = 1; - $USER->ajax = 1; // Should be true $_SERVER['HTTP_USER_AGENT'] = $this->user_agents['Firefox']['2.0']['Windows XP']; diff --git a/lib/boxlib.php b/lib/boxlib.php index e1e8387516a..0cee0da8ac7 100644 --- a/lib/boxlib.php +++ b/lib/boxlib.php @@ -36,8 +36,10 @@ class boxclient { /** @var string */ public $auth_token = ''; /** @var string */ - private $_box_api_url = 'http://box.net/api/1.0/rest'; - private $_box_api_upload_url = 'http://upload.box.net/api/1.0/upload'; + private $_box_api_url = 'https://www.box.com/api/1.0/rest'; + private $_box_api_upload_url = 'http://upload.box.com/api/1.0/upload'; + private $_box_api_download_url = 'http://www.box.com/api/1.0/download'; + private $_box_api_auth_url = 'http://www.box.com/api/1.0/auth'; private $_error_code = ''; private $_error_msg = ''; /** @var bool */ @@ -67,6 +69,7 @@ class boxclient { function makeRequest($method, $params = array()) { $this->_clearErrors(); $c = new curl(array('debug'=>$this->debug, 'cache'=>true, 'module_cache'=>'repository')); + $c->setopt(array('CURLOPT_FOLLOWLOCATION'=>1)); try { if ($method == 'upload'){ $request = $this->_box_api_upload_url.'/'. @@ -141,7 +144,7 @@ class boxclient { '__login'=>1 ); try { - $ret = $c->post('http://www.box.net/api/1.0/auth/'.$ticket, $param); + $ret = $c->post($this->_box_api_auth_url.'/'.$ticket, $param); } catch (moodle_exception $e) { $this->setError(0, 'connection time-out or invalid url'); return false; @@ -174,6 +177,7 @@ class boxclient { $params['onelevel'] = 1; $params['params[]'] = 'nozip'; $c = new curl(array('debug'=>$this->debug, 'cache'=>true, 'module_cache'=>'repository')); + $c->setopt(array('CURLOPT_FOLLOWLOCATION'=>1)); try { $args = array(); $xml = $c->get($this->_box_api_url, $params); @@ -224,7 +228,7 @@ class boxclient { foreach($o->folder as $z){ $tmp = array('title'=>(string)$z->attributes()->name, 'size'=>0, 'date'=>userdate(time()), - 'thumbnail'=>'http://www.box.net/img/small_folder_icon.gif', + 'thumbnail'=>'https://www.box.com/img/small_folder_icon.gif', 'path'=>array('name'=>(string)$z->attributes()->name, 'path'=>(int)$z->attributes()->id)); $tmp['children'] = array(); $this->buildtree($z, $tmp['children']); @@ -235,13 +239,13 @@ class boxclient { foreach($val as $file){ $thumbnail = (string)$file->attributes()->thumbnail; if (!preg_match('#^(?:http://)?([^/]+)#i', $thumbnail)) { - $thumbnail = 'http://www.box.net'.$thumbnail; + $thumbnail = 'http://www.box.com'.$thumbnail; } $tmp = array('title'=>(string)$file->attributes()->file_name, 'size'=>display_size((int)$file->attributes()->size), 'thumbnail'=>$thumbnail, 'date'=>userdate((int)$file->attributes()->updated), - 'source'=>'http://box.net/api/1.0/download/' + 'source'=> $this->_box_api_download_url .'/' .$this->auth_token.'/'.(string)$file->attributes()->id, 'url'=>(string)$file->attributes()->shared_link); $tree[] = $tmp; @@ -290,7 +294,7 @@ class boxclient { if (preg_match('#^(?:http://)?([^/]+)#i', $a['attributes']['THUMBNAIL'])) { @$ret_array['thumbnail'][$i] = $a['attributes']['THUMBNAIL']; } else { - @$ret_array['thumbnail'][$i] = 'http://www.box.net'.$a['attributes']['THUMBNAIL']; + @$ret_array['thumbnail'][$i] = 'http://www.box.com'.$a['attributes']['THUMBNAIL']; } $entry_count++; } diff --git a/lib/csslib.php b/lib/csslib.php index 3032433499c..2408e3849b2 100644 --- a/lib/csslib.php +++ b/lib/csslib.php @@ -3845,7 +3845,11 @@ class css_style_background extends css_style { } else if ($attachment === self::NULL_VALUE && in_array($bit, $attachments)) { $attachment = $bit; } else if ($bit !== '') { - $return[] = css_style_background_advanced::init($bit); + $advanced = css_style_background_advanced::init($bit); + if ($important) { + $advanced->set_important(); + } + $return[] = $advanced; } } } diff --git a/lib/db/install.xml b/lib/db/install.xml index 2cbd0e94b35..38ef87ec592 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -1,5 +1,5 @@ - @@ -754,9 +754,8 @@ - - - + + @@ -2753,7 +2752,9 @@ - + + + @@ -2874,4 +2875,4 @@ - + \ No newline at end of file diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index f0c8ba1bfef..3be8b80bf88 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -385,7 +385,9 @@ function xmldb_main_upgrade($oldversion) { AND older.id < cs.id'); foreach ($rs as $rec) { $DB->delete_records('course_sections', array('id' => $rec->id)); - rebuild_course_cache($rec->course, true); + // We can't use rebuild_course_cache() here because introducing sectioncache later + // so reset modinfo manually. + $DB->set_field('course', 'modinfo', null, array('id' => $rec->course)); } $rs->close(); $transaction->allow_commit(); @@ -830,5 +832,45 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2012060600.04); } + if ($oldversion < 2012061800.01) { + + // Define field screenreader to be dropped from user + $table = new xmldb_table('user'); + $field = new xmldb_field('ajax'); + + // Conditionally launch drop field screenreader + if ($dbman->field_exists($table, $field)) { + $dbman->drop_field($table, $field); + } + + // Main savepoint reached + upgrade_main_savepoint(true, 2012061800.01); + } + + if ($oldversion < 2012062000.00) { + // Add field newcontextid to backup_files_template + $table = new xmldb_table('backup_files_template'); + $field = new xmldb_field('newcontextid', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'info'); + + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + + upgrade_main_savepoint(true, 2012062000.00); + } + + if ($oldversion < 2012062000.01) { + // Add field newitemid to backup_files_template + $table = new xmldb_table('backup_files_template'); + $field = new xmldb_field('newitemid', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'newcontextid'); + + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + + upgrade_main_savepoint(true, 2012062000.01); + } + + return true; } diff --git a/lib/ddl/database_manager.php b/lib/ddl/database_manager.php index ee6f9bd9dc0..b8e0f823aeb 100644 --- a/lib/ddl/database_manager.php +++ b/lib/ddl/database_manager.php @@ -14,13 +14,10 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . - /** * Database manager instance is responsible for all database structure modifications. * - * @package core - * @category ddl - * @subpackage ddl + * @package core_ddl * @copyright 1999 onwards Martin Dougiamas http://dougiamas.com * 2001-3001 Eloy Lafuente (stronk7) http://contiento.com * 2008 Petr Skoda http://skodak.org @@ -34,9 +31,7 @@ defined('MOODLE_INTERNAL') || die(); * * It is using db specific generators to find out the correct SQL syntax to do that. * - * @package core - * @category ddl - * @subpackage ddl + * @package core_ddl * @copyright 1999 onwards Martin Dougiamas http://dougiamas.com * 2001-3001 Eloy Lafuente (stronk7) http://contiento.com * 2008 Petr Skoda http://skodak.org @@ -44,8 +39,9 @@ defined('MOODLE_INTERNAL') || die(); */ class database_manager { - /** @var moodle_database A moodle_database driver speific instance.*/ + /** @var moodle_database A moodle_database driver specific instance.*/ protected $mdb; + /** @var sql_generator A driver specific SQL generator instance. Public because XMLDB editor needs to access it.*/ public $generator; @@ -55,8 +51,6 @@ class database_manager { * @param sql_generator $generator A driver specific SQL generator instance. */ public function __construct($mdb, $generator) { - global $CFG; - $this->mdb = $mdb; $this->generator = $generator; } @@ -100,8 +94,8 @@ class database_manager { /** * Given one xmldb_table, check if it exists in DB (true/false). * - * @param mixed $table The table to be searched (string name or xmldb_table instance). - * @return bool true/false True is a table exists, false otherwise. + * @param string|xmldb_table $table The table to be searched (string name or xmldb_table instance). + * @return bool True is a table exists, false otherwise. */ public function table_exists($table) { if (!is_string($table) and !($table instanceof xmldb_table)) { @@ -132,20 +126,20 @@ class database_manager { /** * Given one xmldb_field, check if it exists in DB (true/false). * - * @param mixed $table The table to be searched (string name or xmldb_table instance). - * @param mixed $field The field to be searched for (string name or xmldb_field instance). + * @param string|xmldb_table $table The table to be searched (string name or xmldb_table instance). + * @param string|xmldb_field $field The field to be searched for (string name or xmldb_field instance). * @return boolean true is exists false otherwise. * @throws ddl_table_missing_exception */ public function field_exists($table, $field) { - /// Calculate the name of the table + // Calculate the name of the table if (is_string($table)) { $tablename = $table; } else { $tablename = $table->getName(); } - /// Check the table exists + // Check the table exists if (!$this->table_exists($table)) { throw new ddl_table_missing_exception($tablename); } @@ -153,11 +147,11 @@ class database_manager { if (is_string($field)) { $fieldname = $field; } else { - /// Calculate the name of the table + // Calculate the name of the table $fieldname = $field->getName(); } - /// Get list of fields in table + // Get list of fields in table $columns = $this->mdb->get_columns($tablename); $exists = array_key_exists($fieldname, $columns); @@ -175,32 +169,32 @@ class database_manager { * @throws ddl_table_missing_exception Thrown when table is not found. */ public function find_index_name(xmldb_table $xmldb_table, xmldb_index $xmldb_index) { - /// Calculate the name of the table + // Calculate the name of the table $tablename = $xmldb_table->getName(); - /// Check the table exists + // Check the table exists if (!$this->table_exists($xmldb_table)) { throw new ddl_table_missing_exception($tablename); } - /// Extract index columns + // Extract index columns $indcolumns = $xmldb_index->getFields(); - /// Get list of indexes in table + // Get list of indexes in table $indexes = $this->mdb->get_indexes($tablename); - /// Iterate over them looking for columns coincidence + // Iterate over them looking for columns coincidence foreach ($indexes as $indexname => $index) { $columns = $index['columns']; - /// Check if index matchs queried index + // Check if index matches queried index $diferences = array_merge(array_diff($columns, $indcolumns), array_diff($indcolumns, $columns)); - /// If no diferences, we have find the index + // If no differences, we have find the index if (empty($diferences)) { return $indexname; } } - /// Arriving here, index not found + // Arriving here, index not found return false; } @@ -233,23 +227,23 @@ class database_manager { $keycolumns = $xmldb_key->getFields(); - /// Get list of keys in table - /// first primaries (we aren't going to use this now, because the MetaPrimaryKeys is awful) - ///TODO: To implement when we advance in relational integrity - /// then uniques (note that Moodle, for now, shouldn't have any UNIQUE KEY for now, but unique indexes) - ///TODO: To implement when we advance in relational integrity (note that AdoDB hasn't any MetaXXX for this. - /// then foreign (note that Moodle, for now, shouldn't have any FOREIGN KEY for now, but indexes) - ///TODO: To implement when we advance in relational integrity (note that AdoDB has one MetaForeignKeys() - ///but it's far from perfect. - /// TODO: To create the proper functions inside each generator to retrieve all the needed KEY info (name - /// columns, reftable and refcolumns + // Get list of keys in table + // first primaries (we aren't going to use this now, because the MetaPrimaryKeys is awful) + //TODO: To implement when we advance in relational integrity + // then uniques (note that Moodle, for now, shouldn't have any UNIQUE KEY for now, but unique indexes) + //TODO: To implement when we advance in relational integrity (note that AdoDB hasn't any MetaXXX for this. + // then foreign (note that Moodle, for now, shouldn't have any FOREIGN KEY for now, but indexes) + //TODO: To implement when we advance in relational integrity (note that AdoDB has one MetaForeignKeys() + //but it's far from perfect. + // TODO: To create the proper functions inside each generator to retrieve all the needed KEY info (name + // columns, reftable and refcolumns - /// So all we do is to return the official name of the requested key without any confirmation!) - /// One exception, hardcoded primary constraint names + // So all we do is to return the official name of the requested key without any confirmation!) + // One exception, hardcoded primary constraint names if ($this->generator->primary_key_name && $xmldb_key->getType() == XMLDB_KEY_PRIMARY) { return $this->generator->primary_key_name; } else { - /// Calculate the name suffix + // Calculate the name suffix switch ($xmldb_key->getType()) { case XMLDB_KEY_PRIMARY: $suffix = 'pk'; @@ -262,7 +256,7 @@ class database_manager { $suffix = 'fk'; break; } - /// And simply, return the official name + // And simply, return the official name return $this->generator->getNameForObject($xmldb_table->getName(), implode(', ', $xmldb_key->getFields()), $suffix); } } @@ -285,7 +279,7 @@ class database_manager { $structure = $xmldb_file->getStructure(); if (!$loaded || !$xmldb_file->isLoaded()) { - /// Show info about the error if we can find it + // Show info about the error if we can find it if ($structure) { if ($errors = $structure->getAllErrors()) { throw new ddl_exception('ddlxmlfileerror', null, 'Errors found in XMLDB file: '. implode (', ', $errors)); @@ -312,7 +306,7 @@ class database_manager { * @return void */ public function drop_table(xmldb_table $xmldb_table) { - /// Check table exists + // Check table exists if (!$this->table_exists($xmldb_table)) { throw new ddl_table_missing_exception($xmldb_table->getName()); } @@ -338,8 +332,8 @@ class database_manager { $loaded = $xmldb_file->loadXMLStructure(); if (!$loaded || !$xmldb_file->isLoaded()) { - /// Show info about the error if we can find it - if ($structure =& $xmldb_file->getStructure()) { + // Show info about the error if we can find it + if ($structure = $xmldb_file->getStructure()) { if ($errors = $structure->getAllErrors()) { throw new ddl_exception('ddlxmlfileerror', null, 'Errors found in XMLDB file: '. implode (', ', $errors)); } @@ -418,7 +412,7 @@ class database_manager { * @return void */ public function create_table(xmldb_table $xmldb_table) { - /// Check table doesn't exist + // Check table doesn't exist if ($this->table_exists($xmldb_table)) { throw new ddl_exception('ddltablealreadyexists', $xmldb_table->getName()); } @@ -477,14 +471,14 @@ class database_manager { * @return void */ public function rename_table(xmldb_table $xmldb_table, $newname) { - /// Check newname isn't empty + // Check newname isn't empty if (!$newname) { throw new ddl_exception('ddlunknownerror', null, 'newname can not be empty'); } $check = new xmldb_table($newname); - /// Check table already renamed + // Check table already renamed if (!$this->table_exists($xmldb_table)) { if ($this->table_exists($check)) { throw new ddl_exception('ddlunknownerror', null, 'table probably already renamed'); @@ -493,7 +487,7 @@ class database_manager { } } - /// Check new table doesn't exist + // Check new table doesn't exist if ($this->table_exists($check)) { throw new ddl_exception('ddltablealreadyexists', $xmldb_table->getName(), 'can not rename table'); } @@ -505,7 +499,6 @@ class database_manager { $this->execute_sql_arr($sqlarr); } - /** * This function will add the field to the table passed as arguments * @@ -514,13 +507,13 @@ class database_manager { * @return void */ public function add_field(xmldb_table $xmldb_table, xmldb_field $xmldb_field) { - /// Check the field doesn't exist + // Check the field doesn't exist if ($this->field_exists($xmldb_table, $xmldb_field)) { throw new ddl_exception('ddlfieldalreadyexists', $xmldb_field->getName()); } - /// If NOT NULL and no default given (we ask the generator about the - /// *real* default that will be used) check the table is empty + // If NOT NULL and no default given (we ask the generator about the + // *real* default that will be used) check the table is empty if ($xmldb_field->getNotNull() && $this->generator->getDefaultValue($xmldb_field) === NULL && $this->mdb->count_records($xmldb_table->getName())) { throw new ddl_exception('ddlunknownerror', null, 'Field ' . $xmldb_table->getName() . '->' . $xmldb_field->getName() . ' cannot be added. Not null fields added to non empty tables require default value. Create skipped'); @@ -543,11 +536,11 @@ class database_manager { if (!$this->table_exists($xmldb_table)) { throw new ddl_table_missing_exception($xmldb_table->getName()); } - /// Check the field exists + // Check the field exists if (!$this->field_exists($xmldb_table, $xmldb_field)) { throw new ddl_field_missing_exception($xmldb_field->getName(), $xmldb_table->getName()); } - /// Check for dependencies in the DB before performing any action + // Check for dependencies in the DB before performing any action $this->check_field_dependencies($xmldb_table, $xmldb_field); if (!$sqlarr = $this->generator->getDropFieldSQL($xmldb_table, $xmldb_field)) { @@ -568,11 +561,11 @@ class database_manager { if (!$this->table_exists($xmldb_table)) { throw new ddl_table_missing_exception($xmldb_table->getName()); } - /// Check the field exists + // Check the field exists if (!$this->field_exists($xmldb_table, $xmldb_field)) { throw new ddl_field_missing_exception($xmldb_field->getName(), $xmldb_table->getName()); } - /// Check for dependencies in the DB before performing any action + // Check for dependencies in the DB before performing any action $this->check_field_dependencies($xmldb_table, $xmldb_field); if (!$sqlarr = $this->generator->getAlterFieldSQL($xmldb_table, $xmldb_field)) { @@ -590,7 +583,7 @@ class database_manager { * @return void */ public function change_field_precision(xmldb_table $xmldb_table, xmldb_field $xmldb_field) { - /// Just a wrapper over change_field_type. Does exactly the same processing + // Just a wrapper over change_field_type. Does exactly the same processing $this->change_field_type($xmldb_table, $xmldb_field); } @@ -615,7 +608,7 @@ class database_manager { * @return void */ public function change_field_notnull(xmldb_table $xmldb_table, xmldb_field $xmldb_field) { - /// Just a wrapper over change_field_type. Does exactly the same processing + // Just a wrapper over change_field_type. Does exactly the same processing $this->change_field_type($xmldb_table, $xmldb_field); } @@ -631,11 +624,11 @@ class database_manager { if (!$this->table_exists($xmldb_table)) { throw new ddl_table_missing_exception($xmldb_table->getName()); } - /// Check the field exists + // Check the field exists if (!$this->field_exists($xmldb_table, $xmldb_field)) { throw new ddl_field_missing_exception($xmldb_field->getName(), $xmldb_table->getName()); } - /// Check for dependencies in the DB before performing any action + // Check for dependencies in the DB before performing any action $this->check_field_dependencies($xmldb_table, $xmldb_field); if (!$sqlarr = $this->generator->getModifyDefaultSQL($xmldb_table, $xmldb_field)) { @@ -663,19 +656,19 @@ class database_manager { throw new ddl_table_missing_exception($xmldb_table->getName()); } - /// Check the field exists + // Check the field exists if (!$this->field_exists($xmldb_table, $xmldb_field)) { throw new ddl_field_missing_exception($xmldb_field->getName(), $xmldb_table->getName()); } - /// Check we have included full field specs + // Check we have included full field specs if (!$xmldb_field->getType()) { throw new ddl_exception('ddlunknownerror', null, 'Field ' . $xmldb_table->getName() . '->' . $xmldb_field->getName() . ' must contain full specs. Rename skipped'); } - /// Check field isn't id. Renaming over that field is not allowed + // Check field isn't id. Renaming over that field is not allowed if ($xmldb_field->getName() == 'id') { throw new ddl_exception('ddlunknownerror', null, 'Field ' . $xmldb_table->getName() . '->' . $xmldb_field->getName() . @@ -701,17 +694,17 @@ class database_manager { */ private function check_field_dependencies(xmldb_table $xmldb_table, xmldb_field $xmldb_field) { - /// Check the table exists + // Check the table exists if (!$this->table_exists($xmldb_table)) { throw new ddl_table_missing_exception($xmldb_table->getName()); } - /// Check the field exists + // Check the field exists if (!$this->field_exists($xmldb_table, $xmldb_field)) { throw new ddl_field_missing_exception($xmldb_field->getName(), $xmldb_table->getName()); } - /// Check the field isn't in use by any index in the table + // Check the field isn't in use by any index in the table if ($indexes = $this->mdb->get_indexes($xmldb_table->getName(), false)) { foreach ($indexes as $indexname => $index) { $columns = $index['columns']; @@ -774,7 +767,7 @@ class database_manager { public function rename_key(xmldb_table $xmldb_table, xmldb_key $xmldb_key, $newname) { debugging('rename_key() is one experimental feature. You must not use it in production!', DEBUG_DEVELOPER); - /// Check newname isn't empty + // Check newname isn't empty if (!$newname) { throw new ddl_exception('ddlunknownerror', null, 'newname can not be empty'); } @@ -799,7 +792,7 @@ class database_manager { throw new ddl_table_missing_exception($xmldb_table->getName()); } - /// Check index doesn't exist + // Check index doesn't exist if ($this->index_exists($xmldb_table, $xmldb_intex)) { throw new ddl_exception('ddlunknownerror', null, 'Index ' . $xmldb_table->getName() . '->' . $xmldb_intex->getName() . @@ -826,7 +819,7 @@ class database_manager { throw new ddl_table_missing_exception($xmldb_table->getName()); } - /// Check index exists + // Check index exists if (!$this->index_exists($xmldb_table, $xmldb_intex)) { throw new ddl_exception('ddlunknownerror', null, 'Index ' . $xmldb_table->getName() . '->' . $xmldb_intex->getName() . @@ -853,12 +846,12 @@ class database_manager { public function rename_index($xmldb_table, $xmldb_intex, $newname) { debugging('rename_index() is one experimental feature. You must not use it in production!', DEBUG_DEVELOPER); - /// Check newname isn't empty + // Check newname isn't empty if (!$newname) { throw new ddl_exception('ddlunknownerror', null, 'newname can not be empty'); } - /// Check index exists + // Check index exists if (!$this->index_exists($xmldb_table, $xmldb_intex)) { throw new ddl_exception('ddlunknownerror', null, 'Index ' . $xmldb_table->getName() . '->' . $xmldb_intex->getName() . diff --git a/lib/ddl/mssql_sql_generator.php b/lib/ddl/mssql_sql_generator.php index ed9942e17a9..bbf769ded3d 100644 --- a/lib/ddl/mssql_sql_generator.php +++ b/lib/ddl/mssql_sql_generator.php @@ -1,5 +1,4 @@ . - /** * MSSQL specific SQL code generator. * - * @package core - * @subpackage ddl_generator + * @package core_ddl * @copyright 1999 onwards Martin Dougiamas http://dougiamas.com * 2001-3001 Eloy Lafuente (stronk7) http://contiento.com * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later @@ -30,51 +27,70 @@ defined('MOODLE_INTERNAL') || die(); require_once($CFG->libdir.'/ddl/sql_generator.php'); -/// This class generate SQL code to be used against MSSQL -/// It extends XMLDBgenerator so everything can be -/// overridden as needed to generate correct SQL. - +/** + * This class generate SQL code to be used against MSSQL + * It extends XMLDBgenerator so everything can be + * overridden as needed to generate correct SQL. + * + * @package core_ddl + * @copyright 1999 onwards Martin Dougiamas http://dougiamas.com + * 2001-3001 Eloy Lafuente (stronk7) http://contiento.com + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class mssql_sql_generator extends sql_generator { -/// Only set values that are different from the defaults present in XMLDBgenerator + // Only set values that are different from the defaults present in XMLDBgenerator - public $statement_end = "\ngo"; // String to be automatically added at the end of each statement + /** @var string To be automatically added at the end of each statement. */ + public $statement_end = "\ngo"; - public $number_type = 'DECIMAL'; // Proper type for NUMBER(x) in this DB + /** @var string Proper type for NUMBER(x) in this DB. */ + public $number_type = 'DECIMAL'; - public $default_for_char = ''; // To define the default to set for NOT NULLs CHARs without default (null=do nothing) + /** @var string To define the default to set for NOT NULLs CHARs without default (null=do nothing).*/ + public $default_for_char = ''; - public $specify_nulls = true; //To force the generator if NULL clauses must be specified. It shouldn't be necessary - //but some mssql drivers require them or everything is created as NOT NULL :-( + /** + * @var bool To force the generator if NULL clauses must be specified. It shouldn't be necessary. + * note: some mssql drivers require them or everything is created as NOT NULL :-( + */ + public $specify_nulls = true; - public $sequence_extra_code = false; //Does the generator need to add extra code to generate the sequence fields - public $sequence_name = 'IDENTITY(1,1)'; //Particular name for inline sequences in this generator - public $sequence_only = false; //To avoid to output the rest of the field specs, leaving only the name and the sequence_name variable + /** @var bool True if the generator needs to add extra code to generate the sequence fields.*/ + public $sequence_extra_code = false; - public $add_table_comments = false; // Does the generator need to add code for table comments + /** @var string The particular name for inline sequences in this generator.*/ + public $sequence_name = 'IDENTITY(1,1)'; - public $concat_character = '+'; //Characters to be used as concatenation operator. If not defined - //MySQL CONCAT function will be use + /** @var bool To avoid outputting the rest of the field specs, leaving only the name and the sequence_name returned.*/ + public $sequence_only = false; - public $rename_table_sql = "sp_rename 'OLDNAME', 'NEWNAME'"; //SQL sentence to rename one table, both - //OLDNAME and NEWNAME are dynamically replaced + /** @var bool True if the generator needs to add code for table comments.*/ + public $add_table_comments = false; + /** @var string Characters to be used as concatenation operator.*/ + public $concat_character = '+'; + + /** @var string SQL sentence to rename one table, both 'OLDNAME' and 'NEWNAME' keywords are dynamically replaced.*/ + public $rename_table_sql = "sp_rename 'OLDNAME', 'NEWNAME'"; + + /** @var string SQL sentence to rename one column where 'TABLENAME', 'OLDFIELDNAME' and 'NEWFIELDNAME' keywords are dynamically replaced.*/ public $rename_column_sql = "sp_rename 'TABLENAME.OLDFIELDNAME', 'NEWFIELDNAME', 'COLUMN'"; - ///TABLENAME, OLDFIELDNAME and NEWFIELDNAME are dyanmically replaced - public $drop_index_sql = 'DROP INDEX TABLENAME.INDEXNAME'; //SQL sentence to drop one index - //TABLENAME, INDEXNAME are dynamically replaced + /** @var string SQL sentence to drop one index where 'TABLENAME', 'INDEXNAME' keywords are dynamically replaced.*/ + public $drop_index_sql = 'DROP INDEX TABLENAME.INDEXNAME'; - public $rename_index_sql = "sp_rename 'TABLENAME.OLDINDEXNAME', 'NEWINDEXNAME', 'INDEX'"; //SQL sentence to rename one index - //TABLENAME, OLDINDEXNAME, NEWINDEXNAME are dynamically replaced + /** @var string SQL sentence to rename one index where 'TABLENAME', 'OLDINDEXNAME' and 'NEWINDEXNAME' are dynamically replaced.*/ + public $rename_index_sql = "sp_rename 'TABLENAME.OLDINDEXNAME', 'NEWINDEXNAME', 'INDEX'"; - public $rename_key_sql = null; //SQL sentence to rename one key - //TABLENAME, OLDKEYNAME, NEWKEYNAME are dynamically replaced + /** @var string SQL sentence to rename one key 'TABLENAME', 'OLDKEYNAME' and 'NEWKEYNAME' are dynamically replaced.*/ + public $rename_key_sql = null; /** * Reset a sequence to the id field of a table. - * @param string $table name of table or xmldb_table object - * @return array sql commands to execute + * + * @param xmldb_table|string $table name of table or the table object. + * @return array of sql statements */ public function getResetSequenceSQL($table) { @@ -109,14 +125,14 @@ class mssql_sql_generator extends sql_generator { * @return string the correct name of the table */ public function getTableName(xmldb_table $xmldb_table, $quoted=true) { - /// Get the name, supporting special mssql names for temp tables + // Get the name, supporting special mssql names for temp tables if ($this->temptables->is_temptable($xmldb_table->getName())) { $tablename = $this->temptables->get_correct_name($xmldb_table->getName()); } else { $tablename = $this->prefix . $xmldb_table->getName(); } - /// Apply quotes optionally + // Apply quotes optionally if ($quoted) { $tablename = $this->getEncQuoted($tablename); } @@ -124,10 +140,12 @@ class mssql_sql_generator extends sql_generator { return $tablename; } - /** * Given one correct xmldb_table, returns the SQL statements - * to create temporary table (inside one array) + * to create temporary table (inside one array). + * + * @param xmldb_table $xmldb_table The xmldb_table object instance. + * @return array of sql statements */ public function getCreateTempTableSQL($xmldb_table) { $this->temptables->add_temptable($xmldb_table->getName()); @@ -151,7 +169,12 @@ class mssql_sql_generator extends sql_generator { } /** - * Given one XMLDB Type, lenght and decimals, returns the DB proper SQL type + * Given one XMLDB Type, length and decimals, returns the DB proper SQL type. + * + * @param int $xmldb_type The xmldb_type defined constant. XMLDB_TYPE_INTEGER and other XMLDB_TYPE_* constants. + * @param int $xmldb_length The length of that data type. + * @param int $xmldb_decimals The decimal places of precision of the data type. + * @return string The DB defined data type. */ public function getTypeSQL($xmldb_type, $xmldb_length=null, $xmldb_decimals=null) { @@ -171,7 +194,7 @@ class mssql_sql_generator extends sql_generator { case XMLDB_TYPE_NUMBER: $dbtype = $this->number_type; if (!empty($xmldb_length)) { - /// 38 is the max allowed + // 38 is the max allowed if ($xmldb_length > 38) { $xmldb_length = 38; } @@ -211,23 +234,27 @@ class mssql_sql_generator extends sql_generator { } /** - * Given one xmldb_table and one xmldb_field, return the SQL statements needed to drop the field from the table + * Given one xmldb_table and one xmldb_field, return the SQL statements needed to drop the field from the table. * MSSQL overwrites the standard sentence because it needs to do some extra work dropping the default and * check constraints + * + * @param xmldb_table $xmldb_table The table related to $xmldb_field. + * @param xmldb_field $xmldb_field The instance of xmldb_field to create the SQL from. + * @return array The SQL statement for dropping a field from the table. */ public function getDropFieldSQL($xmldb_table, $xmldb_field) { $results = array(); - /// Get the quoted name of the table and field + // Get the quoted name of the table and field $tablename = $this->getTableName($xmldb_table); $fieldname = $this->getEncQuoted($xmldb_field->getName()); - /// Look for any default constraint in this field and drop it + // Look for any default constraint in this field and drop it if ($defaultname = $this->getDefaultConstraintName($xmldb_table, $xmldb_field)) { $results[] = 'ALTER TABLE ' . $tablename . ' DROP CONSTRAINT ' . $defaultname; } - /// Build the standard alter table drop column + // Build the standard alter table drop column $results[] = 'ALTER TABLE ' . $tablename . ' DROP COLUMN ' . $fieldname; return $results; @@ -235,33 +262,43 @@ class mssql_sql_generator extends sql_generator { /** * Given one correct xmldb_field and the new name, returns the SQL statements - * to rename it (inside one array) + * to rename it (inside one array). + * * MSSQL is special, so we overload the function here. It needs to * drop the constraints BEFORE renaming the field + * + * @param xmldb_table $xmldb_table The table related to $xmldb_field. + * @param xmldb_field $xmldb_field The instance of xmldb_field to get the renamed field from. + * @param string $newname The new name to rename the field to. + * @return array The SQL statements for renaming the field. */ public function getRenameFieldSQL($xmldb_table, $xmldb_field, $newname) { $results = array(); //Array where all the sentences will be stored - /// Although this is checked in database_manager::rename_field() - double check - /// that we aren't trying to rename one "id" field. Although it could be - /// implemented (if adding the necessary code to rename sequences, defaults, - /// triggers... and so on under each getRenameFieldExtraSQL() function, it's - /// better to forbid it, mainly because this field is the default PK and - /// in the future, a lot of FKs can be pointing here. So, this field, more - /// or less, must be considered immutable! + // Although this is checked in database_manager::rename_field() - double check + // that we aren't trying to rename one "id" field. Although it could be + // implemented (if adding the necessary code to rename sequences, defaults, + // triggers... and so on under each getRenameFieldExtraSQL() function, it's + // better to forbid it, mainly because this field is the default PK and + // in the future, a lot of FKs can be pointing here. So, this field, more + // or less, must be considered immutable! if ($xmldb_field->getName() == 'id') { return array(); } - /// Call to standard (parent) getRenameFieldSQL() function + // Call to standard (parent) getRenameFieldSQL() function $results = array_merge($results, parent::getRenameFieldSQL($xmldb_table, $xmldb_field, $newname)); return $results; } /** - * Returns the code (array of statements) needed to execute extra statements on table rename + * Returns the code (array of statements) needed to execute extra statements on table rename. + * + * @param xmldb_table $xmldb_table The xmldb_table object instance. + * @param string $newname The new name for the table. + * @return array Array of extra SQL statements to rename a table. */ public function getRenameTableExtraSQL($xmldb_table, $newname) { @@ -271,17 +308,24 @@ class mssql_sql_generator extends sql_generator { } /** - * Given one xmldb_table and one xmldb_field, return the SQL statements needed to alter the field in the table + * Given one xmldb_table and one xmldb_field, return the SQL statements needed to alter the field in the table. + * + * @param xmldb_table $xmldb_table The table related to $xmldb_field. + * @param xmldb_field $xmldb_field The instance of xmldb_field to create the SQL from. + * @param string $skip_type_clause The type clause on alter columns, NULL by default. + * @param string $skip_default_clause The default clause on alter columns, NULL by default. + * @param string $skip_notnull_clause The null/notnull clause on alter columns, NULL by default. + * @return string The field altering SQL statement. */ public function getAlterFieldSQL($xmldb_table, $xmldb_field, $skip_type_clause = NULL, $skip_default_clause = NULL, $skip_notnull_clause = NULL) { - $results = array(); /// To store all the needed SQL commands + $results = array(); // To store all the needed SQL commands - /// Get the quoted name of the table and field + // Get the quoted name of the table and field $tablename = $xmldb_table->getName(); $fieldname = $xmldb_field->getName(); - /// Take a look to field metadata + // Take a look to field metadata $meta = $this->mdb->get_columns($tablename); $metac = $meta[$fieldname]; $oldmetatype = $metac->meta_type; @@ -294,7 +338,7 @@ class mssql_sql_generator extends sql_generator { $typechanged = true; //By default, assume that the column type has changed $lengthchanged = true; //By default, assume that the column length has changed - /// Detect if we are changing the type of the column + // Detect if we are changing the type of the column if (($xmldb_field->getType() == XMLDB_TYPE_INTEGER && $oldmetatype == 'I') || ($xmldb_field->getType() == XMLDB_TYPE_NUMBER && $oldmetatype == 'N') || ($xmldb_field->getType() == XMLDB_TYPE_FLOAT && $oldmetatype == 'F') || @@ -304,8 +348,8 @@ class mssql_sql_generator extends sql_generator { $typechanged = false; } - /// If the new field (and old) specs are for integer, let's be a bit more specific differentiating - /// types of integers. Else, some combinations can cause things like MDL-21868 + // If the new field (and old) specs are for integer, let's be a bit more specific differentiating + // types of integers. Else, some combinations can cause things like MDL-21868 if ($xmldb_field->getType() == XMLDB_TYPE_INTEGER && $oldmetatype == 'I') { if ($xmldb_field->getLength() > 9) { // Convert our new lenghts to detailed meta types $newmssqlinttype = 'I8'; @@ -326,20 +370,20 @@ class mssql_sql_generator extends sql_generator { } } - /// Detect if we are changing the length of the column, not always necessary to drop defaults - /// if only the length changes, but it's safe to do it always + // Detect if we are changing the length of the column, not always necessary to drop defaults + // if only the length changes, but it's safe to do it always if ($xmldb_field->getLength() == $oldlength) { $lengthchanged = false; } - /// If type or length have changed drop the default if exists + // If type or length have changed drop the default if exists if ($typechanged || $lengthchanged) { $results = $this->getDropDefaultSQL($xmldb_table, $xmldb_field); } - /// Some changes of type require multiple alter statements, because mssql lacks direct implicit cast between such types - /// Here it is the matrix: http://msdn.microsoft.com/en-us/library/ms187928(SQL.90).aspx - /// Going to store such intermediate alters in array of objects, storing all the info needed + // Some changes of type require multiple alter statements, because mssql lacks direct implicit cast between such types + // Here it is the matrix: http://msdn.microsoft.com/en-us/library/ms187928(SQL.90).aspx + // Going to store such intermediate alters in array of objects, storing all the info needed $multiple_alter_stmt = array(); $targettype = $xmldb_field->getType(); @@ -377,7 +421,7 @@ class mssql_sql_generator extends sql_generator { $multiple_alter_stmt[0]->length = 255; } - /// Just prevent default clauses in this type of sentences for mssql and launch the parent one + // Just prevent default clauses in this type of sentences for mssql and launch the parent one if (empty($multiple_alter_stmt)) { // Direct implicit conversion allowed, launch it $results = array_merge($results, parent::getAlterFieldSQL($xmldb_table, $xmldb_field, NULL, true, NULL)); @@ -394,25 +438,29 @@ class mssql_sql_generator extends sql_generator { $results = array_merge($results, parent::getAlterFieldSQL($xmldb_table, $xmldb_field, NULL, true, NULL)); } - /// Finally, process the default clause to add it back if necessary + // Finally, process the default clause to add it back if necessary if ($typechanged || $lengthchanged) { $results = array_merge($results, $this->getCreateDefaultSQL($xmldb_table, $xmldb_field)); } - /// Return results + // Return results return $results; } /** - * Given one xmldb_table and one xmldb_field, return the SQL statements needed to modify the default of the field in the table + * Given one xmldb_table and one xmldb_field, return the SQL statements needed to modify the default of the field in the table. + * + * @param xmldb_table $xmldb_table The table related to $xmldb_field. + * @param xmldb_field $xmldb_field The instance of xmldb_field to get the modified default value from. + * @return array The SQL statement for modifying the default value. */ public function getModifyDefaultSQL($xmldb_table, $xmldb_field) { - /// MSSQL is a bit special with default constraints because it implements them as external constraints so - /// normal ALTER TABLE ALTER COLUMN don't work to change defaults. Because this, we have this method overloaded here + // MSSQL is a bit special with default constraints because it implements them as external constraints so + // normal ALTER TABLE ALTER COLUMN don't work to change defaults. Because this, we have this method overloaded here $results = array(); - /// Decide if we are going to create/modify or to drop the default + // Decide if we are going to create/modify or to drop the default if ($xmldb_field->getDefault() === null) { $results = $this->getDropDefaultSQL($xmldb_table, $xmldb_field); //Drop but, under some circumstances, re-enable $default_clause = $this->getDefaultClause($xmldb_field); @@ -428,22 +476,26 @@ class mssql_sql_generator extends sql_generator { } /** - * Given one xmldb_table and one xmldb_field, return the SQL statements needed to create its default + * Given one xmldb_table and one xmldb_field, return the SQL statements needed to add its default * (usually invoked from getModifyDefaultSQL() + * + * @param xmldb_table $xmldb_table The xmldb_table object instance. + * @param xmldb_field $xmldb_field The xmldb_field object instance. + * @return array Array of SQL statements to create a field's default. */ public function getCreateDefaultSQL($xmldb_table, $xmldb_field) { - /// MSSQL is a bit special and it requires the corresponding DEFAULT CONSTRAINT to be dropped + // MSSQL is a bit special and it requires the corresponding DEFAULT CONSTRAINT to be dropped $results = array(); - /// Get the quoted name of the table and field + // Get the quoted name of the table and field $tablename = $this->getTableName($xmldb_table); $fieldname = $this->getEncQuoted($xmldb_field->getName()); - /// Now, check if, with the current field attributes, we have to build one default + // Now, check if, with the current field attributes, we have to build one default $default_clause = $this->getDefaultClause($xmldb_field); if ($default_clause) { - /// We need to build the default (Moodle) default, so do it + // We need to build the default (Moodle) default, so do it $sql = 'ALTER TABLE ' . $tablename . ' ADD' . $default_clause . ' FOR ' . $fieldname; $results[] = $sql; } @@ -454,17 +506,25 @@ class mssql_sql_generator extends sql_generator { /** * Given one xmldb_table and one xmldb_field, return the SQL statements needed to drop its default * (usually invoked from getModifyDefaultSQL() + * + * Note that this method may be dropped in future. + * + * @param xmldb_table $xmldb_table The xmldb_table object instance. + * @param xmldb_field $xmldb_field The xmldb_field object instance. + * @return array Array of SQL statements to create a field's default. + * + * @todo MDL-31147 Moodle 2.1 - Drop getDropDefaultSQL() */ public function getDropDefaultSQL($xmldb_table, $xmldb_field) { - /// MSSQL is a bit special and it requires the corresponding DEFAULT CONSTRAINT to be dropped + // MSSQL is a bit special and it requires the corresponding DEFAULT CONSTRAINT to be dropped $results = array(); - /// Get the quoted name of the table and field + // Get the quoted name of the table and field $tablename = $this->getTableName($xmldb_table); $fieldname = $this->getEncQuoted($xmldb_field->getName()); - /// Look for the default contraint and, if found, drop it + // Look for the default contraint and, if found, drop it if ($defaultname = $this->getDefaultConstraintName($xmldb_table, $xmldb_field)) { $results[] = 'ALTER TABLE ' . $tablename . ' DROP CONSTRAINT ' . $defaultname; } @@ -476,14 +536,18 @@ class mssql_sql_generator extends sql_generator { * Given one xmldb_table and one xmldb_field, returns the name of its default constraint in DB * or false if not found * This function should be considered internal and never used outside from generator + * + * @param xmldb_table $xmldb_table The xmldb_table object instance. + * @param xmldb_field $xmldb_field The xmldb_field object instance. + * @return mixed */ - public function getDefaultConstraintName($xmldb_table, $xmldb_field) { + protected function getDefaultConstraintName($xmldb_table, $xmldb_field) { - /// Get the quoted name of the table and field + // Get the quoted name of the table and field $tablename = $this->getTableName($xmldb_table); $fieldname = $xmldb_field->getName(); - /// Look for any default constraint in this field and drop it + // Look for any default constraint in this field and drop it if ($default = $this->mdb->get_record_sql("SELECT id, object_name(cdefault) AS defaultconstraint FROM syscolumns WHERE id = object_id(?) @@ -508,6 +572,10 @@ class mssql_sql_generator extends sql_generator { * but the alternative involves modifying all the creation table code to avoid naming * constraints for temp objects and that will dupe a lot of code. * + * @param string $tablename The table name. + * @param string $fields A list of comma separated fields. + * @param string $suffix A suffix for the object name. + * @return string Object's name. */ public function getNameForObject($tablename, $fields, $suffix='') { if ($this->temptables->is_temptable($tablename)) { // Is temp table, inject random field names @@ -518,9 +586,17 @@ class mssql_sql_generator extends sql_generator { } /** - * Given one object name and it's type (pk, uk, fk, ck, ix, uix, seq, trg) - * return if such name is currently in use (true) or no (false) - * (invoked from getNameForObject() + * Given one object name and it's type (pk, uk, fk, ck, ix, uix, seq, trg). + * + * (MySQL requires the whole xmldb_table object to be specified, so we add it always) + * + * This is invoked from getNameForObject(). + * Only some DB have this implemented. + * + * @param string $object_name The object's name to check for. + * @param string $type The object's type (pk, uk, fk, ck, ix, uix, seq, trg). + * @param string $table_name The table's name to check in + * @return bool If such name is currently in use (true) or no (false) */ public function isNameInUse($object_name, $type, $table_name) { switch($type) { @@ -549,12 +625,20 @@ class mssql_sql_generator extends sql_generator { } /** - * Returns the code (in array) needed to add one comment to the table + * Returns the code (array of statements) needed to add one comment to the table. + * + * @param xmldb_table $xmldb_table The xmldb_table object instance. + * @return array Array of SQL statements to add one comment to the table. */ public function getCommentSQL($xmldb_table) { return array(); } + /** + * Adds slashes to string. + * @param string $s + * @return string The escaped string. + */ public function addslashes($s) { // do not use php addslashes() because it depends on PHP quote settings! $s = str_replace("'", "''", $s); @@ -563,10 +647,11 @@ class mssql_sql_generator extends sql_generator { /** * Returns an array of reserved words (lowercase) for this DB + * @return array An array of database specific reserved words */ public static function getReservedWords() { - /// This file contains the reserved words for MSSQL databases - /// from http://msdn2.microsoft.com/en-us/library/ms189822.aspx + // This file contains the reserved words for MSSQL databases + // from http://msdn2.microsoft.com/en-us/library/ms189822.aspx $reserved_words = array ( 'add', 'all', 'alter', 'and', 'any', 'as', 'asc', 'authorization', 'avg', 'backup', 'begin', 'between', 'break', 'browse', 'bulk', diff --git a/lib/ddl/mysql_sql_generator.php b/lib/ddl/mysql_sql_generator.php index 801d7401e0f..6ae310f6411 100644 --- a/lib/ddl/mysql_sql_generator.php +++ b/lib/ddl/mysql_sql_generator.php @@ -1,5 +1,4 @@ . - /** * Mysql specific SQL code generator. * - * @package core - * @subpackage ddl_generator + * @package core_ddl * @copyright 1999 onwards Martin Dougiamas http://dougiamas.com * 2001-3001 Eloy Lafuente (stronk7) http://contiento.com * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later @@ -30,55 +27,72 @@ defined('MOODLE_INTERNAL') || die(); require_once($CFG->libdir.'/ddl/sql_generator.php'); -/// This class generate SQL code to be used against MySQL -/// It extends XMLDBgenerator so everything can be -/// overridden as needed to generate correct SQL. - +/** + * This class generate SQL code to be used against MySQL + * It extends XMLDBgenerator so everything can be + * overridden as needed to generate correct SQL. + * + * @package core_ddl + * @copyright 1999 onwards Martin Dougiamas http://dougiamas.com + * 2001-3001 Eloy Lafuente (stronk7) http://contiento.com + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class mysql_sql_generator extends sql_generator { -/// Only set values that are different from the defaults present in XMLDBgenerator + // Only set values that are different from the defaults present in XMLDBgenerator - public $quote_string = '`'; // String used to quote names + /** @var string Used to quote names. */ + public $quote_string = '`'; - public $default_for_char = ''; // To define the default to set for NOT NULLs CHARs without default (null=do nothing) + /** @var string To define the default to set for NOT NULLs CHARs without default (null=do nothing).*/ + public $default_for_char = ''; - public $drop_default_value_required = true; //To specify if the generator must use some DEFAULT clause to drop defaults - public $drop_default_value = NULL; //The DEFAULT clause required to drop defaults + /** @var bool To specify if the generator must use some DEFAULT clause to drop defaults.*/ + public $drop_default_value_required = true; - public $primary_key_name = ''; //To force primary key names to one string (null=no force) + /** @var string The DEFAULT clause required to drop defaults.*/ + public $drop_default_value = null; - public $drop_primary_key = 'ALTER TABLE TABLENAME DROP PRIMARY KEY'; // Template to drop PKs - // with automatic replace for TABLENAME and KEYNAME + /** @var string To force primary key names to one string (null=no force).*/ + public $primary_key_name = ''; - public $drop_unique_key = 'ALTER TABLE TABLENAME DROP KEY KEYNAME'; // Template to drop UKs - // with automatic replace for TABLENAME and KEYNAME + /** @var string Template to drop PKs. 'TABLENAME' and 'KEYNAME' will be replaced from this template.*/ + public $drop_primary_key = 'ALTER TABLE TABLENAME DROP PRIMARY KEY'; - public $drop_foreign_key = 'ALTER TABLE TABLENAME DROP FOREIGN KEY KEYNAME'; // Template to drop FKs - // with automatic replace for TABLENAME and KEYNAME + /** @var string Template to drop UKs. 'TABLENAME' and 'KEYNAME' will be replaced from this template.*/ + public $drop_unique_key = 'ALTER TABLE TABLENAME DROP KEY KEYNAME'; - public $sequence_extra_code = false; //Does the generator need to add extra code to generate the sequence fields - public $sequence_name = 'auto_increment'; //Particular name for inline sequences in this generator + /** @var string Template to drop FKs. 'TABLENAME' and 'KEYNAME' will be replaced from this template.*/ + public $drop_foreign_key = 'ALTER TABLE TABLENAME DROP FOREIGN KEY KEYNAME'; + + /** @var bool True if the generator needs to add extra code to generate the sequence fields.*/ + public $sequence_extra_code = false; + + /** @var string The particular name for inline sequences in this generator.*/ + public $sequence_name = 'auto_increment'; public $add_after_clause = true; // Does the generator need to add the after clause for fields - public $concat_character = null; //Characters to be used as concatenation operator. If not defined - //MySQL CONCAT function will be use + /** @var string Characters to be used as concatenation operator.*/ + public $concat_character = null; - public $alter_column_sql = 'ALTER TABLE TABLENAME MODIFY COLUMN COLUMNSPECS'; //The SQL template to alter columns + /** @var string The SQL template to alter columns where the 'TABLENAME' and 'COLUMNSPECS' keywords are dynamically replaced.*/ + public $alter_column_sql = 'ALTER TABLE TABLENAME MODIFY COLUMN COLUMNSPECS'; - public $drop_index_sql = 'ALTER TABLE TABLENAME DROP INDEX INDEXNAME'; //SQL sentence to drop one index - //TABLENAME, INDEXNAME are dynamically replaced + /** @var string SQL sentence to drop one index where 'TABLENAME', 'INDEXNAME' keywords are dynamically replaced.*/ + public $drop_index_sql = 'ALTER TABLE TABLENAME DROP INDEX INDEXNAME'; - public $rename_index_sql = null; //SQL sentence to rename one index (MySQL doesn't support this!) - //TABLENAME, OLDINDEXNAME, NEWINDEXNAME are dynamically replaced + /** @var string SQL sentence to rename one index where 'TABLENAME', 'OLDINDEXNAME' and 'NEWINDEXNAME' are dynamically replaced.*/ + public $rename_index_sql = null; - public $rename_key_sql = null; //SQL sentence to rename one key (MySQL doesn't support this!) - //TABLENAME, OLDKEYNAME, NEWKEYNAME are dynamically replaced + /** @var string SQL sentence to rename one key 'TABLENAME', 'OLDKEYNAME' and 'NEWKEYNAME' are dynamically replaced.*/ + public $rename_key_sql = null; /** * Reset a sequence to the id field of a table. - * @param string $table name of table or xmldb_table object - * @return array sql commands to execute + * + * @param xmldb_table|string $table name of table or the table object. + * @return array of sql statements */ public function getResetSequenceSQL($table) { @@ -96,7 +110,11 @@ class mysql_sql_generator extends sql_generator { /** * Given one correct xmldb_table, returns the SQL statements - * to create it (inside one array) + * to create it (inside one array). + * + * @param xmldb_table $xmldb_table An xmldb_table instance. + * @return array An array of SQL statements, starting with the table creation SQL followed + * by any of its comments, indexes and sequence creation SQL statements. */ public function getCreateTableSQL($xmldb_table) { // first find out if want some special db engine @@ -124,7 +142,10 @@ class mysql_sql_generator extends sql_generator { /** * Given one correct xmldb_table, returns the SQL statements - * to create temporary table (inside one array) + * to create temporary table (inside one array). + * + * @param xmldb_table $xmldb_table The xmldb_table object instance. + * @return array of sql statements */ public function getCreateTempTableSQL($xmldb_table) { $this->temptables->add_temptable($xmldb_table->getName()); @@ -150,7 +171,12 @@ class mysql_sql_generator extends sql_generator { } /** - * Given one XMLDB Type, length and decimals, returns the DB proper SQL type + * Given one XMLDB Type, length and decimals, returns the DB proper SQL type. + * + * @param int $xmldb_type The xmldb_type defined constant. XMLDB_TYPE_INTEGER and other XMLDB_TYPE_* constants. + * @param int $xmldb_length The length of that data type. + * @param int $xmldb_decimals The decimal places of precision of the data type. + * @return string The DB defined data type. */ public function getTypeSQL($xmldb_type, $xmldb_length=null, $xmldb_decimals=null) { @@ -219,26 +245,35 @@ class mysql_sql_generator extends sql_generator { } /** - * Given one xmldb_table and one xmldb_field, return the SQL statements needed to create its default + * Given one xmldb_table and one xmldb_field, return the SQL statements needed to add its default * (usually invoked from getModifyDefaultSQL() + * + * @param xmldb_table $xmldb_table The xmldb_table object instance. + * @param xmldb_field $xmldb_field The xmldb_field object instance. + * @return array Array of SQL statements to create a field's default. */ public function getCreateDefaultSQL($xmldb_table, $xmldb_field) { - /// Just a wrapper over the getAlterFieldSQL() function for MySQL that - /// is capable of handling defaults + // Just a wrapper over the getAlterFieldSQL() function for MySQL that + // is capable of handling defaults return $this->getAlterFieldSQL($xmldb_table, $xmldb_field); } /** * Given one correct xmldb_field and the new name, returns the SQL statements - * to rename it (inside one array) - * MySQL is pretty different from the standard to justify this overloading + * to rename it (inside one array). + * + * @param xmldb_table $xmldb_table The table related to $xmldb_field. + * @param xmldb_field $xmldb_field The instance of xmldb_field to get the renamed field from. + * @param string $newname The new name to rename the field to. + * @return array The SQL statements for renaming the field. */ public function getRenameFieldSQL($xmldb_table, $xmldb_field, $newname) { + // NOTE: MySQL is pretty different from the standard to justify this overloading. - /// Need a clone of xmldb_field to perform the change leaving original unmodified + // Need a clone of xmldb_field to perform the change leaving original unmodified $xmldb_field_clone = clone($xmldb_field); - /// Change the name of the field to perform the change + // Change the name of the field to perform the change $xmldb_field_clone->setName($newname); $fieldsql = $this->getFieldSQL($xmldb_table, $xmldb_field_clone); @@ -252,15 +287,26 @@ class mysql_sql_generator extends sql_generator { /** * Given one xmldb_table and one xmldb_field, return the SQL statements needed to drop its default * (usually invoked from getModifyDefaultSQL() + * + * Note that this method may be dropped in future. + * + * @param xmldb_table $xmldb_table The xmldb_table object instance. + * @param xmldb_field $xmldb_field The xmldb_field object instance. + * @return array Array of SQL statements to create a field's default. + * + * @todo MDL-31147 Moodle 2.1 - Drop getDropDefaultSQL() */ public function getDropDefaultSQL($xmldb_table, $xmldb_field) { - /// Just a wrapper over the getAlterFieldSQL() function for MySQL that - /// is capable of handling defaults + // Just a wrapper over the getAlterFieldSQL() function for MySQL that + // is capable of handling defaults return $this->getAlterFieldSQL($xmldb_table, $xmldb_field); } /** - * Returns the code (in array) needed to add one comment to the table + * Returns the code (array of statements) needed to add one comment to the table. + * + * @param xmldb_table $xmldb_table The xmldb_table object instance. + * @return array Array of SQL statements to add one comment to the table. */ function getCommentSQL ($xmldb_table) { $comment = ''; @@ -273,25 +319,33 @@ class mysql_sql_generator extends sql_generator { } /** - * Given one object name and it's type (pk, uk, fk, ck, ix, uix, seq, trg) - * return if such name is currently in use (true) or no (false) - * (invoked from getNameForObject() + * Given one object name and it's type (pk, uk, fk, ck, ix, uix, seq, trg). + * + * (MySQL requires the whole xmldb_table object to be specified, so we add it always) + * + * This is invoked from getNameForObject(). + * Only some DB have this implemented. + * + * @param string $object_name The object's name to check for. + * @param string $type The object's type (pk, uk, fk, ck, ix, uix, seq, trg). + * @param string $table_name The table's name to check in + * @return bool If such name is currently in use (true) or no (false) */ public function isNameInUse($object_name, $type, $table_name) { - /// Calculate the real table name + // Calculate the real table name $xmldb_table = new xmldb_table($table_name); $tname = $this->getTableName($xmldb_table); switch($type) { case 'ix': case 'uix': - /// First of all, check table exists + // First of all, check table exists $metatables = $this->mdb->get_tables(); if (isset($metatables[$tname])) { - /// Fetch all the indexes in the table + // Fetch all the indexes in the table if ($indexes = $this->mdb->get_indexes($tname)) { - /// Look for existing index in array + // Look for existing index in array if (isset($indexes[$object_name])) { return true; } @@ -305,10 +359,11 @@ class mysql_sql_generator extends sql_generator { /** * Returns an array of reserved words (lowercase) for this DB + * @return array An array of database specific reserved words */ public static function getReservedWords() { - /// This file contains the reserved words for MySQL databases - /// from http://dev.mysql.com/doc/refman/6.0/en/reserved-words.html + // This file contains the reserved words for MySQL databases + // from http://dev.mysql.com/doc/refman/6.0/en/reserved-words.html $reserved_words = array ( 'accessible', 'add', 'all', 'alter', 'analyze', 'and', 'as', 'asc', 'asensitive', 'before', 'between', 'bigint', 'binary', diff --git a/lib/ddl/oracle_sql_generator.php b/lib/ddl/oracle_sql_generator.php index 312c97d4e03..e096c871ec2 100644 --- a/lib/ddl/oracle_sql_generator.php +++ b/lib/ddl/oracle_sql_generator.php @@ -1,5 +1,4 @@ . - /** * Oracle specific SQL code generator. * - * @package core - * @subpackage ddl_generator + * @package core_ddl * @copyright 1999 onwards Martin Dougiamas http://dougiamas.com * 2001-3001 Eloy Lafuente (stronk7) http://contiento.com * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later @@ -30,37 +27,61 @@ defined('MOODLE_INTERNAL') || die(); require_once($CFG->libdir.'/ddl/sql_generator.php'); -/// This class generate SQL code to be used against Oracle -/// It extends XMLDBgenerator so everything can be -/// overridden as needed to generate correct SQL. - +/** + * This class generate SQL code to be used against Oracle + * It extends XMLDBgenerator so everything can be + * overridden as needed to generate correct SQL. + * + * @package core_ddl + * @copyright 1999 onwards Martin Dougiamas http://dougiamas.com + * 2001-3001 Eloy Lafuente (stronk7) http://contiento.com + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class oracle_sql_generator extends sql_generator { -/// Only set values that are different from the defaults present in XMLDBgenerator + // Only set values that are different from the defaults present in XMLDBgenerator - public $statement_end = "\n/"; // String to be automatically added at the end of each statement - // Using "/" because the standard ";" isn't good for stored procedures (triggers) + /** + * @var string To be automatically added at the end of each statement. + * note: Using "/" because the standard ";" isn't good for stored procedures (triggers) + */ + public $statement_end = "\n/"; - public $number_type = 'NUMBER'; // Proper type for NUMBER(x) in this DB + /** @var string Proper type for NUMBER(x) in this DB. */ + public $number_type = 'NUMBER'; - public $default_for_char = ' '; // To define the default to set for NOT NULLs CHARs without default (null=do nothing) - // Using this whitespace here because Oracle doesn't distinguish empty and null! :-( + /** + * @var string To define the default to set for NOT NULLs CHARs without default (null=do nothing). + * note: Using this whitespace here because Oracle doesn't distinguish empty and null! :-( + */ + public $default_for_char = ' '; - public $drop_default_value_required = true; //To specify if the generator must use some DEFAULT clause to drop defaults - public $drop_default_value = NULL; //The DEFAULT clause required to drop defaults + /** @var bool To specify if the generator must use some DEFAULT clause to drop defaults.*/ + public $drop_default_value_required = true; - public $default_after_null = false; //To decide if the default clause of each field must go after the null clause + /** @var string The DEFAULT clause required to drop defaults.*/ + public $drop_default_value = null; - public $sequence_extra_code = true; //Does the generator need to add extra code to generate the sequence fields - public $sequence_name = ''; //Particular name for inline sequences in this generator - public $sequence_cache_size = 20; //Size of the sequences values cache (20 = Oracle Default) + /** @var bool To decide if the default clause of each field must go after the null clause.*/ + public $default_after_null = false; - public $alter_column_sql = 'ALTER TABLE TABLENAME MODIFY (COLUMNSPECS)'; //The SQL template to alter columns + /** @var bool True if the generator needs to add extra code to generate the sequence fields.*/ + public $sequence_extra_code = true; + + /** @var string The particular name for inline sequences in this generator.*/ + public $sequence_name = ''; + + /** @var string The SQL template to alter columns where the 'TABLENAME' and 'COLUMNSPECS' keywords are dynamically replaced.*/ + public $alter_column_sql = 'ALTER TABLE TABLENAME MODIFY (COLUMNSPECS)'; + + /** @var int var ugly Oracle hack - size of the sequences values cache (20 = Default)*/ + public $sequence_cache_size = 20; /** * Reset a sequence to the id field of a table. - * @param string $table name of table or xmldb_table object - * @return array sql commands to execute + * + * @param xmldb_table|string $table name of table or the table object. + * @return array of sql statements */ public function getResetSequenceSQL($table) { @@ -78,7 +99,7 @@ class oracle_sql_generator extends sql_generator { $seqname = $this->getSequenceFromDB($xmldb_table); if (!$seqname) { - /// Fallback, seqname not found, something is wrong. Inform and use the alternative getNameForObject() method + // Fallback, seqname not found, something is wrong. Inform and use the alternative getNameForObject() method $seqname = $this->getNameForObject($table, 'id', 'seq'); } @@ -95,14 +116,14 @@ class oracle_sql_generator extends sql_generator { * @return string the correct name of the table */ public function getTableName(xmldb_table $xmldb_table, $quoted=true) { - /// Get the name, supporting special oci names for temp tables + // Get the name, supporting special oci names for temp tables if ($this->temptables->is_temptable($xmldb_table->getName())) { $tablename = $this->temptables->get_correct_name($xmldb_table->getName()); } else { $tablename = $this->prefix . $xmldb_table->getName(); } - /// Apply quotes optionally + // Apply quotes optionally if ($quoted) { $tablename = $this->getEncQuoted($tablename); } @@ -112,7 +133,10 @@ class oracle_sql_generator extends sql_generator { /** * Given one correct xmldb_table, returns the SQL statements - * to create temporary table (inside one array) + * to create temporary table (inside one array). + * + * @param xmldb_table $xmldb_table The xmldb_table object instance. + * @return array of sql statements */ public function getCreateTempTableSQL($xmldb_table) { $this->temptables->add_temptable($xmldb_table->getName()); @@ -138,7 +162,12 @@ class oracle_sql_generator extends sql_generator { } /** - * Given one XMLDB Type, length and decimals, returns the DB proper SQL type + * Given one XMLDB Type, length and decimals, returns the DB proper SQL type. + * + * @param int $xmldb_type The xmldb_type defined constant. XMLDB_TYPE_INTEGER and other XMLDB_TYPE_* constants. + * @param int $xmldb_length The length of that data type. + * @param int $xmldb_decimals The decimal places of precision of the data type. + * @return string The DB defined data type. */ public function getTypeSQL($xmldb_type, $xmldb_length=null, $xmldb_decimals=null) { @@ -152,7 +181,7 @@ class oracle_sql_generator extends sql_generator { case XMLDB_TYPE_FLOAT: case XMLDB_TYPE_NUMBER: $dbtype = $this->number_type; - /// 38 is the max allowed + // 38 is the max allowed if ($xmldb_length > 38) { $xmldb_length = 38; } @@ -188,7 +217,12 @@ class oracle_sql_generator extends sql_generator { } /** - * Returns the code needed to create one sequence for the xmldb_table and xmldb_field passes + * Returns the code (array of statements) needed + * to create one sequence for the xmldb_table and xmldb_field passed in. + * + * @param xmldb_table $xmldb_table The xmldb_table object instance. + * @param xmldb_field $xmldb_field The xmldb_field object instance. + * @return array Array of SQL statements to create the sequence. */ public function getCreateSequenceSQL($xmldb_table, $xmldb_field) { @@ -207,6 +241,11 @@ class oracle_sql_generator extends sql_generator { /** * Returns the code needed to create one trigger for the xmldb_table and xmldb_field passed + * + * @param xmldb_table $xmldb_table The xmldb_table object instance. + * @param xmldb_field $xmldb_field The xmldb_field object instance. + * @param string $sequence_name + * @return array Array of SQL statements to create the sequence. */ public function getCreateTriggerSQL($xmldb_table, $xmldb_field, $sequence_name) { @@ -228,6 +267,11 @@ class oracle_sql_generator extends sql_generator { /** * Returns the code needed to drop one sequence for the xmldb_table and xmldb_field passed * Can, optionally, specify if the underlying trigger will be also dropped + * + * @param xmldb_table $xmldb_table The xmldb_table object instance. + * @param xmldb_field $xmldb_field The xmldb_field object instance. + * @param bool $include_trigger + * @return array Array of SQL statements to create the sequence. */ public function getDropSequenceSQL($xmldb_table, $xmldb_field, $include_trigger=false) { @@ -245,7 +289,10 @@ class oracle_sql_generator extends sql_generator { } /** - * Returns the code (in array) needed to add one comment to the table + * Returns the code (array of statements) needed to add one comment to the table. + * + * @param xmldb_table $xmldb_table The xmldb_table object instance. + * @return array Array of SQL statements to add one comment to the table. */ function getCommentSQL ($xmldb_table) { @@ -257,6 +304,9 @@ class oracle_sql_generator extends sql_generator { /** * Returns the code (array of statements) needed to execute extra statements on table drop + * + * @param xmldb_table $xmldb_table The xmldb_table object instance. + * @return array Array of extra SQL statements to drop a table. */ public function getDropTableExtraSQL($xmldb_table) { $xmldb_field = new xmldb_field('id'); // Fields having sequences should be exclusively, id. @@ -264,7 +314,11 @@ class oracle_sql_generator extends sql_generator { } /** - * Returns the code (array of statements) needed to execute extra statements on table rename + * Returns the code (array of statements) needed to execute extra statements on table rename. + * + * @param xmldb_table $xmldb_table The xmldb_table object instance. + * @param string $newname The new name for the table. + * @return array Array of extra SQL statements to rename a table. */ public function getRenameTableExtraSQL($xmldb_table, $newname) { @@ -278,28 +332,36 @@ class oracle_sql_generator extends sql_generator { $oldtriggername = $this->getTriggerFromDB($xmldb_table); $newtriggername = $this->getNameForObject($newname, $xmldb_field->getName(), 'trg'); - /// Drop old trigger (first of all) + // Drop old trigger (first of all) $results[] = "DROP TRIGGER " . $oldtriggername; - /// Rename the sequence, disablig CACHE before and enablig it later - /// to avoid consuming of values on rename + // Rename the sequence, disablig CACHE before and enablig it later + // to avoid consuming of values on rename $results[] = 'ALTER SEQUENCE ' . $oldseqname . ' NOCACHE'; $results[] = 'RENAME ' . $oldseqname . ' TO ' . $newseqname; $results[] = 'ALTER SEQUENCE ' . $newseqname . ' CACHE ' . $this->sequence_cache_size; - /// Create new trigger - $newt = new xmldb_table($newname); /// Temp table for trigger code generation + // Create new trigger + $newt = new xmldb_table($newname); // Temp table for trigger code generation $results = array_merge($results, $this->getCreateTriggerSQL($newt, $xmldb_field, $newseqname)); return $results; } /** - * Given one xmldb_table and one xmldb_field, return the SQL statements needed to alter the field in the table + * Given one xmldb_table and one xmldb_field, return the SQL statements needed to alter the field in the table. + * * Oracle has some severe limits: * - clob and blob fields doesn't allow type to be specified * - error is dropped if the null/not null clause is specified and hasn't changed * - changes in precision/decimals of numeric fields drop an ORA-1440 error + * + * @param xmldb_table $xmldb_table The table related to $xmldb_field. + * @param xmldb_field $xmldb_field The instance of xmldb_field to create the SQL from. + * @param string $skip_type_clause The type clause on alter columns, NULL by default. + * @param string $skip_default_clause The default clause on alter columns, NULL by default. + * @param string $skip_notnull_clause The null/notnull clause on alter columns, NULL by default. + * @return string The field altering SQL statement. */ public function getAlterFieldSQL($xmldb_table, $xmldb_field, $skip_type_clause = NULL, $skip_default_clause = NULL, $skip_notnull_clause = NULL) { @@ -307,20 +369,20 @@ class oracle_sql_generator extends sql_generator { $skip_default_clause = is_null($skip_default_clause) ? $this->alter_column_skip_default : $skip_default_clause; $skip_notnull_clause = is_null($skip_notnull_clause) ? $this->alter_column_skip_notnull : $skip_notnull_clause; - $results = array(); /// To store all the needed SQL commands + $results = array(); // To store all the needed SQL commands - /// Get the quoted name of the table and field + // Get the quoted name of the table and field $tablename = $this->getTableName($xmldb_table); $fieldname = $xmldb_field->getName(); - /// Take a look to field metadata + // Take a look to field metadata $meta = $this->mdb->get_columns($xmldb_table->getName()); $metac = $meta[$fieldname]; $oldmetatype = $metac->meta_type; $oldlength = $metac->max_length; - /// To calculate the oldlength if the field is numeric, we need to perform one extra query - /// because ADOdb has one bug here. http://phplens.com/lens/lensforum/msgs.php?id=15883 + // To calculate the oldlength if the field is numeric, we need to perform one extra query + // because ADOdb has one bug here. http://phplens.com/lens/lensforum/msgs.php?id=15883 if ($oldmetatype == 'N') { $uppertablename = strtoupper($tablename); $upperfieldname = strtoupper($fieldname); @@ -343,7 +405,7 @@ class oracle_sql_generator extends sql_generator { $from_temp_fields = false; //By default don't assume we are going to use temporal fields - /// Detect if we are changing the type of the column + // Detect if we are changing the type of the column if (($xmldb_field->getType() == XMLDB_TYPE_INTEGER && $oldmetatype == 'I') || ($xmldb_field->getType() == XMLDB_TYPE_NUMBER && $oldmetatype == 'N') || ($xmldb_field->getType() == XMLDB_TYPE_FLOAT && $oldmetatype == 'F') || @@ -352,14 +414,14 @@ class oracle_sql_generator extends sql_generator { ($xmldb_field->getType() == XMLDB_TYPE_BINARY && $oldmetatype == 'B')) { $typechanged = false; } - /// Detect if precision has changed + // Detect if precision has changed if (($xmldb_field->getType() == XMLDB_TYPE_TEXT) || ($xmldb_field->getType() == XMLDB_TYPE_BINARY) || ($oldlength == -1) || ($xmldb_field->getLength() == $oldlength)) { $precisionchanged = false; } - /// Detect if decimal has changed + // Detect if decimal has changed if (($xmldb_field->getType() == XMLDB_TYPE_INTEGER) || ($xmldb_field->getType() == XMLDB_TYPE_CHAR) || ($xmldb_field->getType() == XMLDB_TYPE_TEXT) || @@ -369,29 +431,29 @@ class oracle_sql_generator extends sql_generator { ($xmldb_field->getDecimals() == $olddecimals)) { $decimalchanged = false; } - /// Detect if we are changing the default + // Detect if we are changing the default if (($xmldb_field->getDefault() === null && $olddefault === null) || ($xmldb_field->getDefault() === $olddefault) || //Check both equality and ("'" . $xmldb_field->getDefault() . "'" === $olddefault)) { //Equality with quotes because ADOdb returns the default with quotes $defaultchanged = false; } - /// Detect if we are changing the nullability + // Detect if we are changing the nullability if (($xmldb_field->getNotnull() === $oldnotnull)) { $notnullchanged = false; } - /// If type has changed or precision or decimal has changed and we are in one numeric field - /// - create one temp column with the new specs - /// - fill the new column with the values from the old one - /// - drop the old column - /// - rename the temp column to the original name + // If type has changed or precision or decimal has changed and we are in one numeric field + // - create one temp column with the new specs + // - fill the new column with the values from the old one + // - drop the old column + // - rename the temp column to the original name if (($typechanged) || (($oldmetatype == 'N' || $oldmetatype == 'I') && ($precisionchanged || $decimalchanged))) { $tempcolname = $xmldb_field->getName() . '___tmp'; // Short tmp name, surely not conflicting ever if (strlen($tempcolname) > 30) { // Safeguard we don't excess the 30cc limit $tempcolname = 'ongoing_alter_column_tmp'; } - /// Prevent temp field to have both NULL/NOT NULL and DEFAULT constraints + // Prevent temp field to have both NULL/NOT NULL and DEFAULT constraints $skip_notnull_clause = true; $skip_default_clause = true; $xmldb_field->setName($tempcolname); @@ -400,9 +462,9 @@ class oracle_sql_generator extends sql_generator { if (isset($meta[$tempcolname])) { $results = array_merge($results, $this->getDropFieldSQL($xmldb_table, $xmldb_field)); } - /// Create the temporal column + // Create the temporal column $results = array_merge($results, $this->getAddFieldSQL($xmldb_table, $xmldb_field, $skip_type_clause, $skip_type_clause, $skip_notnull_clause)); - /// Copy contents from original col to the temporal one + // Copy contents from original col to the temporal one // From TEXT to integer/number we need explicit conversion if ($oldmetatype == 'X' && $xmldb_field->GetType() == XMLDB_TYPE_INTEGER) { @@ -414,47 +476,47 @@ class oracle_sql_generator extends sql_generator { } else { $results[] = 'UPDATE ' . $tablename . ' SET ' . $tempcolname . ' = ' . $fieldname; } - /// Drop the old column + // Drop the old column $xmldb_field->setName($fieldname); //Set back the original field name $results = array_merge($results, $this->getDropFieldSQL($xmldb_table, $xmldb_field)); - /// Rename the temp column to the original one + // Rename the temp column to the original one $results[] = 'ALTER TABLE ' . $tablename . ' RENAME COLUMN ' . $tempcolname . ' TO ' . $fieldname; - /// Mark we have performed one change based in temp fields + // Mark we have performed one change based in temp fields $from_temp_fields = true; - /// Re-enable the notnull and default sections so the general AlterFieldSQL can use it + // Re-enable the notnull and default sections so the general AlterFieldSQL can use it $skip_notnull_clause = false; $skip_default_clause = false; - /// Dissable the type section because we have done it with the temp field + // Disable the type section because we have done it with the temp field $skip_type_clause = true; - /// If new field is nullable, nullability hasn't changed + // If new field is nullable, nullability hasn't changed if (!$xmldb_field->getNotnull()) { $notnullchanged = false; } - /// If new field hasn't default, default hasn't changed + // If new field hasn't default, default hasn't changed if ($xmldb_field->getDefault() === null) { $defaultchanged = false; } } - /// If type and precision and decimals hasn't changed, prevent the type clause + // If type and precision and decimals hasn't changed, prevent the type clause if (!$typechanged && !$precisionchanged && !$decimalchanged) { $skip_type_clause = true; } - /// If NULL/NOT NULL hasn't changed - /// prevent null clause to be specified + // If NULL/NOT NULL hasn't changed + // prevent null clause to be specified if (!$notnullchanged) { - $skip_notnull_clause = true; /// Initially, prevent the notnull clause - /// But, if we have used the temp field and the new field is not null, then enforce the not null clause + $skip_notnull_clause = true; // Initially, prevent the notnull clause + // But, if we have used the temp field and the new field is not null, then enforce the not null clause if ($from_temp_fields && $xmldb_field->getNotnull()) { $skip_notnull_clause = false; } } - /// If default hasn't changed - /// prevent default clause to be specified + // If default hasn't changed + // prevent default clause to be specified if (!$defaultchanged) { - $skip_default_clause = true; /// Initially, prevent the default clause - /// But, if we have used the temp field and the new field has default clause, then enforce the default clause + $skip_default_clause = true; // Initially, prevent the default clause + // But, if we have used the temp field and the new field has default clause, then enforce the default clause if ($from_temp_fields) { $default_clause = $this->getDefaultClause($xmldb_field); if ($default_clause) { @@ -463,33 +525,45 @@ class oracle_sql_generator extends sql_generator { } } - /// If arriving here, something is not being skipped (type, notnull, default), calculate the standard AlterFieldSQL + // If arriving here, something is not being skipped (type, notnull, default), calculate the standard AlterFieldSQL if (!$skip_type_clause || !$skip_notnull_clause || !$skip_default_clause) { $results = array_merge($results, parent::getAlterFieldSQL($xmldb_table, $xmldb_field, $skip_type_clause, $skip_default_clause, $skip_notnull_clause)); return $results; } - /// Finally return results + // Finally return results return $results; } /** - * Given one xmldb_table and one xmldb_field, return the SQL statements needed to create its default + * Given one xmldb_table and one xmldb_field, return the SQL statements needed to add its default * (usually invoked from getModifyDefaultSQL() + * + * @param xmldb_table $xmldb_table The xmldb_table object instance. + * @param xmldb_field $xmldb_field The xmldb_field object instance. + * @return array Array of SQL statements to create a field's default. */ public function getCreateDefaultSQL($xmldb_table, $xmldb_field) { - /// Just a wrapper over the getAlterFieldSQL() function for Oracle that - /// is capable of handling defaults + // Just a wrapper over the getAlterFieldSQL() function for Oracle that + // is capable of handling defaults return $this->getAlterFieldSQL($xmldb_table, $xmldb_field); } /** - * Given one xmldb_table and one xmldb_field, return the SQL statements needded to drop its default + * Given one xmldb_table and one xmldb_field, return the SQL statements needed to drop its default * (usually invoked from getModifyDefaultSQL() + * + * Note that this method may be dropped in future. + * + * @param xmldb_table $xmldb_table The xmldb_table object instance. + * @param xmldb_field $xmldb_field The xmldb_field object instance. + * @return array Array of SQL statements to create a field's default. + * + * @todo MDL-31147 Moodle 2.1 - Drop getDropDefaultSQL() */ public function getDropDefaultSQL($xmldb_table, $xmldb_field) { - /// Just a wrapper over the getAlterFieldSQL() function for Oracle that - /// is capable of handling defaults + // Just a wrapper over the getAlterFieldSQL() function for Oracle that + // is capable of handling defaults return $this->getAlterFieldSQL($xmldb_table, $xmldb_field); } @@ -499,7 +573,8 @@ class oracle_sql_generator extends sql_generator { * The sequence name for oracle is calculated by looking the corresponding * trigger and retrieving the sequence name from it (because sequences are * independent elements) - * If no sequence is found, returns false + * @param xmldb_table $xmldb_table The xmldb_table object instance. + * @return string|bool If no sequence is found, returns false */ public function getSequenceFromDB($xmldb_table) { @@ -511,7 +586,7 @@ class oracle_sql_generator extends sql_generator { FROM user_triggers WHERE table_name = ? AND trigger_name LIKE ?", array($tablename, "{$prefixupper}%_ID%_TRG"))) { - /// If trigger found, regexp it looking for the sequence name + // If trigger found, regexp it looking for the sequence name preg_match('/.*SELECT (.*)\.nextval/i', $trigger->trigger_body, $matches); if (isset($matches[1])) { $sequencename = $matches[1]; @@ -524,7 +599,9 @@ class oracle_sql_generator extends sql_generator { /** * Given one xmldb_table returns one string with the trigger * in the table (fetched from DB) - * If no trigger is found, returns false + * + * @param xmldb_table $xmldb_table The xmldb_table object instance. + * @return string|bool If no trigger is found, returns false */ public function getTriggerFromDB($xmldb_table) { @@ -543,9 +620,17 @@ class oracle_sql_generator extends sql_generator { } /** - * Given one object name and it's type (pk, uk, fk, ck, ix, uix, seq, trg) - * return if such name is currently in use (true) or no (false) - * (invoked from getNameForObject() + * Given one object name and it's type (pk, uk, fk, ck, ix, uix, seq, trg). + * + * (MySQL requires the whole xmldb_table object to be specified, so we add it always) + * + * This is invoked from getNameForObject(). + * Only some DB have this implemented. + * + * @param string $object_name The object's name to check for. + * @param string $type The object's type (pk, uk, fk, ck, ix, uix, seq, trg). + * @param string $table_name The table's name to check in + * @return bool If such name is currently in use (true) or no (false) */ public function isNameInUse($object_name, $type, $table_name) { switch($type) { @@ -573,6 +658,11 @@ class oracle_sql_generator extends sql_generator { return false; //No name in use found } + /** + * Adds slashes to string. + * @param string $s + * @return string The escaped string. + */ public function addslashes($s) { // do not use php addslashes() because it depends on PHP quote settings! $s = str_replace("'", "''", $s); @@ -581,10 +671,11 @@ class oracle_sql_generator extends sql_generator { /** * Returns an array of reserved words (lowercase) for this DB + * @return array An array of database specific reserved words */ public static function getReservedWords() { - /// This file contains the reserved words for Oracle databases - /// from http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96540/ap_keywd.htm + // This file contains the reserved words for Oracle databases + // from http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96540/ap_keywd.htm $reserved_words = array ( 'access', 'add', 'all', 'alter', 'and', 'any', 'as', 'asc', 'audit', 'between', 'by', 'char', diff --git a/lib/ddl/postgres_sql_generator.php b/lib/ddl/postgres_sql_generator.php index 46436fc8156..8d410868e01 100644 --- a/lib/ddl/postgres_sql_generator.php +++ b/lib/ddl/postgres_sql_generator.php @@ -1,5 +1,4 @@ . - /** * PostgreSQL specific SQL code generator. * - * @package core - * @subpackage ddl_generator + * @package core_ddl * @copyright 1999 onwards Martin Dougiamas http://dougiamas.com * 2001-3001 Eloy Lafuente (stronk7) http://contiento.com * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later @@ -30,35 +27,53 @@ defined('MOODLE_INTERNAL') || die(); require_once($CFG->libdir.'/ddl/sql_generator.php'); -/// This class generate SQL code to be used against PostgreSQL -/// It extends XMLDBgenerator so everything can be -/// overridden as needed to generate correct SQL. +/** + * This class generate SQL code to be used against PostgreSQL + * It extends XMLDBgenerator so everything can be + * overridden as needed to generate correct SQL. + * + * @package core_ddl + * @copyright 1999 onwards Martin Dougiamas http://dougiamas.com + * 2001-3001 Eloy Lafuente (stronk7) http://contiento.com + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class postgres_sql_generator extends sql_generator { -/// Only set values that are different from the defaults present in XMLDBgenerator + // Only set values that are different from the defaults present in XMLDBgenerator - public $number_type = 'NUMERIC'; // Proper type for NUMBER(x) in this DB + /** @var string Proper type for NUMBER(x) in this DB. */ + public $number_type = 'NUMERIC'; - public $default_for_char = ''; // To define the default to set for NOT NULLs CHARs without default (null=do nothing) + /** @var string To define the default to set for NOT NULLs CHARs without default (null=do nothing).*/ + public $default_for_char = ''; - public $sequence_extra_code = false; //Does the generator need to add extra code to generate the sequence fields - public $sequence_name = 'BIGSERIAL'; //Particular name for inline sequences in this generator - public $sequence_name_small = 'SERIAL'; //Particular name for inline sequences in this generator - public $sequence_only = true; //To avoid to output the rest of the field specs, leaving only the name and the sequence_name variable + /** @var bool True if the generator needs to add extra code to generate the sequence fields.*/ + public $sequence_extra_code = false; - public $rename_index_sql = 'ALTER TABLE OLDINDEXNAME RENAME TO NEWINDEXNAME'; //SQL sentence to rename one index - //TABLENAME, OLDINDEXNAME, NEWINDEXNAME are dynamically replaced + /** @var string The particular name for inline sequences in this generator.*/ + public $sequence_name = 'BIGSERIAL'; - public $rename_key_sql = null; //SQL sentence to rename one key (PostgreSQL doesn't support this!) - //TABLENAME, OLDKEYNAME, NEWKEYNAME are dynamically replaced + /** @var string The particular name for inline sequences in this generator.*/ + public $sequence_name_small = 'SERIAL'; - protected $std_strings = null; // '' or \' quotes + /** @var bool To avoid outputting the rest of the field specs, leaving only the name and the sequence_name returned.*/ + public $sequence_only = true; + + /** @var string SQL sentence to rename one index where 'TABLENAME', 'OLDINDEXNAME' and 'NEWINDEXNAME' are dynamically replaced.*/ + public $rename_index_sql = 'ALTER TABLE OLDINDEXNAME RENAME TO NEWINDEXNAME'; + + /** @var string SQL sentence to rename one key 'TABLENAME', 'OLDKEYNAME' and 'NEWKEYNAME' are dynamically replaced.*/ + public $rename_key_sql = null; + + /** @var string type of string quoting used - '' or \' quotes*/ + protected $std_strings = null; /** * Reset a sequence to the id field of a table. - * @param string $table name of table or xmldb_table object - * @return array sql commands to execute + * + * @param xmldb_table|string $table name of table or the table object. + * @return array of sql statements */ public function getResetSequenceSQL($table) { @@ -76,7 +91,10 @@ class postgres_sql_generator extends sql_generator { /** * Given one correct xmldb_table, returns the SQL statements - * to create temporary table (inside one array) + * to create temporary table (inside one array). + * + * @param xmldb_table $xmldb_table The xmldb_table object instance. + * @return array of sql statements */ public function getCreateTempTableSQL($xmldb_table) { $this->temptables->add_temptable($xmldb_table->getName()); @@ -101,7 +119,12 @@ class postgres_sql_generator extends sql_generator { } /** - * Given one XMLDB Type, length and decimals, returns the DB proper SQL type + * Given one XMLDB Type, length and decimals, returns the DB proper SQL type. + * + * @param int $xmldb_type The xmldb_type defined constant. XMLDB_TYPE_INTEGER and other XMLDB_TYPE_* constants. + * @param int $xmldb_length The length of that data type. + * @param int $xmldb_decimals The decimal places of precision of the data type. + * @return string The DB defined data type. */ public function getTypeSQL($xmldb_type, $xmldb_length=null, $xmldb_decimals=null) { @@ -157,7 +180,10 @@ class postgres_sql_generator extends sql_generator { } /** - * Returns the code (in array) needed to add one comment to the table + * Returns the code (array of statements) needed to add one comment to the table. + * + * @param xmldb_table $xmldb_table The xmldb_table object instance. + * @return array Array of SQL statements to add one comment to the table. */ function getCommentSQL ($xmldb_table) { @@ -168,7 +194,11 @@ class postgres_sql_generator extends sql_generator { } /** - * Returns the code (array of statements) needed to execute extra statements on table rename + * Returns the code (array of statements) needed to execute extra statements on table rename. + * + * @param xmldb_table $xmldb_table The xmldb_table object instance. + * @param string $newname The new name for the table. + * @return array Array of extra SQL statements to rename a table. */ public function getRenameTableExtraSQL($xmldb_table, $newname) { @@ -181,29 +211,37 @@ class postgres_sql_generator extends sql_generator { $oldseqname = $this->getTableName($xmldb_table) . '_' . $xmldb_field->getName() . '_seq'; $newseqname = $this->getTableName($newt) . '_' . $xmldb_field->getName() . '_seq'; - /// Rename de sequence + // Rename de sequence $results[] = 'ALTER TABLE ' . $oldseqname . ' RENAME TO ' . $newseqname; return $results; } /** - * Given one xmldb_table and one xmldb_field, return the SQL statements needed to alter the field in the table + * Given one xmldb_table and one xmldb_field, return the SQL statements needed to alter the field in the table. + * * PostgreSQL has some severe limits: * - Any change of type or precision requires a new temporary column to be created, values to * be transfered potentially casting them, to apply defaults if the column is not null and * finally, to rename it * - Changes in null/not null require the SET/DROP NOT NULL clause * - Changes in default require the SET/DROP DEFAULT clause + * + * @param xmldb_table $xmldb_table The table related to $xmldb_field. + * @param xmldb_field $xmldb_field The instance of xmldb_field to create the SQL from. + * @param string $skip_type_clause The type clause on alter columns, NULL by default. + * @param string $skip_default_clause The default clause on alter columns, NULL by default. + * @param string $skip_notnull_clause The null/notnull clause on alter columns, NULL by default. + * @return string The field altering SQL statement. */ public function getAlterFieldSQL($xmldb_table, $xmldb_field, $skip_type_clause = NULL, $skip_default_clause = NULL, $skip_notnull_clause = NULL) { - $results = array(); /// To store all the needed SQL commands + $results = array(); // To store all the needed SQL commands - /// Get the normla names of the table and field + // Get the normal names of the table and field $tablename = $xmldb_table->getName(); $fieldname = $xmldb_field->getName(); - /// Take a look to field metadata + // Take a look to field metadata $meta = $this->mdb->get_columns($tablename); $metac = $meta[$xmldb_field->getName()]; $oldmetatype = $metac->meta_type; @@ -218,7 +256,7 @@ class postgres_sql_generator extends sql_generator { $defaultchanged = true; //By default, assume that the column default has changed $notnullchanged = true; //By default, assume that the column notnull has changed - /// Detect if we are changing the type of the column + // Detect if we are changing the type of the column if (($xmldb_field->getType() == XMLDB_TYPE_INTEGER && $oldmetatype == 'I') || ($xmldb_field->getType() == XMLDB_TYPE_NUMBER && $oldmetatype == 'N') || ($xmldb_field->getType() == XMLDB_TYPE_FLOAT && $oldmetatype == 'F') || @@ -227,14 +265,14 @@ class postgres_sql_generator extends sql_generator { ($xmldb_field->getType() == XMLDB_TYPE_BINARY && $oldmetatype == 'B')) { $typechanged = false; } - /// Detect if we are changing the precision + // Detect if we are changing the precision if (($xmldb_field->getType() == XMLDB_TYPE_TEXT) || ($xmldb_field->getType() == XMLDB_TYPE_BINARY) || ($oldlength == -1) || ($xmldb_field->getLength() == $oldlength)) { $precisionchanged = false; } - /// Detect if we are changing the decimals + // Detect if we are changing the decimals if (($xmldb_field->getType() == XMLDB_TYPE_INTEGER) || ($xmldb_field->getType() == XMLDB_TYPE_CHAR) || ($xmldb_field->getType() == XMLDB_TYPE_TEXT) || @@ -244,32 +282,32 @@ class postgres_sql_generator extends sql_generator { ($xmldb_field->getDecimals() == $olddecimals)) { $decimalchanged = false; } - /// Detect if we are changing the default + // Detect if we are changing the default if (($xmldb_field->getDefault() === null && $olddefault === null) || ($xmldb_field->getDefault() === $olddefault)) { $defaultchanged = false; } - /// Detect if we are changing the nullability + // Detect if we are changing the nullability if (($xmldb_field->getNotnull() === $oldnotnull)) { $notnullchanged = false; } - /// Get the quoted name of the table and field + // Get the quoted name of the table and field $tablename = $this->getTableName($xmldb_table); $fieldname = $this->getEncQuoted($xmldb_field->getName()); - /// Decide if we have changed the column specs (type/precision/decimals) + // Decide if we have changed the column specs (type/precision/decimals) $specschanged = $typechanged || $precisionchanged || $decimalchanged; - /// if specs have changed, need to alter column + // if specs have changed, need to alter column if ($specschanged) { - /// Always drop any exiting default before alter column (some type changes can cause casting error in default for column) + // Always drop any exiting default before alter column (some type changes can cause casting error in default for column) if ($olddefault !== null) { - $results[] = 'ALTER TABLE ' . $tablename . ' ALTER COLUMN ' . $fieldname . ' DROP DEFAULT'; /// Drop default clause + $results[] = 'ALTER TABLE ' . $tablename . ' ALTER COLUMN ' . $fieldname . ' DROP DEFAULT'; // Drop default clause } $alterstmt = 'ALTER TABLE ' . $tablename . ' ALTER COLUMN ' . $this->getEncQuoted($xmldb_field->getName()) . ' TYPE' . $this->getFieldSQL($xmldb_table, $xmldb_field, null, true, true, null, false); - /// Some castings must be performed explicity (mainly from text|char to numeric|integer) + // Some castings must be performed explicitly (mainly from text|char to numeric|integer) if (($oldmetatype == 'C' || $oldmetatype == 'X') && ($xmldb_field->getType() == XMLDB_TYPE_NUMBER || $xmldb_field->getType() == XMLDB_TYPE_FLOAT)) { $alterstmt .= ' USING CAST('.$fieldname.' AS NUMERIC)'; // from char or text to number or float @@ -280,20 +318,20 @@ class postgres_sql_generator extends sql_generator { $results[] = $alterstmt; } - /// If the default has changed or we have performed one change in specs + // If the default has changed or we have performed one change in specs if ($defaultchanged || $specschanged) { $default_clause = $this->getDefaultClause($xmldb_field); if ($default_clause) { - $sql = 'ALTER TABLE ' . $tablename . ' ALTER COLUMN ' . $fieldname . ' SET' . $default_clause; /// Add default clause + $sql = 'ALTER TABLE ' . $tablename . ' ALTER COLUMN ' . $fieldname . ' SET' . $default_clause; // Add default clause $results[] = $sql; } else { - if (!$specschanged) { /// Only drop default if we haven't performed one specs change - $results[] = 'ALTER TABLE ' . $tablename . ' ALTER COLUMN ' . $fieldname . ' DROP DEFAULT'; /// Drop default clause + if (!$specschanged) { // Only drop default if we haven't performed one specs change + $results[] = 'ALTER TABLE ' . $tablename . ' ALTER COLUMN ' . $fieldname . ' DROP DEFAULT'; // Drop default clause } } } - /// If the not null has changed + // If the not null has changed if ($notnullchanged) { if ($xmldb_field->getNotnull()) { $results[] = 'ALTER TABLE ' . $tablename . ' ALTER COLUMN ' . $fieldname . ' SET NOT NULL'; @@ -302,30 +340,47 @@ class postgres_sql_generator extends sql_generator { } } - /// Return the results + // Return the results return $results; } /** - * Given one xmldb_table and one xmldb_field, return the SQL statements needed to create its default + * Given one xmldb_table and one xmldb_field, return the SQL statements needed to add its default * (usually invoked from getModifyDefaultSQL() + * + * @param xmldb_table $xmldb_table The xmldb_table object instance. + * @param xmldb_field $xmldb_field The xmldb_field object instance. + * @return array Array of SQL statements to create a field's default. */ public function getCreateDefaultSQL($xmldb_table, $xmldb_field) { - /// Just a wrapper over the getAlterFieldSQL() function for PostgreSQL that - /// is capable of handling defaults + // Just a wrapper over the getAlterFieldSQL() function for PostgreSQL that + // is capable of handling defaults return $this->getAlterFieldSQL($xmldb_table, $xmldb_field); } /** * Given one xmldb_table and one xmldb_field, return the SQL statements needed to drop its default * (usually invoked from getModifyDefaultSQL() + * + * Note that this method may be dropped in future. + * + * @param xmldb_table $xmldb_table The xmldb_table object instance. + * @param xmldb_field $xmldb_field The xmldb_field object instance. + * @return array Array of SQL statements to create a field's default. + * + * @todo MDL-31147 Moodle 2.1 - Drop getDropDefaultSQL() */ public function getDropDefaultSQL($xmldb_table, $xmldb_field) { - /// Just a wrapper over the getAlterFieldSQL() function for PostgreSQL that - /// is capable of handling defaults + // Just a wrapper over the getAlterFieldSQL() function for PostgreSQL that + // is capable of handling defaults return $this->getAlterFieldSQL($xmldb_table, $xmldb_field); } + /** + * Adds slashes to string. + * @param string $s + * @return string The escaped string. + */ public function addslashes($s) { // Postgres is gradually switching to ANSI quotes, we need to check what is expected if (!isset($this->std_strings)) { @@ -344,33 +399,43 @@ class postgres_sql_generator extends sql_generator { return $s; } -/** - * Given one xmldb_table returns one string with the sequence of the table - * in the table (fetched from DB) - * The sequence name for Postgres has one standard name convention: - * tablename_fieldname_seq - * so we just calculate it and confirm it's present in pg_class - * If no sequence is found, returns false - */ -function getSequenceFromDB($xmldb_table) { + /** + * Given one xmldb_table returns one string with the sequence of the table + * in the table (fetched from DB) + * The sequence name for Postgres has one standard name convention: + * tablename_fieldname_seq + * so we just calculate it and confirm it's present in pg_class + * + * @param xmldb_table $xmldb_table The xmldb_table object instance. + * @return string|bool If no sequence is found, returns false + */ + function getSequenceFromDB($xmldb_table) { - $tablename = $this->getTableName($xmldb_table); - $sequencename = $tablename . '_id_seq'; + $tablename = $this->getTableName($xmldb_table); + $sequencename = $tablename . '_id_seq'; - if (!$this->mdb->get_record_sql("SELECT * - FROM pg_class - WHERE relname = ? AND relkind = 'S'", - array($sequencename))) { - $sequencename = false; + if (!$this->mdb->get_record_sql("SELECT * + FROM pg_class + WHERE relname = ? AND relkind = 'S'", + array($sequencename))) { + $sequencename = false; + } + + return $sequencename; } - return $sequencename; -} - /** - * Given one object name and it's type (pk, uk, fk, ck, ix, uix, seq, trg) - * return if such name is currently in use (true) or no (false) - * (invoked from getNameForObject() + * Given one object name and it's type (pk, uk, fk, ck, ix, uix, seq, trg). + * + * (MySQL requires the whole xmldb_table object to be specified, so we add it always) + * + * This is invoked from getNameForObject(). + * Only some DB have this implemented. + * + * @param string $object_name The object's name to check for. + * @param string $type The object's type (pk, uk, fk, ck, ix, uix, seq, trg). + * @param string $table_name The table's name to check in + * @return bool If such name is currently in use (true) or no (false) */ public function isNameInUse($object_name, $type, $table_name) { switch($type) { @@ -406,10 +471,11 @@ function getSequenceFromDB($xmldb_table) { /** * Returns an array of reserved words (lowercase) for this DB + * @return array An array of database specific reserved words */ public static function getReservedWords() { - /// This file contains the reserved words for PostgreSQL databases - /// http://www.postgresql.org/docs/current/static/sql-keywords-appendix.html + // This file contains the reserved words for PostgreSQL databases + // http://www.postgresql.org/docs/current/static/sql-keywords-appendix.html $reserved_words = array ( 'all', 'analyse', 'analyze', 'and', 'any', 'array', 'as', 'asc', 'asymmetric', 'authorization', 'between', 'binary', 'both', 'case', diff --git a/lib/ddl/sql_generator.php b/lib/ddl/sql_generator.php index 4cc1eedb8b3..9157f1ebfeb 100644 --- a/lib/ddl/sql_generator.php +++ b/lib/ddl/sql_generator.php @@ -14,16 +14,13 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . - /** * This class represent the base generator class where all the needed functions to generate proper SQL are defined. * * The rest of classes will inherit, by default, the same logic. * Functions will be overridden as needed to generate correct SQL. * - * @package core - * @category ddl - * @subpackage ddl + * @package core_ddl * @copyright 1999 onwards Martin Dougiamas http://dougiamas.com * 2001-3001 Eloy Lafuente (stronk7) http://contiento.com * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later @@ -34,19 +31,17 @@ defined('MOODLE_INTERNAL') || die(); /** * Abstract sql generator class, base for all db specific implementations. * - * @package core - * @category ddl - * @subpackage ddl + * @package core_ddl * @copyright 1999 onwards Martin Dougiamas http://dougiamas.com * 2001-3001 Eloy Lafuente (stronk7) http://contiento.com * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ abstract class sql_generator { -/// Please, avoid editing this defaults in this base class! -/// It could change the behaviour of the rest of generators -/// that, by default, inherit this configuration. -/// To change any of them, do it in extended classes instead. + // Please, avoid editing this defaults in this base class! + // It could change the behaviour of the rest of generators + // that, by default, inherit this configuration. + // To change any of them, do it in extended classes instead. /** @var string Used to quote names. */ public $quote_string = '"'; @@ -55,10 +50,11 @@ abstract class sql_generator { public $statement_end = ';'; /** @var bool To decide if we want to quote all the names or only the reserved ones. */ - public $quote_all = false; + public $quote_all = false; /** @var bool To create all the integers as NUMBER(x) (also called DECIMAL, NUMERIC...). */ public $integer_to_number = false; + /** @var bool To create all the floats as NUMBER(x) (also called DECIMAL, NUMERIC...). */ public $float_to_number = false; @@ -70,16 +66,14 @@ abstract class sql_generator { /** @var bool To specify if the generator must use some DEFAULT clause to drop defaults.*/ public $drop_default_value_required = false; + /** @var string The DEFAULT clause required to drop defaults.*/ public $drop_default_value = ''; /** @var bool To decide if the default clause of each field must go after the null clause.*/ public $default_after_null = true; - /** - * @var bool To force the generator if NULL clauses must be specified. It shouldn't be necessary. - * note: some mssql drivers require them or everything is created as NOT NULL :-( - */ + /** @var bool To force the generator if NULL clauses must be specified. It shouldn't be necessary.*/ public $specify_nulls = false; /** @var string To force primary key names to one string (null=no force).*/ @@ -87,34 +81,31 @@ abstract class sql_generator { /** @var bool True if the generator builds primary keys.*/ public $primary_keys = true; + /** @var bool True if the generator builds unique keys.*/ public $unique_keys = false; + /** @var bool True if the generator builds foreign keys.*/ public $foreign_keys = false; - /** - * @var string Template to drop PKs. - * 'TABLENAME' and 'KEYNAME' will be replaced from this template. - */ + /** @var string Template to drop PKs. 'TABLENAME' and 'KEYNAME' will be replaced from this template.*/ public $drop_primary_key = 'ALTER TABLE TABLENAME DROP CONSTRAINT KEYNAME'; - /** - * @var string Template to drop UKs. - * 'TABLENAME' and 'KEYNAME' will be replaced from this template. - */ + /** @var string Template to drop UKs. 'TABLENAME' and 'KEYNAME' will be replaced from this template.*/ public $drop_unique_key = 'ALTER TABLE TABLENAME DROP CONSTRAINT KEYNAME'; - /** @var string Template to drop FKs. - * 'TABLENAME' and 'KEYNAME' will be replaced from this template. - */ + /** @var string Template to drop FKs. 'TABLENAME' and 'KEYNAME' will be replaced from this template.*/ public $drop_foreign_key = 'ALTER TABLE TABLENAME DROP CONSTRAINT KEYNAME'; /** @var bool True if the generator needs to add extra code to generate the sequence fields.*/ public $sequence_extra_code = true; + /** @var string The particular name for inline sequences in this generator.*/ public $sequence_name = 'auto_increment'; + /** @var string|bool Different name for small (4byte) sequences or false if same.*/ public $sequence_name_small = false; + /** * @var bool To avoid outputting the rest of the field specs, leaving only the name and the sequence_name returned. * @see getFieldSQL() @@ -136,9 +127,7 @@ abstract class sql_generator { /** @var int Maximum length for key/index/sequence/trigger/check names (keep 30 for all!).*/ public $names_max_length = 30; - /** @var string Characters to be used as concatenation operator. - * If not defined, MySQL CONCAT function will be used. - */ + /** @var string Characters to be used as concatenation operator. If not defined, MySQL CONCAT function will be used.*/ public $concat_character = '||'; /** @var string SQL sentence to rename one table, both 'OLDNAME' and 'NEWNAME' keywords are dynamically replaced.*/ @@ -179,6 +168,7 @@ abstract class sql_generator { /** @var moodle_database The moodle_database instance.*/ public $mdb; + /** @var Control existing temptables.*/ protected $temptables; @@ -207,6 +197,7 @@ abstract class sql_generator { * @see $statement_end * * @param array|string $input SQL statement(s). + * @return array|string */ public function getEndedStatements($input) { @@ -231,11 +222,11 @@ abstract class sql_generator { if (is_string($table)) { $tablename = $table; } else { - /// Calculate the name of the table + // Calculate the name of the table $tablename = $table->getName(); } - /// get all tables in moodle database + // get all tables in moodle database $tables = $this->mdb->get_tables(); $exists = in_array($tablename, $tables); @@ -244,10 +235,10 @@ abstract class sql_generator { /** * This function will return the SQL code needed to create db tables and statements. + * @see xmldb_structure * * @param xmldb_structure $xmldb_structure An xmldb_structure instance. - * - * @see xmldb_structure + * @return array */ public function getCreateStructureSQL($xmldb_structure) { $results = array(); @@ -272,10 +263,10 @@ abstract class sql_generator { * @return string The correct name of the table. */ public function getTableName(xmldb_table $xmldb_table, $quoted=true) { - /// Get the name + // Get the name $tablename = $this->prefix.$xmldb_table->getName(); - /// Apply quotes optionally + // Apply quotes optionally if ($quoted) { $tablename = $this->getEncQuoted($tablename); } @@ -298,7 +289,7 @@ abstract class sql_generator { $results = array(); //Array where all the sentences will be stored - /// Table header + // Table header $table = 'CREATE TABLE ' . $this->getTableName($xmldb_table) . ' ('; if (!$xmldb_fields = $xmldb_table->getFields()) { @@ -307,7 +298,7 @@ abstract class sql_generator { $sequencefield = null; - /// Add the fields, separated by commas + // Add the fields, separated by commas foreach ($xmldb_fields as $xmldb_field) { if ($xmldb_field->getSequence()) { $sequencefield = $xmldb_field->getName(); @@ -315,68 +306,69 @@ abstract class sql_generator { $table .= "\n " . $this->getFieldSQL($xmldb_table, $xmldb_field); $table .= ','; } - /// Add the keys, separated by commas + // Add the keys, separated by commas if ($xmldb_keys = $xmldb_table->getKeys()) { foreach ($xmldb_keys as $xmldb_key) { if ($keytext = $this->getKeySQL($xmldb_table, $xmldb_key)) { $table .= "\nCONSTRAINT " . $keytext . ','; } - /// If the key is XMLDB_KEY_FOREIGN_UNIQUE, create it as UNIQUE too + // If the key is XMLDB_KEY_FOREIGN_UNIQUE, create it as UNIQUE too if ($xmldb_key->getType() == XMLDB_KEY_FOREIGN_UNIQUE) { - ///Duplicate the key + //Duplicate the key $xmldb_key->setType(XMLDB_KEY_UNIQUE); if ($keytext = $this->getKeySQL($xmldb_table, $xmldb_key)) { $table .= "\nCONSTRAINT " . $keytext . ','; } } - /// make sure sequence field is unique + // make sure sequence field is unique if ($sequencefield and $xmldb_key->getType() == XMLDB_KEY_PRIMARY) { - $field = reset($xmldb_key->getFields()); + $fields = $xmldb_key->getFields(); + $field = reset($fields); if ($sequencefield === $field) { $sequencefield = null; } } } } - /// throw error if sequence field does not have unique key defined + // throw error if sequence field does not have unique key defined if ($sequencefield) { throw new ddl_exception('ddsequenceerror', $xmldb_table->getName()); } - /// Table footer, trim the latest comma + // Table footer, trim the latest comma $table = trim($table,','); $table .= "\n)"; - /// Add the CREATE TABLE to results + // Add the CREATE TABLE to results $results[] = $table; - /// Add comments if specified and it exists + // Add comments if specified and it exists if ($this->add_table_comments && $xmldb_table->getComment()) { $comment = $this->getCommentSQL($xmldb_table); - /// Add the COMMENT to results + // Add the COMMENT to results $results = array_merge($results, $comment); } - /// Add the indexes (each one, one statement) + // Add the indexes (each one, one statement) if ($xmldb_indexes = $xmldb_table->getIndexes()) { foreach ($xmldb_indexes as $xmldb_index) { - ///tables do not exist yet, which means indexed can not exist yet + //tables do not exist yet, which means indexed can not exist yet if ($indextext = $this->getCreateIndexSQL($xmldb_table, $xmldb_index)) { $results = array_merge($results, $indextext); } } } - /// Also, add the indexes needed from keys, based on configuration (each one, one statement) + // Also, add the indexes needed from keys, based on configuration (each one, one statement) if ($xmldb_keys = $xmldb_table->getKeys()) { foreach ($xmldb_keys as $xmldb_key) { - /// If we aren't creating the keys OR if the key is XMLDB_KEY_FOREIGN (not underlying index generated - /// automatically by the RDBMS) create the underlying (created by us) index (if doesn't exists) + // If we aren't creating the keys OR if the key is XMLDB_KEY_FOREIGN (not underlying index generated + // automatically by the RDBMS) create the underlying (created by us) index (if doesn't exists) if (!$this->getKeySQL($xmldb_table, $xmldb_key) || $xmldb_key->getType() == XMLDB_KEY_FOREIGN) { - /// Create the interim index + // Create the interim index $index = new xmldb_index('anyname'); $index->setFields($xmldb_key->getFields()); - ///tables do not exist yet, which means indexed can not exist yet + //tables do not exist yet, which means indexed can not exist yet $createindex = false; //By default switch ($xmldb_key->getType()) { case XMLDB_KEY_UNIQUE: @@ -391,7 +383,7 @@ abstract class sql_generator { } if ($createindex) { if ($indextext = $this->getCreateIndexSQL($xmldb_table, $index)) { - /// Add the INDEX to the array + // Add the INDEX to the array $results = array_merge($results, $indextext); } } @@ -399,14 +391,14 @@ abstract class sql_generator { } } - /// Add sequence extra code if needed + // Add sequence extra code if needed if ($this->sequence_extra_code) { - /// Iterate over fields looking for sequences + // Iterate over fields looking for sequences foreach ($xmldb_fields as $xmldb_field) { if ($xmldb_field->getSequence()) { - /// returns an array of statements needed to create one sequence + // returns an array of statements needed to create one sequence $sequence_sentences = $this->getCreateSequenceSQL($xmldb_table, $xmldb_field); - /// Add the SEQUENCE to the array + // Add the SEQUENCE to the array $results = array_merge($results, $sequence_sentences); } } @@ -467,13 +459,13 @@ abstract class sql_generator { $skip_notnull_clause = is_null($skip_notnull_clause) ? $this->alter_column_skip_notnull : $skip_notnull_clause; $specify_nulls_clause = is_null($specify_nulls_clause) ? $this->specify_nulls : $specify_nulls_clause; - /// First of all, convert integers to numbers if defined + // First of all, convert integers to numbers if defined if ($this->integer_to_number) { if ($xmldb_field->getType() == XMLDB_TYPE_INTEGER) { $xmldb_field->setType(XMLDB_TYPE_NUMBER); } } - /// Same for floats + // Same for floats if ($this->float_to_number) { if ($xmldb_field->getType() == XMLDB_TYPE_FLOAT) { $xmldb_field->setType(XMLDB_TYPE_NUMBER); @@ -481,19 +473,19 @@ abstract class sql_generator { } $field = ''; // Let's accumulate the whole expression based on params and settings - /// The name + // The name if ($specify_field_name) { $field .= $this->getEncQuoted($xmldb_field->getName()); } - /// The type and length only if we don't want to skip it + // The type and length only if we don't want to skip it if (!$skip_type_clause) { - /// The type and length + // The type and length $field .= ' ' . $this->getTypeSQL($xmldb_field->getType(), $xmldb_field->getLength(), $xmldb_field->getDecimals()); } - /// note: unsigned is not supported any more since moodle 2.3, all numbers are signed - /// Calculate the not null clause + // note: unsigned is not supported any more since moodle 2.3, all numbers are signed + // Calculate the not null clause $notnull = ''; - /// Only if we don't want to skip it + // Only if we don't want to skip it if (!$skip_notnull_clause) { if ($xmldb_field->getNotNull()) { $notnull = ' NOT NULL'; @@ -503,18 +495,18 @@ abstract class sql_generator { } } } - /// Calculate the default clause + // Calculate the default clause $default_clause = ''; if (!$skip_default_clause) { //Only if we don't want to skip it $default_clause = $this->getDefaultClause($xmldb_field); } - /// Based on default_after_null, set both clauses properly + // Based on default_after_null, set both clauses properly if ($this->default_after_null) { $field .= $notnull . $default_clause; } else { $field .= $default_clause . $notnull; } - /// The sequence + // The sequence if ($xmldb_field->getSequence()) { if($xmldb_field->getLength()<=9 && $this->sequence_name_small) { $sequencename=$this->sequence_name_small; @@ -523,8 +515,8 @@ abstract class sql_generator { } $field .= ' ' . $sequencename; if ($this->sequence_only) { - /// We only want the field name and sequence name to be printed - /// so, calculate it and return + // We only want the field name and sequence name to be printed + // so, calculate it and return $sql = $this->getEncQuoted($xmldb_field->getName()) . ' ' . $sequencename; return $sql; } @@ -596,15 +588,15 @@ abstract class sql_generator { $default = $xmldb_field->getDefault(); } } else { - /// We force default '' for not null char columns without proper default - /// some day this should be out! + // We force default '' for not null char columns without proper default + // some day this should be out! if ($this->default_for_char !== NULL && $xmldb_field->getType() == XMLDB_TYPE_CHAR && $xmldb_field->getNotNull()) { $default = "'" . $this->default_for_char . "'"; } else { - /// If the DB requires to explicity define some clause to drop one default, do it here - /// never applying defaults to TEXT and BINARY fields + // If the DB requires to explicity define some clause to drop one default, do it here + // never applying defaults to TEXT and BINARY fields if ($this->drop_default_value_required && $xmldb_field->getType() != XMLDB_TYPE_TEXT && $xmldb_field->getType() != XMLDB_TYPE_BINARY && !$xmldb_field->getNotNull()) { @@ -651,7 +643,7 @@ abstract class sql_generator { $results[] = $rename; - /// Call to getRenameTableExtraSQL() override if needed + // Call to getRenameTableExtraSQL() override if needed $extra_sentences = $this->getRenameTableExtraSQL($xmldb_table, $newname); $results = array_merge($results, $extra_sentences); @@ -673,7 +665,7 @@ abstract class sql_generator { $results[] = $drop; - /// call to getDropTableExtraSQL(), override if needed + // call to getDropTableExtraSQL(), override if needed $extra_sentences = $this->getDropTableExtraSQL($xmldb_table); $results = array_merge($results, $extra_sentences); @@ -698,15 +690,15 @@ abstract class sql_generator { $results = array(); - /// Get the quoted name of the table and field + // Get the quoted name of the table and field $tablename = $this->getTableName($xmldb_table); - /// Build the standard alter table add + // Build the standard alter table add $sql = $this->getFieldSQL($xmldb_table, $xmldb_field, $skip_type_clause, $skip_default_clause, $skip_notnull_clause); $altertable = 'ALTER TABLE ' . $tablename . ' ADD ' . $sql; - /// Add the after clause if necesary + // Add the after clause if necessary if ($this->add_after_clause && $xmldb_field->getPrevious()) { $altertable .= ' AFTER ' . $this->getEncQuoted($xmldb_field->getPrevious()); } @@ -726,11 +718,11 @@ abstract class sql_generator { $results = array(); - /// Get the quoted name of the table and field + // Get the quoted name of the table and field $tablename = $this->getTableName($xmldb_table); $fieldname = $this->getEncQuoted($xmldb_field->getName()); - /// Build the standard alter table drop + // Build the standard alter table drop $results[] = 'ALTER TABLE ' . $tablename . ' DROP COLUMN ' . $fieldname; return $results; @@ -754,11 +746,11 @@ abstract class sql_generator { $results = array(); - /// Get the quoted name of the table and field + // Get the quoted name of the table and field $tablename = $this->getTableName($xmldb_table); $fieldname = $this->getEncQuoted($xmldb_field->getName()); - /// Build de alter sentence using the alter_column_sql template + // Build de alter sentence using the alter_column_sql template $alter = str_replace('TABLENAME', $this->getTableName($xmldb_table), $this->alter_column_sql); $colspec = $this->getFieldSQL($xmldb_table, $xmldb_field, $skip_type_clause, $skip_default_clause, @@ -766,12 +758,12 @@ abstract class sql_generator { true); $alter = str_replace('COLUMNSPECS', $colspec, $alter); - /// Add the after clause if necesary + // Add the after clause if necessary if ($this->add_after_clause && $xmldb_field->getPrevious()) { $alter .= ' after ' . $this->getEncQuoted($xmldb_field->getPrevious()); } - /// Build the standard alter table modify + // Build the standard alter table modify $results[] = $alter; return $results; @@ -788,11 +780,11 @@ abstract class sql_generator { $results = array(); - /// Get the quoted name of the table and field + // Get the quoted name of the table and field $tablename = $this->getTableName($xmldb_table); $fieldname = $this->getEncQuoted($xmldb_field->getName()); - /// Decide if we are going to create/modify or to drop the default + // Decide if we are going to create/modify or to drop the default if ($xmldb_field->getDefault() === null) { $results = $this->getDropDefaultSQL($xmldb_table, $xmldb_field); //Drop } else { @@ -815,13 +807,13 @@ abstract class sql_generator { $results = array(); //Array where all the sentences will be stored - /// Although this is checked in database_manager::rename_field() - double check - /// that we aren't trying to rename one "id" field. Although it could be - /// implemented (if adding the necessary code to rename sequences, defaults, - /// triggers... and so on under each getRenameFieldExtraSQL() function, it's - /// better to forbid it, mainly because this field is the default PK and - /// in the future, a lot of FKs can be pointing here. So, this field, more - /// or less, must be considered immutable! + // Although this is checked in database_manager::rename_field() - double check + // that we aren't trying to rename one "id" field. Although it could be + // implemented (if adding the necessary code to rename sequences, defaults, + // triggers... and so on under each getRenameFieldExtraSQL() function, it's + // better to forbid it, mainly because this field is the default PK and + // in the future, a lot of FKs can be pointing here. So, this field, more + // or less, must be considered immutable! if ($xmldb_field->getName() == 'id') { return array(); } @@ -832,7 +824,7 @@ abstract class sql_generator { $results[] = $rename; - /// Call to getRenameFieldExtraSQL(), override if needed + // Call to getRenameFieldExtraSQL(), override if needed $extra_sentences = $this->getRenameFieldExtraSQL($xmldb_table, $xmldb_field, $newname); $results = array_merge($results, $extra_sentences); @@ -851,18 +843,18 @@ abstract class sql_generator { $results = array(); - /// Just use the CreateKeySQL function + // Just use the CreateKeySQL function if ($keyclause = $this->getKeySQL($xmldb_table, $xmldb_key)) { $key = 'ALTER TABLE ' . $this->getTableName($xmldb_table) . ' ADD CONSTRAINT ' . $keyclause; $results[] = $key; } - /// If we aren't creating the keys OR if the key is XMLDB_KEY_FOREIGN (not underlying index generated - /// automatically by the RDBMS) create the underlying (created by us) index (if doesn't exists) + // If we aren't creating the keys OR if the key is XMLDB_KEY_FOREIGN (not underlying index generated + // automatically by the RDBMS) create the underlying (created by us) index (if doesn't exists) if (!$keyclause || $xmldb_key->getType() == XMLDB_KEY_FOREIGN) { - /// Only if they don't exist - if ($xmldb_key->getType() == XMLDB_KEY_FOREIGN) { ///Calculate type of index based on type ok key + // Only if they don't exist + if ($xmldb_key->getType() == XMLDB_KEY_FOREIGN) { //Calculate type of index based on type ok key $indextype = XMLDB_INDEX_NOTUNIQUE; } else { $indextype = XMLDB_INDEX_UNIQUE; @@ -873,14 +865,14 @@ abstract class sql_generator { } } - /// If the key is XMLDB_KEY_FOREIGN_UNIQUE, create it as UNIQUE too + // If the key is XMLDB_KEY_FOREIGN_UNIQUE, create it as UNIQUE too if ($xmldb_key->getType() == XMLDB_KEY_FOREIGN_UNIQUE && $this->unique_keys) { - ///Duplicate the key + //Duplicate the key $xmldb_key->setType(XMLDB_KEY_UNIQUE); $results = array_merge($results, $this->getAddKeySQL($xmldb_table, $xmldb_key)); } - /// Return results + // Return results return $results; } @@ -895,14 +887,14 @@ abstract class sql_generator { $results = array(); - /// Get the key name (note that this doesn't introspect DB, so could cause some problems sometimes!) - /// TODO: We'll need to overwrite the whole getDropKeySQL() method inside each DB to do the proper queries - /// against the dictionary or require ADOdb to support it or change the find_key_name() method to - /// perform DB introspection directly. But, for now, as we aren't going to enable referential integrity - /// it won't be a problem at all + // Get the key name (note that this doesn't introspect DB, so could cause some problems sometimes!) + // TODO: We'll need to overwrite the whole getDropKeySQL() method inside each DB to do the proper queries + // against the dictionary or require ADOdb to support it or change the find_key_name() method to + // perform DB introspection directly. But, for now, as we aren't going to enable referential integrity + // it won't be a problem at all $dbkeyname = $this->mdb->get_manager()->find_key_name($xmldb_table, $xmldb_key); - /// Only if such type of key generation is enabled + // Only if such type of key generation is enabled $dropkey = false; switch ($xmldb_key->getType()) { case XMLDB_KEY_PRIMARY: @@ -925,33 +917,33 @@ abstract class sql_generator { } break; } - /// If we have decided to drop the key, let's do it + // If we have decided to drop the key, let's do it if ($dropkey) { - /// Replace TABLENAME, CONSTRAINTTYPE and KEYNAME as needed + // Replace TABLENAME, CONSTRAINTTYPE and KEYNAME as needed $dropsql = str_replace('TABLENAME', $this->getTableName($xmldb_table), $template); $dropsql = str_replace('KEYNAME', $dbkeyname, $dropsql); $results[] = $dropsql; } - /// If we aren't dropping the keys OR if the key is XMLDB_KEY_FOREIGN (not underlying index generated - /// automatically by the RDBMS) drop the underlying (created by us) index (if exists) + // If we aren't dropping the keys OR if the key is XMLDB_KEY_FOREIGN (not underlying index generated + // automatically by the RDBMS) drop the underlying (created by us) index (if exists) if (!$dropkey || $xmldb_key->getType() == XMLDB_KEY_FOREIGN) { - /// Only if they exist + // Only if they exist $xmldb_index = new xmldb_index('anyname', XMLDB_INDEX_UNIQUE, $xmldb_key->getFields()); if ($this->mdb->get_manager()->index_exists($xmldb_table, $xmldb_index)) { $results = array_merge($results, $this->getDropIndexSQL($xmldb_table, $xmldb_index)); } } - /// If the key is XMLDB_KEY_FOREIGN_UNIQUE, drop the UNIQUE too + // If the key is XMLDB_KEY_FOREIGN_UNIQUE, drop the UNIQUE too if ($xmldb_key->getType() == XMLDB_KEY_FOREIGN_UNIQUE && $this->unique_keys) { - ///Duplicate the key + //Duplicate the key $xmldb_key->setType(XMLDB_KEY_UNIQUE); $results = array_merge($results, $this->getDropKeySQL($xmldb_table, $xmldb_key)); } - /// Return results + // Return results return $results; } @@ -968,27 +960,27 @@ abstract class sql_generator { $results = array(); - /// Get the real key name + // Get the real key name $dbkeyname = $this->mdb->get_manager()->find_key_name($xmldb_table, $xmldb_key); - /// Check we are really generating this type of keys + // Check we are really generating this type of keys if (($xmldb_key->getType() == XMLDB_KEY_PRIMARY && !$this->primary_keys) || ($xmldb_key->getType() == XMLDB_KEY_UNIQUE && !$this->unique_keys) || ($xmldb_key->getType() == XMLDB_KEY_FOREIGN && !$this->foreign_keys) || ($xmldb_key->getType() == XMLDB_KEY_FOREIGN_UNIQUE && !$this->unique_keys && !$this->foreign_keys)) { - /// We aren't generating this type of keys, delegate to child indexes + // We aren't generating this type of keys, delegate to child indexes $xmldb_index = new xmldb_index($xmldb_key->getName()); $xmldb_index->setFields($xmldb_key->getFields()); return $this->getRenameIndexSQL($xmldb_table, $xmldb_index, $newname); } - /// Arrived here so we are working with keys, lets rename them - /// Replace TABLENAME and KEYNAME as needed + // Arrived here so we are working with keys, lets rename them + // Replace TABLENAME and KEYNAME as needed $renamesql = str_replace('TABLENAME', $this->getTableName($xmldb_table), $this->rename_key_sql); $renamesql = str_replace('OLDKEYNAME', $dbkeyname, $renamesql); $renamesql = str_replace('NEWKEYNAME', $newname, $renamesql); - /// Some DB doesn't support key renaming so this can be empty + // Some DB doesn't support key renaming so this can be empty if ($renamesql) { $results[] = $renamesql; } @@ -1005,7 +997,7 @@ abstract class sql_generator { */ public function getAddIndexSQL($xmldb_table, $xmldb_index) { - /// Just use the CreateIndexSQL function + // Just use the CreateIndexSQL function return $this->getCreateIndexSQL($xmldb_table, $xmldb_index); } @@ -1020,10 +1012,10 @@ abstract class sql_generator { $results = array(); - /// Get the real index name + // Get the real index name $dbindexname = $this->mdb->get_manager()->find_index_name($xmldb_table, $xmldb_index); - /// Replace TABLENAME and INDEXNAME as needed + // Replace TABLENAME and INDEXNAME as needed $dropsql = str_replace('TABLENAME', $this->getTableName($xmldb_table), $this->drop_index_sql); $dropsql = str_replace('INDEXNAME', $this->getEncQuoted($dbindexname), $dropsql); @@ -1042,14 +1034,14 @@ abstract class sql_generator { * @return array An array of SQL statements to rename the index. */ function getRenameIndexSQL($xmldb_table, $xmldb_index, $newname) { - /// Some DB doesn't support index renaming (MySQL) so this can be empty + // Some DB doesn't support index renaming (MySQL) so this can be empty if (empty($this->rename_index_sql)) { return array(); } - /// Get the real index name + // Get the real index name $dbindexname = $this->mdb->get_manager()->find_index_name($xmldb_table, $xmldb_index); - /// Replace TABLENAME and INDEXNAME as needed + // Replace TABLENAME and INDEXNAME as needed $renamesql = str_replace('TABLENAME', $this->getTableName($xmldb_table), $this->rename_index_sql); $renamesql = str_replace('OLDINDEXNAME', $this->getEncQuoted($dbindexname), $renamesql); $renamesql = str_replace('NEWINDEXNAME', $this->getEncQuoted($newname), $renamesql); @@ -1073,14 +1065,14 @@ abstract class sql_generator { $name = ''; - /// Implement one basic cache to avoid object name duplication - /// along all the request life, but never to return cached results - /// We need this because sql statements are created before executing - /// them, hence names doesn't exist "physically" yet in DB, so we need - /// to known which ones have been used + // Implement one basic cache to avoid object name duplication + // along all the request life, but never to return cached results + // We need this because sql statements are created before executing + // them, hence names doesn't exist "physically" yet in DB, so we need + // to known which ones have been used static $used_names = array(); - /// Use standard naming. See http://docs.moodle.org/en/XMLDB_key_and_index_naming + // Use standard naming. See http://docs.moodle.org/en/XMLDB_key_and_index_naming $tablearr = explode ('_', $tablename); foreach ($tablearr as $table) { $name .= substr(trim($table),0,4); @@ -1090,24 +1082,24 @@ abstract class sql_generator { foreach ($fieldsarr as $field) { $name .= substr(trim($field),0,3); } - /// Prepend the prefix + // Prepend the prefix $name = $this->prefix . $name; $name = substr(trim($name), 0, $this->names_max_length - 1 - strlen($suffix)); //Max names_max_length - /// Add the suffix + // Add the suffix $namewithsuffix = $name; if ($suffix) { $namewithsuffix = $namewithsuffix . '_' . $suffix; } - /// If the calculated name is in the cache, or if we detect it by introspecting the DB let's modify if + // If the calculated name is in the cache, or if we detect it by introspecting the DB let's modify if if (in_array($namewithsuffix, $used_names) || $this->isNameInUse($namewithsuffix, $suffix, $tablename)) { $counter = 2; - /// If have free space, we add 2 + // If have free space, we add 2 if (strlen($namewithsuffix) < $this->names_max_length) { $newname = $name . $counter; - /// Else replace the last char by 2 + // Else replace the last char by 2 } else { $newname = substr($name, 0, strlen($name)-1) . $counter; } @@ -1115,7 +1107,7 @@ abstract class sql_generator { if ($suffix) { $newnamewithsuffix = $newnamewithsuffix . '_' . $suffix; } - /// Now iterate until not used name is found, incrementing the counter + // Now iterate until not used name is found, incrementing the counter while (in_array($newnamewithsuffix, $used_names) || $this->isNameInUse($newnamewithsuffix, $suffix, $tablename)) { $counter++; $newname = substr($name, 0, strlen($newname)-1) . $counter; @@ -1127,10 +1119,10 @@ abstract class sql_generator { $namewithsuffix = $newnamewithsuffix; } - /// Add the name to the cache + // Add the name to the cache $used_names[] = $namewithsuffix; - /// Quote it if necessary (reserved words) + // Quote it if necessary (reserved words) $namewithsuffix = $this->getEncQuoted($namewithsuffix); return $namewithsuffix; @@ -1141,7 +1133,7 @@ abstract class sql_generator { * if it's a reserved word * * @param string|array $input String to quote. - * @return Quoted string. + * @return string Quoted string. */ public function getEncQuoted($input) { @@ -1151,9 +1143,9 @@ abstract class sql_generator { } return $input; } else { - /// Always lowercase + // Always lowercase $input = strtolower($input); - /// if reserved or quote_all or has hyphens, quote it + // if reserved or quote_all or has hyphens, quote it if ($this->quote_all || in_array($input, $this->reserved_words) || strpos($input, '-') !== false) { $input = $this->quote_string . $input . $this->quote_string; } @@ -1173,39 +1165,39 @@ abstract class sql_generator { if ($sentences = $statement->getSentences()) { foreach ($sentences as $sentence) { - /// Get the list of fields + // Get the list of fields $fields = $statement->getFieldsFromInsertSentence($sentence); - /// Get the values of fields + // Get the values of fields $values = $statement->getValuesFromInsertSentence($sentence); - /// Look if we have some CONCAT value and transform it dynamically + // Look if we have some CONCAT value and transform it dynamically foreach($values as $key => $value) { - /// Trim single quotes + // Trim single quotes $value = trim($value,"'"); if (stristr($value, 'CONCAT') !== false){ - /// Look for data between parenthesis + // Look for data between parenthesis preg_match("/CONCAT\s*\((.*)\)$/is", trim($value), $matches); if (isset($matches[1])) { $part = $matches[1]; - /// Convert the comma separated string to an array + // Convert the comma separated string to an array $arr = xmldb_object::comma2array($part); if ($arr) { $value = $this->getConcatSQL($arr); } } } - /// Values to be sent to DB must be properly escaped + // Values to be sent to DB must be properly escaped $value = $this->addslashes($value); - /// Back trimmed quotes + // Back trimmed quotes $value = "'" . $value . "'"; - /// Back to the array + // Back to the array $values[$key] = $value; } - /// Iterate over fields, escaping them if necessary + // Iterate over fields, escaping them if necessary foreach($fields as $key => $field) { $fields[$key] = $this->getEncQuoted($field); } - /// Build the final SQL sentence and add it to the array of results + // Build the final SQL sentence and add it to the array of results $sql = 'INSERT INTO ' . $this->getEncQuoted($this->prefix . $statement->getTable()) . '(' . implode(', ', $fields) . ') ' . 'VALUES (' . implode(', ', $values) . ')'; @@ -1228,7 +1220,7 @@ abstract class sql_generator { */ public function getConcatSQL($elements) { - /// Replace double quoted elements by single quotes + // Replace double quoted elements by single quotes foreach($elements as $key => $element) { $element = trim($element); if (substr($element, 0, 1) == '"' && @@ -1237,7 +1229,7 @@ abstract class sql_generator { } } - /// Now call the standard $DB->sql_concat() DML function + // Now call the standard $DB->sql_concat() DML function return call_user_func_array(array($this->mdb, 'sql_concat'), $elements); } @@ -1271,22 +1263,22 @@ abstract class sql_generator { } -/// ALL THESE FUNCTION MUST BE CUSTOMISED BY ALL THE XMLDGenerator classes +// ====== FOLLOWING FUNCTION MUST BE CUSTOMISED BY ALL THE XMLDGenerator classes ======== /** * Reset a sequence to the id field of a table. * - * @param string $tablename name of table. - * @return success + * @param xmldb_table|string $table name of table or the table object. + * @return array of sql statements */ - public abstract function getResetSequenceSQL($tablename); + public abstract function getResetSequenceSQL($table); /** * Given one correct xmldb_table, returns the SQL statements * to create temporary table (inside one array). * * @param xmldb_table $xmldb_table The xmldb_table object instance. - * @return array SQL statements. + * @return array of sql statements */ abstract public function getCreateTempTableSQL($xmldb_table); @@ -1360,6 +1352,7 @@ abstract class sql_generator { * * @param xmldb_table $xmldb_table The xmldb_table object instance. * @param xmldb_field $xmldb_field The xmldb_field object instance. + * @return array Array of SQL statements to create a field's default. * * @todo MDL-31147 Moodle 2.1 - Drop getDropDefaultSQL() */ diff --git a/lib/ddl/sqlite_sql_generator.php b/lib/ddl/sqlite_sql_generator.php index e10b24a869b..c0b088cfbbd 100644 --- a/lib/ddl/sqlite_sql_generator.php +++ b/lib/ddl/sqlite_sql_generator.php @@ -1,5 +1,4 @@ . - /** * Experimental SQLite specific SQL code generator. * - * @package core - * @subpackage ddl_generator + * @package core_ddl * @copyright 2008 Andrei Bautu * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -37,31 +34,41 @@ class sqlite_sql_generator extends sql_generator { /// Only set values that are different from the defaults present in XMLDBgenerator - public $drop_default_value_required = true; //To specify if the generator must use some DEFAULT clause to drop defaults - public $drop_default_value = NULL; //The DEFAULT clause required to drop defaults + /** @var bool To specify if the generator must use some DEFAULT clause to drop defaults.*/ + public $drop_default_value_required = true; - public $drop_primary_key = 'ALTER TABLE TABLENAME DROP PRIMARY KEY'; // Template to drop PKs - // with automatic replace for TABLENAME and KEYNAME + /** @var string The DEFAULT clause required to drop defaults.*/ + public $drop_default_value = NULL; - public $drop_unique_key = 'ALTER TABLE TABLENAME DROP KEY KEYNAME'; // Template to drop UKs - // with automatic replace for TABLENAME and KEYNAME + /** @var string Template to drop PKs. 'TABLENAME' and 'KEYNAME' will be replaced from this template.*/ + public $drop_primary_key = 'ALTER TABLE TABLENAME DROP PRIMARY KEY'; - public $drop_foreign_key = 'ALTER TABLE TABLENAME DROP FOREIGN KEY KEYNAME'; // Template to drop FKs - // with automatic replace for TABLENAME and KEYNAME - public $default_for_char = ''; // To define the default to set for NOT NULLs CHARs without default (null=do nothing) + /** @var string Template to drop UKs. 'TABLENAME' and 'KEYNAME' will be replaced from this template.*/ + public $drop_unique_key = 'ALTER TABLE TABLENAME DROP KEY KEYNAME'; - public $sequence_only = true; //To avoid to output the rest of the field specs, leaving only the name and the sequence_name publiciable - public $sequence_extra_code = false; //Does the generator need to add extra code to generate the sequence fields - public $sequence_name = 'INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL'; //Particular name for inline sequences in this generator + /** @var string Template to drop FKs. 'TABLENAME' and 'KEYNAME' will be replaced from this template.*/ + public $drop_foreign_key = 'ALTER TABLE TABLENAME DROP FOREIGN KEY KEYNAME'; - public $drop_index_sql = 'ALTER TABLE TABLENAME DROP INDEX INDEXNAME'; //SQL sentence to drop one index - //TABLENAME, INDEXNAME are dynamically replaced + /** @var string To define the default to set for NOT NULLs CHARs without default (null=do nothing).*/ + public $default_for_char = ''; - public $rename_index_sql = null; //SQL sentence to rename one index (MySQL doesn't support this!) - //TABLENAME, OLDINDEXNAME, NEWINDEXNAME are dynamically replaced + /** @var bool To avoid outputting the rest of the field specs, leaving only the name and the sequence_name returned.*/ + public $sequence_only = true; - public $rename_key_sql = null; //SQL sentence to rename one key (MySQL doesn't support this!) - //TABLENAME, OLDKEYNAME, NEWKEYNAME are dynamically replaced + /** @var bool True if the generator needs to add extra code to generate the sequence fields.*/ + public $sequence_extra_code = false; + + /** @var string The particular name for inline sequences in this generator.*/ + public $sequence_name = 'INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL'; + + /** @var string SQL sentence to drop one index where 'TABLENAME', 'INDEXNAME' keywords are dynamically replaced.*/ + public $drop_index_sql = 'ALTER TABLE TABLENAME DROP INDEX INDEXNAME'; + + /** @var string SQL sentence to rename one index where 'TABLENAME', 'OLDINDEXNAME' and 'NEWINDEXNAME' are dynamically replaced.*/ + public $rename_index_sql = null; + + /** @var string SQL sentence to rename one key 'TABLENAME', 'OLDKEYNAME' and 'NEWKEYNAME' are dynamically replaced.*/ + public $rename_key_sql = null; /** * Creates one new XMLDBmysql @@ -72,8 +79,9 @@ class sqlite_sql_generator extends sql_generator { /** * Reset a sequence to the id field of a table. - * @param string $table name of table or xmldb_object - * @return bool success + * + * @param xmldb_table|string $table name of table or the table object. + * @return array of sql statements */ public function getResetSequenceSQL($table) { @@ -125,7 +133,12 @@ class sqlite_sql_generator extends sql_generator { } /** - * Given one XMLDB Type, length and decimals, returns the DB proper SQL type + * Given one XMLDB Type, length and decimals, returns the DB proper SQL type. + * + * @param int $xmldb_type The xmldb_type defined constant. XMLDB_TYPE_INTEGER and other XMLDB_TYPE_* constants. + * @param int $xmldb_length The length of that data type. + * @param int $xmldb_decimals The decimal places of precision of the data type. + * @return string The DB defined data type. */ public function getTypeSQL($xmldb_type, $xmldb_length=null, $xmldb_decimals=null) { @@ -263,7 +276,14 @@ class sqlite_sql_generator extends sql_generator { } /** - * Given one xmldb_table and one xmldb_field, return the SQL statements needed to alter the field in the table + * Given one xmldb_table and one xmldb_field, return the SQL statements needed to alter the field in the table. + * + * @param xmldb_table $xmldb_table The table related to $xmldb_field. + * @param xmldb_field $xmldb_field The instance of xmldb_field to create the SQL from. + * @param string $skip_type_clause The type clause on alter columns, NULL by default. + * @param string $skip_default_clause The default clause on alter columns, NULL by default. + * @param string $skip_notnull_clause The null/notnull clause on alter columns, NULL by default. + * @return string The field altering SQL statement. */ public function getAlterFieldSQL($xmldb_table, $xmldb_field, $skip_type_clause = NULL, $skip_default_clause = NULL, $skip_notnull_clause = NULL) { return $this->getAlterTableSchema($xmldb_table, $xmldb_field, $xmldb_field); @@ -279,8 +299,12 @@ class sqlite_sql_generator extends sql_generator { } /** - * Given one xmldb_table and one xmldb_field, return the SQL statements needed to create its default + * Given one xmldb_table and one xmldb_field, return the SQL statements needed to add its default * (usually invoked from getModifyDefaultSQL() + * + * @param xmldb_table $xmldb_table The xmldb_table object instance. + * @param xmldb_field $xmldb_field The xmldb_field object instance. + * @return array Array of SQL statements to create a field's default. */ public function getCreateDefaultSQL($xmldb_table, $xmldb_field) { return $this->getAlterTableSchema($xmldb_table, $xmldb_field, $xmldb_field); @@ -288,8 +312,12 @@ class sqlite_sql_generator extends sql_generator { /** * Given one correct xmldb_field and the new name, returns the SQL statements - * to rename it (inside one array) - * SQLite is pretty different from the standard to justify this overloading + * to rename it (inside one array). + * + * @param xmldb_table $xmldb_table The table related to $xmldb_field. + * @param xmldb_field $xmldb_field The instance of xmldb_field to get the renamed field from. + * @param string $newname The new name to rename the field to. + * @return array The SQL statements for renaming the field. */ public function getRenameFieldSQL($xmldb_table, $xmldb_field, $newname) { $oldfield = clone($xmldb_field); @@ -321,7 +349,11 @@ class sqlite_sql_generator extends sql_generator { } /** - * Given one xmldb_table and one xmldb_field, return the SQL statements needed to drop the field from the table + * Given one xmldb_table and one xmldb_field, return the SQL statements needed to drop the field from the table. + * + * @param xmldb_table $xmldb_table The table related to $xmldb_field. + * @param xmldb_field $xmldb_field The instance of xmldb_field to create the SQL from. + * @return array The SQL statement for dropping a field from the table. */ public function getDropFieldSQL($xmldb_table, $xmldb_field) { return $this->getAlterTableSchema($xmldb_table, NULL, $xmldb_field); @@ -346,31 +378,50 @@ class sqlite_sql_generator extends sql_generator { /** * Given one xmldb_table and one xmldb_field, return the SQL statements needed to drop its default * (usually invoked from getModifyDefaultSQL() + * + * Note that this method may be dropped in future. + * + * @param xmldb_table $xmldb_table The xmldb_table object instance. + * @param xmldb_field $xmldb_field The xmldb_field object instance. + * @return array Array of SQL statements to create a field's default. + * + * @todo MDL-31147 Moodle 2.1 - Drop getDropDefaultSQL() */ public function getDropDefaultSQL($xmldb_table, $xmldb_field) { return $this->getAlterTableSchema($xmldb_table, $xmldb_field, $xmldb_field); } /** - * Returns the code (in array) needed to add one comment to the table + * Returns the code (array of statements) needed to add one comment to the table. + * + * @param xmldb_table $xmldb_table The xmldb_table object instance. + * @return array Array of SQL statements to add one comment to the table. */ function getCommentSQL ($xmldb_table) { return array(); } /** - * Given one object name and it's type (pk, uk, fk, ck, ix, uix, seq, trg) - * return if such name is currently in use (true) or no (false) - * (invoked from getNameForObject() + * Given one object name and it's type (pk, uk, fk, ck, ix, uix, seq, trg). + * + * (MySQL requires the whole xmldb_table object to be specified, so we add it always) + * + * This is invoked from getNameForObject(). + * Only some DB have this implemented. + * + * @param string $object_name The object's name to check for. + * @param string $type The object's type (pk, uk, fk, ck, ix, uix, seq, trg). + * @param string $table_name The table's name to check in + * @return bool If such name is currently in use (true) or no (false) */ public function isNameInUse($object_name, $type, $table_name) { // TODO: add introspection code return false; //No name in use found } - /** * Returns an array of reserved words (lowercase) for this DB + * @return array An array of database specific reserved words */ public static function getReservedWords() { /// From http://www.sqlite.org/lang_keywords.html @@ -399,6 +450,11 @@ class sqlite_sql_generator extends sql_generator { return $reserved_words; } + /** + * Adds slashes to string. + * @param string $s + * @return string The escaped string. + */ public function addslashes($s) { // do not use php addslashes() because it depends on PHP quote settings! $s = str_replace("'", "''", $s); diff --git a/lib/ddl/tests/ddl_test.php b/lib/ddl/tests/ddl_test.php index 352202f4190..19f30a65c60 100644 --- a/lib/ddl/tests/ddl_test.php +++ b/lib/ddl/tests/ddl_test.php @@ -17,8 +17,7 @@ /** * DDL layer tests * - * @package core - * @subpackage ddl + * @package core_ddl * @category phpunit * @copyright 2008 Nicolas Connault * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later @@ -646,7 +645,7 @@ class ddl_testcase extends database_driver_testcase { // fill the table with some records before adding fields $this->fill_deftable('test_table1'); - /// add one not null field without specifying default value (throws ddl_exception) + // add one not null field without specifying default value (throws ddl_exception) $field = new xmldb_field('onefield'); $field->set_attributes(XMLDB_TYPE_INTEGER, '6', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null); try { @@ -656,7 +655,7 @@ class ddl_testcase extends database_driver_testcase { $this->assertTrue($e instanceof ddl_exception); } - /// add one existing field (throws ddl_exception) + // add one existing field (throws ddl_exception) $field = new xmldb_field('course'); $field->set_attributes(XMLDB_TYPE_INTEGER, '6', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, 2); try { @@ -670,7 +669,7 @@ class ddl_testcase extends database_driver_testcase { // TODO: add one text field with default, must throw exception // TODO: add one binary field with default, must throw exception - /// add one integer field and check it + // add one integer field and check it $field = new xmldb_field('oneinteger'); $field->set_attributes(XMLDB_TYPE_INTEGER, '6', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, 2); $dbman->add_field($table, $field); @@ -686,7 +685,7 @@ class ddl_testcase extends database_driver_testcase { $this->assertEquals($columns['oneinteger']->meta_type ,'I'); $this->assertEquals($DB->get_field('test_table1', 'oneinteger', array(), IGNORE_MULTIPLE), 2); //check default has been applied - /// add one numeric field and check it + // add one numeric field and check it $field = new xmldb_field('onenumber'); $field->set_attributes(XMLDB_TYPE_NUMBER, '6,3', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, 2.55); $dbman->add_field($table, $field); @@ -703,7 +702,7 @@ class ddl_testcase extends database_driver_testcase { $this->assertEquals($columns['onenumber']->meta_type ,'N'); $this->assertEquals($DB->get_field('test_table1', 'onenumber', array(), IGNORE_MULTIPLE), 2.550); //check default has been applied - /// add one float field and check it (not official type - must work as number) + // add one float field and check it (not official type - must work as number) $field = new xmldb_field('onefloat'); $field->set_attributes(XMLDB_TYPE_FLOAT, '6,3', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, 3.550); $dbman->add_field($table, $field); @@ -723,7 +722,7 @@ class ddl_testcase extends database_driver_testcase { // this isn't a real problem at all. $this->assertEquals(round($DB->get_field('test_table1', 'onefloat', array(), IGNORE_MULTIPLE), 7), 3.550); //check default has been applied - /// add one char field and check it + // add one char field and check it $field = new xmldb_field('onechar'); $field->set_attributes(XMLDB_TYPE_CHAR, '25', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, 'Nice dflt!'); $dbman->add_field($table, $field); @@ -740,7 +739,7 @@ class ddl_testcase extends database_driver_testcase { $this->assertEquals($columns['onechar']->meta_type ,'C'); $this->assertEquals($DB->get_field('test_table1', 'onechar', array(), IGNORE_MULTIPLE), 'Nice dflt!'); //check default has been applied - /// add one big text field and check it + // add one big text field and check it $field = new xmldb_field('onetext'); $field->set_attributes(XMLDB_TYPE_TEXT, 'big'); $dbman->add_field($table, $field); @@ -756,21 +755,21 @@ class ddl_testcase extends database_driver_testcase { $this->assertEquals($columns['onetext']->default_value, null); $this->assertEquals($columns['onetext']->meta_type ,'X'); - /// add one medium text field and check it + // add one medium text field and check it $field = new xmldb_field('mediumtext'); $field->set_attributes(XMLDB_TYPE_TEXT, 'medium'); $dbman->add_field($table, $field); $columns = $DB->get_columns('test_table1'); $this->assertTrue(($columns['mediumtext']->max_length == -1) or ($columns['mediumtext']->max_length >= 16777215)); // -1 means unknown or big - /// add one small text field and check it + // add one small text field and check it $field = new xmldb_field('smalltext'); $field->set_attributes(XMLDB_TYPE_TEXT, 'small'); $dbman->add_field($table, $field); $columns = $DB->get_columns('test_table1'); $this->assertTrue(($columns['smalltext']->max_length == -1) or ($columns['smalltext']->max_length >= 65535)); // -1 means unknown or big - /// add one binary field and check it + // add one binary field and check it $field = new xmldb_field('onebinary'); $field->set_attributes(XMLDB_TYPE_BINARY); $dbman->add_field($table, $field); @@ -1234,6 +1233,7 @@ class ddl_testcase extends database_driver_testcase { $index = new xmldb_index('secondname'); $index->set_attributes(XMLDB_INDEX_NOTUNIQUE, array('course', 'name')); $dbman->add_index($table, $index); + $this->assertTrue($dbman->index_exists($table, $index)); } public function testFindIndexName() { @@ -1292,6 +1292,9 @@ class ddl_testcase extends database_driver_testcase { $key = new xmldb_key('id-course-grade'); $key->set_attributes(XMLDB_KEY_UNIQUE, array('id', 'course', 'grade')); $dbman->add_key($table, $key); + + // No easy way to test it, this just makes sure no errors are encountered. + $this->assertTrue(true); } public function testAddForeignUniqueKey() { @@ -1303,6 +1306,9 @@ class ddl_testcase extends database_driver_testcase { $key = new xmldb_key('course'); $key->set_attributes(XMLDB_KEY_FOREIGN_UNIQUE, array('course'), 'test_table0', array('id')); $dbman->add_key($table, $key); + + // No easy way to test it, this just makes sure no errors are encountered. + $this->assertTrue(true); } public function testDropKey() { @@ -1316,6 +1322,9 @@ class ddl_testcase extends database_driver_testcase { $dbman->add_key($table, $key); $dbman->drop_key($table, $key); + + // No easy way to test it, this just makes sure no errors are encountered. + $this->assertTrue(true); } public function testAddForeignKey() { @@ -1327,6 +1336,9 @@ class ddl_testcase extends database_driver_testcase { $key = new xmldb_key('course'); $key->set_attributes(XMLDB_KEY_FOREIGN, array('course'), 'test_table0', array('id')); $dbman->add_key($table, $key); + + // No easy way to test it, this just makes sure no errors are encountered. + $this->assertTrue(true); } public function testDropForeignKey() { @@ -1340,6 +1352,9 @@ class ddl_testcase extends database_driver_testcase { $dbman->add_key($table, $key); $dbman->drop_key($table, $key); + + // No easy way to test it, this just makes sure no errors are encountered. + $this->assertTrue(true); } public function testRenameField() { @@ -1358,7 +1373,6 @@ class ddl_testcase extends database_driver_testcase { $this->assertTrue(array_key_exists('newfieldname', $columns)); } - public function testIndexExists() { // Skipping: this is just a test of find_index_name } diff --git a/lib/dml/database_column_info.php b/lib/dml/database_column_info.php index b6198838689..4aee79aa35e 100644 --- a/lib/dml/database_column_info.php +++ b/lib/dml/database_column_info.php @@ -1,5 +1,4 @@ . - /** * Database column information. * - * @package core - * @category dml - * @subpackage dml + * @package core_dml * @copyright 2008 Petr Skoda (http://skodak.org) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -34,10 +30,9 @@ defined('MOODLE_INTERNAL') || die(); * It is based on the adodb library's ADOFieldObject object. * 'column' does mean 'the field' here. * - * @package core - * @category dml - * @copyright 2008 Petr Skoda (http://skodak.org) - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @package core_dml + * @copyright 2008 Petr Skoda (http://skodak.org) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class database_column_info { /** diff --git a/lib/dml/moodle_database.php b/lib/dml/moodle_database.php index faf097e074c..48a992c73eb 100644 --- a/lib/dml/moodle_database.php +++ b/lib/dml/moodle_database.php @@ -14,24 +14,19 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . - /** * Abstract database driver class. * - * @package core - * @category dml - * @subpackage dml - * @copyright 2008 Petr Skoda (http://skodak.org) - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @package core_dml + * @copyright 2008 Petr Skoda (http://skodak.org) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); -require_once($CFG->libdir.'/dml/database_column_info.php'); -require_once($CFG->libdir.'/dml/moodle_recordset.php'); -require_once($CFG->libdir.'/dml/moodle_transaction.php'); - -/// GLOBAL CONSTANTS ///////////////////////////////////////////////////////// +require_once(__DIR__.'/database_column_info.php'); +require_once(__DIR__.'/moodle_recordset.php'); +require_once(__DIR__.'/moodle_transaction.php'); /** SQL_PARAMS_NAMED - Bitmask, indicates :name type parameters are supported by db backend. */ define('SQL_PARAMS_NAMED', 1); @@ -61,8 +56,7 @@ define('SQL_QUERY_AUX', 5); * Abstract class representing moodle database interface. * @link http://docs.moodle.org/dev/DML_functions * - * @package core - * @category dml + * @package core_dml * @copyright 2008 Petr Skoda (http://skodak.org) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -89,7 +83,7 @@ abstract class moodle_database { /** @var string Prefix added to table names. */ protected $prefix; - /** @var array Database or driver specific options, such as sockets or TCPIP db connections. */ + /** @var array Database or driver specific options, such as sockets or TCP/IP db connections. */ protected $dboptions; /** @var bool True means non-moodle external database used.*/ @@ -324,7 +318,7 @@ abstract class moodle_database { $backtrace = $lowesttransaction->get_backtrace(); if (defined('PHPUNIT_TEST') and PHPUNIT_TEST) { - //no need to log sudden exits in our PHPunit test cases + //no need to log sudden exits in our PHPUnit test cases } else { error_log('Potential coding error - active database transaction detected when disposing database:'."\n".format_backtrace($backtrace, true)); } @@ -422,7 +416,7 @@ abstract class moodle_database { /** * This logs the last query based on 'logall', 'logslow' and 'logerrors' options configured via $CFG->dboptions . - * @param string $error or false if not error + * @param string|bool $error or false if not error * @return void */ public function query_log($error=false) { @@ -463,7 +457,7 @@ abstract class moodle_database { /** * Returns database server info array - * @return array Array containing 'description' and 'version' atleast. + * @return array Array containing 'description' and 'version' at least. */ public abstract function get_server_info(); @@ -687,6 +681,7 @@ abstract class moodle_database { * Internal private utitlity function used to fix parameters. * Used with {@link preg_replace_callback()} * @param array $match Refer to preg_replace_callback usage for description. + * @return string */ private function _fix_sql_params_dollar_callback($match) { $this->fix_sql_params_i++; @@ -697,6 +692,7 @@ abstract class moodle_database { * Detects object parameters and throws exception if found * @param mixed $value * @return void + * @throws coding_exception if object detected */ protected function detect_objects($value) { if (is_object($value)) { @@ -723,7 +719,7 @@ abstract class moodle_database { $params[$key] = is_bool($value) ? (int)$value : $value; } - // NICOLAS C: Fixed regexp for negative backwards lookahead of double colons. Thanks for Sam Marshall's help + // NICOLAS C: Fixed regexp for negative backwards look-ahead of double colons. Thanks for Sam Marshall's help $named_count = preg_match_all('/(?is_transaction_started()) { @@ -2232,7 +2223,6 @@ abstract class moodle_database { $this->force_rollback = false; } -// session locking /** * Is session lock supported in this driver? * @return bool @@ -2261,7 +2251,6 @@ abstract class moodle_database { public function release_session_lock($rowid) { } -// performance and logging /** * Returns the number of reads done by this database. * @return int Number of reads. diff --git a/lib/dml/moodle_recordset.php b/lib/dml/moodle_recordset.php index d1e7005120a..975b253d79e 100644 --- a/lib/dml/moodle_recordset.php +++ b/lib/dml/moodle_recordset.php @@ -1,5 +1,4 @@ . - /** * Abstract recordset. * - * @package core - * @category dml - * @subpackage dml + * @package core_dml * @copyright 2008 Petr Skoda (http://skodak.org) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/lib/dml/moodle_temptables.php b/lib/dml/moodle_temptables.php index c89348ae1da..19f0c20ce78 100644 --- a/lib/dml/moodle_temptables.php +++ b/lib/dml/moodle_temptables.php @@ -1,5 +1,4 @@ . - /** * Delegated database transaction support. * - * @package core - * @category dml - * @subpackage dml + * @package core_dml * @copyright 2009 Petr Skoda (http://skodak.org) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -31,9 +27,7 @@ defined('MOODLE_INTERNAL') || die(); /** * Delegated transaction class. * - * @package core - * @category dml - * @subpackage dml + * @package core_dml * @copyright 2009 Petr Skoda (http://skodak.org) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -110,4 +104,4 @@ class moodle_transaction { } $this->database->rollback_delegated_transaction($this, $e); } -} \ No newline at end of file +} diff --git a/lib/dml/mssql_native_moodle_database.php b/lib/dml/mssql_native_moodle_database.php index 5ae728e86c6..7d134d2fc61 100644 --- a/lib/dml/mssql_native_moodle_database.php +++ b/lib/dml/mssql_native_moodle_database.php @@ -1,5 +1,4 @@ . - /** * Native mssql class representing moodle database interface. * - * @package core - * @subpackage dml_driver + * @package core_dml * @copyright 2009 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); -require_once($CFG->libdir.'/dml/moodle_database.php'); -require_once($CFG->libdir.'/dml/mssql_native_moodle_recordset.php'); -require_once($CFG->libdir.'/dml/mssql_native_moodle_temptables.php'); +require_once(__DIR__.'/moodle_database.php'); +require_once(__DIR__.'/mssql_native_moodle_recordset.php'); +require_once(__DIR__.'/mssql_native_moodle_temptables.php'); /** * Native mssql class representing moodle database interface. * - * @package core - * @subpackage dml_driver + * @package core_dml * @copyright 2009 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -515,7 +511,7 @@ class mssql_native_moodle_database extends moodle_database { protected function normalise_value($column, $value) { $this->detect_objects($value); - if (is_bool($value)) { /// Always, convert boolean to int + if (is_bool($value)) { // Always, convert boolean to int $value = (int)$value; } // And continue processing because text columns with numeric info need special handling below @@ -619,7 +615,7 @@ class mssql_native_moodle_database extends moodle_database { if (empty($params)) { return $sql; } - /// ok, we have verified sql statement with ? and correct number of params + // ok, we have verified sql statement with ? and correct number of params $parts = explode('?', $sql); $return = array_shift($parts); foreach ($params as $param) { @@ -1039,7 +1035,7 @@ class mssql_native_moodle_database extends moodle_database { // convert params to ? types list($select, $params, $type) = $this->fix_sql_params($select, $params); - /// Get column metadata + // Get column metadata $columns = $this->get_columns($table); $column = $columns[$newfield]; @@ -1094,8 +1090,6 @@ class mssql_native_moodle_database extends moodle_database { return true; } -/// SQL helper functions - public function sql_cast_char2int($fieldname, $text=false) { if (!$text) { return ' CAST(' . $fieldname . ' AS INT) '; @@ -1251,8 +1245,6 @@ s only returning name of SQL substring function, it now requires all parameters. } } -/// session locking - public function session_lock_supported() { return true; } @@ -1315,8 +1307,6 @@ s only returning name of SQL substring function, it now requires all parameters. $this->free_result($result); } -/// transactions - /** * Driver specific start of real database transaction, * this can not be used directly in code. diff --git a/lib/dml/mssql_native_moodle_recordset.php b/lib/dml/mssql_native_moodle_recordset.php index d383d31860b..2c7b7110fbd 100644 --- a/lib/dml/mssql_native_moodle_recordset.php +++ b/lib/dml/mssql_native_moodle_recordset.php @@ -1,5 +1,4 @@ libdir.'/dml/moodle_recordset.php'); +require_once(__DIR__.'/moodle_recordset.php'); class mssql_native_moodle_recordset extends moodle_recordset { @@ -54,7 +52,7 @@ class mssql_native_moodle_recordset extends moodle_recordset { } public function key() { - /// return first column value as key + // return first column value as key if (!$this->current) { return false; } diff --git a/lib/dml/mssql_native_moodle_temptables.php b/lib/dml/mssql_native_moodle_temptables.php index 9242059978b..df04cca1d03 100644 --- a/lib/dml/mssql_native_moodle_temptables.php +++ b/lib/dml/mssql_native_moodle_temptables.php @@ -1,5 +1,4 @@ libdir.'/dml/moodle_temptables.php'); +require_once(__DIR__.'/moodle_temptables.php'); class mssql_native_moodle_temptables extends moodle_temptables { @@ -50,5 +48,4 @@ class mssql_native_moodle_temptables extends moodle_temptables { // TODO: throw exception if exists: if ($this->is_temptable... $this->temptables[$tablename] = '#' . $this->prefix . $tablename; } - } diff --git a/lib/dml/mysqli_native_moodle_database.php b/lib/dml/mysqli_native_moodle_database.php index 535eca61fe8..93311bd5fd4 100644 --- a/lib/dml/mysqli_native_moodle_database.php +++ b/lib/dml/mysqli_native_moodle_database.php @@ -1,5 +1,4 @@ . - /** * Native mysqli class representing moodle database interface. * - * @package core - * @subpackage dml_driver + * @package core_dml * @copyright 2008 Petr Skoda (http://skodak.org) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); -require_once($CFG->libdir.'/dml/moodle_database.php'); -require_once($CFG->libdir.'/dml/mysqli_native_moodle_recordset.php'); -require_once($CFG->libdir.'/dml/mysqli_native_moodle_temptables.php'); +require_once(__DIR__.'/moodle_database.php'); +require_once(__DIR__.'/mysqli_native_moodle_recordset.php'); +require_once(__DIR__.'/mysqli_native_moodle_temptables.php'); /** * Native mysqli class representing moodle database interface. * - * @package core - * @subpackage dml_driver + * @package core_dml * @copyright 2008 Petr Skoda (http://skodak.org) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -77,7 +73,7 @@ class mysqli_native_moodle_database extends moodle_database { $dbport = 3306; } ob_start(); - $conn = new mysqli($dbhost, $dbuser, $dbpass, '', $dbport, $dbsocket); /// Connect without db + $conn = new mysqli($dbhost, $dbuser, $dbpass, '', $dbport, $dbsocket); // Connect without db $dberr = ob_get_contents(); ob_end_clean(); $errorno = @$conn->connect_errno; @@ -324,7 +320,7 @@ class mysqli_native_moodle_database extends moodle_database { $this->query_end($result); } - // Connection stabilished and configured, going to instantiate the temptables controller + // Connection stabilised and configured, going to instantiate the temptables controller $this->temptables = new mysqli_native_moodle_temptables($this); return true; @@ -736,7 +732,7 @@ class mysqli_native_moodle_database extends moodle_database { if (empty($params)) { return $sql; } - /// ok, we have verified sql statement with ? and correct number of params + // ok, we have verified sql statement with ? and correct number of params $parts = explode('?', $sql); $return = array_shift($parts); foreach ($params as $param) { @@ -1264,7 +1260,6 @@ class mysqli_native_moodle_database extends moodle_database { return ' CAST(' . $fieldname . ' AS SIGNED) '; } -/// session locking public function session_lock_supported() { return true; } @@ -1273,7 +1268,7 @@ class mysqli_native_moodle_database extends moodle_database { * Obtain session lock * @param int $rowid id of the row with session record * @param int $timeout max allowed time to wait for the lock in seconds - * @return bool success + * @return void */ public function get_session_lock($rowid, $timeout) { parent::get_session_lock($rowid, $timeout); @@ -1309,7 +1304,6 @@ class mysqli_native_moodle_database extends moodle_database { } } -/// transactions /** * Are transactions supported? * It is not responsible to run productions servers diff --git a/lib/dml/mysqli_native_moodle_recordset.php b/lib/dml/mysqli_native_moodle_recordset.php index e8dc5bce994..230ef8c6edc 100644 --- a/lib/dml/mysqli_native_moodle_recordset.php +++ b/lib/dml/mysqli_native_moodle_recordset.php @@ -1,5 +1,4 @@ . - /** * Mysqli specific recordset. * - * @package core - * @subpackage dml_driver + * @package core_dml * @copyright 2008 Petr Skoda (http://skodak.org) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); -require_once($CFG->libdir.'/dml/moodle_recordset.php'); +require_once(__DIR__.'/moodle_recordset.php'); /** * Mysqli specific moodle recordset class @@ -63,7 +60,7 @@ class mysqli_native_moodle_recordset extends moodle_recordset { } public function key() { - /// return first column value as key + // return first column value as key if (!$this->current) { return false; } diff --git a/lib/dml/mysqli_native_moodle_temptables.php b/lib/dml/mysqli_native_moodle_temptables.php index 0ad5132328f..4d777be009b 100644 --- a/lib/dml/mysqli_native_moodle_temptables.php +++ b/lib/dml/mysqli_native_moodle_temptables.php @@ -1,5 +1,4 @@ libdir.'/dml/moodle_temptables.php'); +require_once(__DIR__.'/moodle_temptables.php'); class mysqli_native_moodle_temptables extends moodle_temptables { - /// I love these classes :-P + // I love these classes :-P } diff --git a/lib/dml/oci_native_moodle_database.php b/lib/dml/oci_native_moodle_database.php index 08df721afd2..b62ac9baddc 100644 --- a/lib/dml/oci_native_moodle_database.php +++ b/lib/dml/oci_native_moodle_database.php @@ -1,5 +1,4 @@ . - /** * Native oci class representing moodle database interface. * - * @package core - * @subpackage dml_driver + * @package core_dml * @copyright 2008 Petr Skoda (http://skodak.org) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); -require_once($CFG->libdir.'/dml/moodle_database.php'); -require_once($CFG->libdir.'/dml/oci_native_moodle_recordset.php'); -require_once($CFG->libdir.'/dml/oci_native_moodle_temptables.php'); +require_once(__DIR__.'/moodle_database.php'); +require_once(__DIR__.'/oci_native_moodle_recordset.php'); +require_once(__DIR__.'/oci_native_moodle_temptables.php'); /** * Native oci class representing moodle database interface. @@ -37,8 +34,7 @@ require_once($CFG->libdir.'/dml/oci_native_moodle_temptables.php'); * One complete reference for PHP + OCI: * http://www.oracle.com/technology/tech/php/underground-php-oracle-manual.html * - * @package core - * @subpackage dml_driver + * @package core_dml * @copyright 2008 Petr Skoda (http://skodak.org) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -809,7 +805,7 @@ class oci_native_moodle_database extends moodle_database { // of empties will need to use the sql_empty() and sql_isempty() helper functions. // MDL-17491. - // If the field ins't VARCHAR or CLOB, skip + // If the field isn't VARCHAR or CLOB, skip if ($column->meta_type != 'C' and $column->meta_type != 'X') { return $value; } @@ -835,7 +831,7 @@ class oci_native_moodle_database extends moodle_database { return '0'; // Transform 0 to '0' that evaluates the same for PHP } else if ($value === '') { - return ' '; // Transform '' to ' ' that DONT'T EVALUATE THE SAME + return ' '; // Transform '' to ' ' that DON'T EVALUATE THE SAME // (we'll transform back again on get_records_XXX functions and others)!! } @@ -1449,7 +1445,6 @@ class oci_native_moodle_database extends moodle_database { return ' FROM dual'; } -// Bitwise operations protected function bitwise_supported() { if (isset($this->bitwise_supported)) { // Use cached value if available return $this->bitwise_supported; @@ -1551,11 +1546,11 @@ class oci_native_moodle_database extends moodle_database { } } - // NOTE: Oracle concat implementation isn't ANSI compliant when using NULLs (the result of - // any concatenation with NULL must return NULL) because of his inability to differentiate - // NULLs and empty strings. So this function will cause some tests to fail. Hopefully - // it's only a side case and it won't affect normal concatenation operations in Moodle. public function sql_concat() { + // NOTE: Oracle concat implementation isn't ANSI compliant when using NULLs (the result of + // any concatenation with NULL must return NULL) because of his inability to differentiate + // NULLs and empty strings. So this function will cause some tests to fail. Hopefully + // it's only a side case and it won't affect normal concatenation operations in Moodle. $arr = func_get_args(); $s = implode(' || ', $arr); if ($s === '') { @@ -1604,7 +1599,6 @@ class oci_native_moodle_database extends moodle_database { return 'dbms_lob.substr(' . $fieldname . ', ' . $numchars . ',1)'; } -/// session locking public function session_lock_supported() { if (isset($this->dblocks_supported)) { // Use cached value if available return $this->dblocks_supported; @@ -1629,7 +1623,7 @@ class oci_native_moodle_database extends moodle_database { * Obtain session lock * @param int $rowid id of the row with session record * @param int $timeout max allowed time to wait for the lock in seconds - * @return bool success + * @return void */ public function get_session_lock($rowid, $timeout) { if (!$this->session_lock_supported()) { @@ -1668,7 +1662,6 @@ class oci_native_moodle_database extends moodle_database { oci_free_statement($stmt); } -/// transactions /** * Driver specific start of real database transaction, * this can not be used directly in code. diff --git a/lib/dml/oci_native_moodle_package.sql b/lib/dml/oci_native_moodle_package.sql index 042c6106645..2585f713d08 100644 --- a/lib/dml/oci_native_moodle_package.sql +++ b/lib/dml/oci_native_moodle_package.sql @@ -14,8 +14,7 @@ -- along with Moodle. If not, see . /** - * @package core - * @subpackage dml_driver + * @package core_dml * @copyright 2009 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @version 20091010 (plz, keep this updated for easier reference) diff --git a/lib/dml/oci_native_moodle_recordset.php b/lib/dml/oci_native_moodle_recordset.php index 4d8694a54b1..e21e2310542 100644 --- a/lib/dml/oci_native_moodle_recordset.php +++ b/lib/dml/oci_native_moodle_recordset.php @@ -1,5 +1,4 @@ . - /** * Oracle specific recordset. * - * @package core - * @subpackage dml_driver + * @package core_dml * @copyright 2008 Petr Skoda (http://skodak.org) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); -require_once($CFG->libdir.'/dml/moodle_recordset.php'); +require_once(__DIR__.'/moodle_recordset.php'); class oci_native_moodle_recordset extends moodle_recordset { @@ -57,7 +54,7 @@ class oci_native_moodle_recordset extends moodle_recordset { } public function key() { - /// return first column value as key + // return first column value as key if (!$this->current) { return false; } diff --git a/lib/dml/oci_native_moodle_temptables.php b/lib/dml/oci_native_moodle_temptables.php index 1343d06dfe6..3b7fd3f7dd5 100644 --- a/lib/dml/oci_native_moodle_temptables.php +++ b/lib/dml/oci_native_moodle_temptables.php @@ -1,5 +1,4 @@ libdir.'/dml/moodle_temptables.php'); +require_once(__DIR__.'/moodle_temptables.php'); class oci_native_moodle_temptables extends moodle_temptables { - protected $unique_session_id; // To store unique_session_id. Needed for temp tables unique naming (upto 24cc) - protected $counter; // To get incrementally different temptable names on each add_temptable() request + /** @var int To store unique_session_id. Needed for temp tables unique naming (upto 24cc) */ + protected $unique_session_id; // + /** @var int To get incrementally different temptable names on each add_temptable() request */ + protected $counter; /** * Creates new moodle_temptables instance @@ -50,7 +50,7 @@ class oci_native_moodle_temptables extends moodle_temptables { /** * Add one temptable to the store. * - * Overriden because OCI only support global temptables, so we need to change completely the name, based + * Overridden because OCI only support global temptables, so we need to change completely the name, based * in unique session identifier, to get local-like temp tables support * tables before the prefix. * diff --git a/lib/dml/pdo_moodle_database.php b/lib/dml/pdo_moodle_database.php index 8b090a49161..4aae9ce6ed6 100644 --- a/lib/dml/pdo_moodle_database.php +++ b/lib/dml/pdo_moodle_database.php @@ -1,5 +1,4 @@ . - /** * Experimental pdo database class * - * @package core - * @subpackage dml_driver + * @package core_dml * @copyright 2008 Andrei Bautu * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); -require_once($CFG->libdir.'/dml/moodle_database.php'); -require_once($CFG->libdir.'/dml/pdo_moodle_recordset.php'); +require_once(__DIR__.'/moodle_database.php'); +require_once(__DIR__.'/pdo_moodle_recordset.php'); /** * Experimental pdo database class * - * @package core - * @subpackage dml_driver + * @package core_dml * @copyright 2008 Andrei Bautu * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -102,7 +98,7 @@ abstract class pdo_moodle_database extends moodle_database { } protected function configure_dbconnection() { - ///TODO: not needed preconfigure_dbconnection() stuff for PDO drivers? + //TODO: not needed preconfigure_dbconnection() stuff for PDO drivers? } /** diff --git a/lib/dml/pdo_moodle_recordset.php b/lib/dml/pdo_moodle_recordset.php index 803416f590c..673d91f30b1 100644 --- a/lib/dml/pdo_moodle_recordset.php +++ b/lib/dml/pdo_moodle_recordset.php @@ -1,5 +1,4 @@ . - /** * Experimental pdo recordset * - * @package core - * @subpackage dml_driver + * @package core_dml * @copyright 2008 Andrei Bautu * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); -require_once($CFG->libdir.'/dml/moodle_recordset.php'); +require_once(__DIR__.'/moodle_recordset.php'); /** * Experimental pdo recordset * - * @package core - * @subpackage dml_driver + * @package core_dml * @copyright 2008 Andrei Bautu * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -64,7 +60,7 @@ class pdo_moodle_recordset extends moodle_recordset { } public function key() { - /// return first column value as key + // return first column value as key if (!$this->current) { return false; } diff --git a/lib/dml/pgsql_native_moodle_database.php b/lib/dml/pgsql_native_moodle_database.php index 57a007a9cd7..c883aed83e2 100644 --- a/lib/dml/pgsql_native_moodle_database.php +++ b/lib/dml/pgsql_native_moodle_database.php @@ -1,5 +1,4 @@ . - /** * Native pgsql class representing moodle database interface. * - * @package core - * @subpackage dml_driver + * @package core_dml * @copyright 2008 Petr Skoda (http://skodak.org) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); -require_once($CFG->libdir.'/dml/moodle_database.php'); -require_once($CFG->libdir.'/dml/pgsql_native_moodle_recordset.php'); -require_once($CFG->libdir.'/dml/pgsql_native_moodle_temptables.php'); +require_once(__DIR__.'/moodle_database.php'); +require_once(__DIR__.'/pgsql_native_moodle_recordset.php'); +require_once(__DIR__.'/pgsql_native_moodle_temptables.php'); /** * Native pgsql class representing moodle database interface. * - * @package core - * @subpackage dml_driver + * @package core_dml * @copyright 2008 Petr Skoda (http://skodak.org) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -566,7 +562,7 @@ class pgsql_native_moodle_database extends moodle_database { * @return bool */ public function setup_is_unicodedb() { - /// Get PostgreSQL server_encoding value + // Get PostgreSQL server_encoding value $sql = "SHOW server_encoding"; $this->query_start($sql, null, SQL_QUERY_AUX); $result = pg_query($this->pgsql, $sql); @@ -1044,13 +1040,13 @@ class pgsql_native_moodle_database extends moodle_database { list($select, $params, $type) = $this->fix_sql_params($select, $params); $i = count($params)+1; - /// Get column metadata + // Get column metadata $columns = $this->get_columns($table); $column = $columns[$newfield]; $normalised_value = $this->normalise_value($column, $newvalue); if (is_array($normalised_value) && array_key_exists('blob', $normalised_value)) { - /// Update BYTEA and return + // Update BYTEA and return $normalised_value = pg_escape_bytea($this->pgsql, $normalised_value['blob']); $sql = "UPDATE {$this->prefix}$table SET $newfield = '$normalised_value'::bytea $select"; $this->query_start($sql, NULL, SQL_QUERY_UPDATE); @@ -1152,7 +1148,7 @@ class pgsql_native_moodle_database extends moodle_database { return " '' "; } // Add always empty string element so integer-exclusive concats - // will work without needing to cast each element explicity + // will work without needing to cast each element explicitly return " '' || $s "; } @@ -1175,7 +1171,6 @@ class pgsql_native_moodle_database extends moodle_database { return $positivematch ? '~*' : '!~*'; } -/// session locking public function session_lock_supported() { return true; } @@ -1252,7 +1247,6 @@ class pgsql_native_moodle_database extends moodle_database { } } -/// transactions /** * Driver specific start of real database transaction, * this can not be used directly in code. diff --git a/lib/dml/pgsql_native_moodle_recordset.php b/lib/dml/pgsql_native_moodle_recordset.php index 6d00d157f56..76fe53ea01f 100644 --- a/lib/dml/pgsql_native_moodle_recordset.php +++ b/lib/dml/pgsql_native_moodle_recordset.php @@ -1,5 +1,4 @@ . - /** * Native postgresql recordset. * - * @package core - * @subpackage dml_driver + * @package core_dml * @copyright 2008 Petr Skoda (http://skodak.org) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); -require_once($CFG->libdir.'/dml/moodle_recordset.php'); +require_once(__DIR__.'/moodle_recordset.php'); /** * pgsql specific moodle recordset class * - * @package core - * @subpackage dml_driver + * @package core_dml * @copyright 2008 Petr Skoda (http://skodak.org) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -82,7 +78,7 @@ class pgsql_native_moodle_recordset extends moodle_recordset { } public function key() { - /// return first column value as key + // return first column value as key if (!$this->current) { return false; } diff --git a/lib/dml/pgsql_native_moodle_temptables.php b/lib/dml/pgsql_native_moodle_temptables.php index 4227da15cf9..cd87ef2e27c 100644 --- a/lib/dml/pgsql_native_moodle_temptables.php +++ b/lib/dml/pgsql_native_moodle_temptables.php @@ -1,5 +1,4 @@ libdir.'/dml/moodle_temptables.php'); +require_once(__DIR__.'/moodle_temptables.php'); class pgsql_native_moodle_temptables extends moodle_temptables { // I love these classes :-P diff --git a/lib/dml/sqlite3_pdo_moodle_database.php b/lib/dml/sqlite3_pdo_moodle_database.php index c52b2f1916a..e7410a5d50d 100644 --- a/lib/dml/sqlite3_pdo_moodle_database.php +++ b/lib/dml/sqlite3_pdo_moodle_database.php @@ -1,5 +1,4 @@ . - /** * Experimental pdo database class. * - * @package core - * @subpackage dml_driver + * @package core_dml * @copyright 2008 Andrei Bautu * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); -require_once($CFG->libdir.'/dml/pdo_moodle_database.php'); +require_once(__DIR__.'/pdo_moodle_database.php'); /** * Experimental pdo database class * - * @package core - * @subpackage dml_driver + * @package core_dml * @copyright 2008 Andrei Bautu * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/lib/dml/sqlsrv_native_moodle_database.php b/lib/dml/sqlsrv_native_moodle_database.php index 90ec10479e5..168c68234c0 100644 --- a/lib/dml/sqlsrv_native_moodle_database.php +++ b/lib/dml/sqlsrv_native_moodle_database.php @@ -1,5 +1,4 @@ libdir.'/dml/moodle_database.php'); -require_once($CFG->libdir.'/dml/sqlsrv_native_moodle_recordset.php'); -require_once($CFG->libdir.'/dml/sqlsrv_native_moodle_temptables.php'); +require_once(__DIR__.'/moodle_database.php'); +require_once(__DIR__.'/sqlsrv_native_moodle_recordset.php'); +require_once(__DIR__.'/sqlsrv_native_moodle_temptables.php'); /** * Native sqlsrv class representing moodle database interface. * - * @package core - * @subpackage dml_driver + * @package core_dml * @copyright 2009 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v2 or later */ @@ -331,29 +328,32 @@ class sqlsrv_native_moodle_database extends moodle_database { return $errorMessage; } - /*** - * Bound variables *are* supported. Until I can get it to work, emulate the bindings - * The challenge/problem/bug is that although they work, doing a SELECT SCOPE_IDENTITY() - * doesn't return a value (no result set) - */ - /** * Prepare the query binding and do the actual query. * * @param string $sql The sql statement - * @param mixed $params array of params for binding. If NULL, they are ignored. - * @param mixed $sql_query_type - Type of operation - * @param mixed $free_result - Default true, transaction query will be freed. - * @param mixed $scrollable - Default false, to use for quickly seeking to target records + * @param array $params array of params for binding. If NULL, they are ignored. + * @param int $sql_query_type - Type of operation + * @param bool $free_result - Default true, transaction query will be freed. + * @param bool $scrollable - Default false, to use for quickly seeking to target records + * @return resource|bool result */ private function do_query($sql, $params, $sql_query_type, $free_result = true, $scrollable = false) { list($sql, $params, $type) = $this->fix_sql_params($sql, $params); + /* + * Bound variables *are* supported. Until I can get it to work, emulate the bindings + * The challenge/problem/bug is that although they work, doing a SELECT SCOPE_IDENTITY() + * doesn't return a value (no result set) + * + * -- somebody from MS + */ + $sql = $this->emulate_bound_params($sql, $params); $this->query_start($sql, $params, $sql_query_type); if (!$scrollable) { // Only supporting next row $result = sqlsrv_query($this->sqlsrv, $sql); - } else { // Suporting absolute/relative rows + } else { // Supporting absolute/relative rows $result = sqlsrv_query($this->sqlsrv, $sql, array(), array('Scrollable' => SQLSRV_CURSOR_STATIC)); } @@ -575,7 +575,7 @@ class sqlsrv_native_moodle_database extends moodle_database { protected function normalise_value($column, $value) { $this->detect_objects($value); - if (is_bool($value)) { /// Always, convert boolean to int + if (is_bool($value)) { // Always, convert boolean to int $value = (int)$value; } // And continue processing because text columns with numeric info need special handling below @@ -585,9 +585,9 @@ class sqlsrv_native_moodle_database extends moodle_database { $value = unpack('H*hex', $value); // we leave it as array, so emulate_bound_params() can detect it } // easily and "bind" the param ok. - } else if ($column->meta_type == 'X') { // sqlsrv doesn't cast from int to text, so if text column + } else if ($column->meta_type == 'X') { // sqlsrv doesn't cast from int to text, so if text column if (is_numeric($value)) { // and is numeric value then cast to string - $value = array('numstr' => (string)$value); // and put into array, so emulate_bound_params() will know how + $value = array('numstr' => (string)$value); // and put into array, so emulate_bound_params() will know how } // to "bind" the param ok, avoiding reverse conversion to number } else if ($value === '') { @@ -602,6 +602,7 @@ class sqlsrv_native_moodle_database extends moodle_database { * Selectively call sqlsrv_free_stmt(), avoiding some warnings without using the horrible @ * * @param sqlsrv_resource $resource resource to be freed if possible + * @return bool */ private function free_result($resource) { if (!is_bool($resource)) { // true/false resources cannot be freed @@ -688,7 +689,6 @@ class sqlsrv_native_moodle_database extends moodle_database { return null; } - /** * Workaround for SQL*Server Native driver similar to MSSQL driver for * consistent behavior. @@ -698,7 +698,7 @@ class sqlsrv_native_moodle_database extends moodle_database { if (empty($params)) { return $sql; } - /// ok, we have verified sql statement with ? and correct number of params + // ok, we have verified sql statement with ? and correct number of params $parts = explode('?', $sql); $return = array_shift($parts); foreach ($params as $param) { @@ -1099,7 +1099,7 @@ class sqlsrv_native_moodle_database extends moodle_database { // convert params to ? types list($select, $params, $type) = $this->fix_sql_params($select, $params); - /// Get column metadata + // Get column metadata $columns = $this->get_columns($table); $column = $columns[$newfield]; @@ -1141,8 +1141,6 @@ class sqlsrv_native_moodle_database extends moodle_database { } - /// SQL helper functions - public function sql_cast_char2int($fieldname, $text = false) { if (!$text) { return ' CAST(' . $fieldname . ' AS INT) '; @@ -1300,8 +1298,6 @@ class sqlsrv_native_moodle_database extends moodle_database { } } - /// session locking - public function session_lock_supported() { return true; } @@ -1310,7 +1306,7 @@ class sqlsrv_native_moodle_database extends moodle_database { * Obtain session lock * @param int $rowid id of the row with session record * @param int $timeout max allowed time to wait for the lock in seconds - * @return bool success + * @return void */ public function get_session_lock($rowid, $timeout) { if (!$this->session_lock_supported()) { @@ -1361,14 +1357,6 @@ class sqlsrv_native_moodle_database extends moodle_database { $this->free_result($result); } - - /// transactions - - // NOTE: - // TODO -- should these be wrapped in query start/end? They arn't a query - // but information and error capture is nice. msk - - /** * Driver specific start of real database transaction, * this can not be used directly in code. diff --git a/lib/dml/sqlsrv_native_moodle_recordset.php b/lib/dml/sqlsrv_native_moodle_recordset.php index 1f9965506cb..6ca88aad323 100644 --- a/lib/dml/sqlsrv_native_moodle_recordset.php +++ b/lib/dml/sqlsrv_native_moodle_recordset.php @@ -1,5 +1,4 @@ libdir.'/dml/moodle_recordset.php'); +require_once(__DIR__.'/moodle_recordset.php'); class sqlsrv_native_moodle_recordset extends moodle_recordset { @@ -55,7 +53,7 @@ class sqlsrv_native_moodle_recordset extends moodle_recordset { } public function key() { - /// return first column value as key + // return first column value as key if (!$this->current) { return false; } diff --git a/lib/dml/sqlsrv_native_moodle_temptables.php b/lib/dml/sqlsrv_native_moodle_temptables.php index fe860346586..2d9cc62b9c7 100644 --- a/lib/dml/sqlsrv_native_moodle_temptables.php +++ b/lib/dml/sqlsrv_native_moodle_temptables.php @@ -1,5 +1,4 @@ libdir.'/dml/mssql_native_moodle_temptables.php'); +require_once(__DIR__.'/mssql_native_moodle_temptables.php'); -/*** +/** * This class is not specific to the SQL Server Native Driver but rather * to the family of Microsoft SQL Servers. * - * @package core - * @subpackage dml_driver + * @package core_dml * @copyright 2009 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v2 or later */ diff --git a/lib/dml/tests/dml_test.php b/lib/dml/tests/dml_test.php index 410c7ffef3b..e431b91e09f 100644 --- a/lib/dml/tests/dml_test.php +++ b/lib/dml/tests/dml_test.php @@ -17,8 +17,7 @@ /** * DML layer tests * - * @package core - * @subpackage dml + * @package core_dml * @category phpunit * @copyright 2008 Nicolas Connault * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later @@ -63,8 +62,6 @@ class dml_testcase extends database_driver_testcase { return $debuginfo; } - // NOTE: please keep order of test methods here matching the order of moodle_database class methods - function test_diagnose() { $DB = $this->tdb; $result = $DB->diagnose(); @@ -777,7 +774,7 @@ class dml_testcase extends database_driver_testcase { $next_field = next($fields); } - $this->assertEquals($next_column->name, $next_field->name); + $this->assertEquals($next_column->name, $next_field->getName()); } // Test get_columns for non-existing table returns empty array. MDL-30147 @@ -1090,7 +1087,7 @@ class dml_testcase extends database_driver_testcase { $this->assertEquals(3, $counter); $rs->close(); - $rs = $DB->get_recordset_list($tablename, 'course',array()); /// Must return 0 rows without conditions. MDL-17645 + $rs = $DB->get_recordset_list($tablename, 'course',array()); // Must return 0 rows without conditions. MDL-17645 $counter = 0; foreach ($rs as $record) { @@ -1316,7 +1313,7 @@ class dml_testcase extends database_driver_testcase { $this->assertEquals(2, next($records)->id); $this->assertEquals(4, next($records)->id); - $this->assertSame(array(), $records = $DB->get_records_list($tablename, 'course', array())); /// Must return 0 rows without conditions. MDL-17645 + $this->assertSame(array(), $records = $DB->get_records_list($tablename, 'course', array())); // Must return 0 rows without conditions. MDL-17645 $this->assertEquals(0, count($records)); // note: delegate limits testing to test_get_records_sql() @@ -3070,7 +3067,7 @@ class dml_testcase extends database_driver_testcase { $this->assertTrue($DB->delete_records_list($tablename, 'course', array(2, 3))); $this->assertEquals(1, $DB->count_records($tablename)); - $this->assertTrue($DB->delete_records_list($tablename, 'course', array())); /// Must delete 0 rows without conditions. MDL-17645 + $this->assertTrue($DB->delete_records_list($tablename, 'course', array())); // Must delete 0 rows without conditions. MDL-17645 $this->assertEquals(1, $DB->count_records($tablename)); } @@ -3560,13 +3557,13 @@ class dml_testcase extends database_driver_testcase { function test_coalesce() { $DB = $this->tdb; - // Testing not-null ocurrences, return 1st + // Testing not-null occurrences, return 1st $sql = "SELECT COALESCE('returnthis', 'orthis', 'orwhynotthis') AS test" . $DB->sql_null_from_clause(); $this->assertEquals('returnthis', $DB->get_field_sql($sql, array())); $sql = "SELECT COALESCE(:paramvalue, 'orthis', 'orwhynotthis') AS test" . $DB->sql_null_from_clause(); $this->assertEquals('returnthis', $DB->get_field_sql($sql, array('paramvalue' => 'returnthis'))); - // Testing null ocurrences, return 2nd + // Testing null occurrences, return 2nd $sql = "SELECT COALESCE(null, 'returnthis', 'orthis') AS test" . $DB->sql_null_from_clause(); $this->assertEquals('returnthis', $DB->get_field_sql($sql, array())); $sql = "SELECT COALESCE(:paramvalue, 'returnthis', 'orthis') AS test" . $DB->sql_null_from_clause(); @@ -3574,7 +3571,7 @@ class dml_testcase extends database_driver_testcase { $sql = "SELECT COALESCE(null, :paramvalue, 'orthis') AS test" . $DB->sql_null_from_clause(); $this->assertEquals('returnthis', $DB->get_field_sql($sql, array('paramvalue' => 'returnthis'))); - // Testing null ocurrences, return 3rd + // Testing null occurrences, return 3rd $sql = "SELECT COALESCE(null, null, 'returnthis') AS test" . $DB->sql_null_from_clause(); $this->assertEquals('returnthis', $DB->get_field_sql($sql, array())); $sql = "SELECT COALESCE(null, :paramvalue, 'returnthis') AS test" . $DB->sql_null_from_clause(); @@ -3582,7 +3579,7 @@ class dml_testcase extends database_driver_testcase { $sql = "SELECT COALESCE(null, null, :paramvalue) AS test" . $DB->sql_null_from_clause(); $this->assertEquals('returnthis', $DB->get_field_sql($sql, array('paramvalue' => 'returnthis'))); - // Testing all null ocurrences, return null + // Testing all null occurrences, return null // Note: under mssql, if all elements are nulls, at least one must be a "typed" null, hence // we cannot test this in a cross-db way easily, so next 2 tests are using // different queries depending of the DB family @@ -3603,7 +3600,7 @@ class dml_testcase extends database_driver_testcase { $DB = $this->tdb; $dbman = $DB->get_manager(); - /// Testing all sort of values + // Testing all sort of values $sql = "SELECT ".$DB->sql_concat("?", "?", "?")." AS fullname ". $DB->sql_null_from_clause(); // string, some unicode chars $params = array('name', 'áéíóú', 'name3'); @@ -3621,7 +3618,7 @@ class dml_testcase extends database_driver_testcase { $params = array(123.45, null, 'test'); $this->assertNull($DB->get_field_sql($sql, $params), 'ANSI behaviour: Concatenating NULL must return NULL - But in Oracle :-(. [%s]'); // Concatenate NULL with anything result = NULL - /// Testing fieldnames + values and also integer fieldnames + // Testing fieldnames + values and also integer fieldnames $table = $this->get_test_table(); $tablename = $table->getName(); @@ -4328,7 +4325,7 @@ class dml_testcase extends database_driver_testcase { $DB2 = moodle_database::get_driver_instance($cfg->dbtype, $cfg->dblibrary); $DB2->connect($cfg->dbhost, $cfg->dbuser, $cfg->dbpass, $cfg->dbname, $cfg->prefix, $cfg->dboptions); - // Testing that acquiring a lock efectively locks + // Testing that acquiring a lock effectively locks // Get a session lock on connection1 $rowid = rand(100, 200); $timeout = 1; @@ -4337,14 +4334,14 @@ class dml_testcase extends database_driver_testcase { // Try to get the same session lock on connection2 try { $DB2->get_session_lock($rowid, $timeout); - $DB2->release_session_lock($rowid); // Should not be excuted, but here for safety + $DB2->release_session_lock($rowid); // Should not be executed, but here for safety $this->fail('An Exception is missing, expected due to session lock acquired.'); } catch (exception $e) { $this->assertTrue($e instanceof dml_sessionwait_exception); $DB->release_session_lock($rowid); // Release lock on connection1 } - // Testing that releasing a lock efectively frees + // Testing that releasing a lock effectively frees // Get a session lock on connection1 $rowid = rand(100, 200); $timeout = 1; @@ -4446,6 +4443,9 @@ class dml_testcase extends database_driver_testcase { $DB->get_fieldset_sql("SELECT id FROM {{$tablename}} WHERE course = :select", array('select'=>1)); $DB->set_field_select($tablename, 'course', '1', "id = :select", array('select'=>1)); $DB->delete_records_select($tablename, "id = :select", array('select'=>1)); + + // if we get here test passed ok + $this->assertTrue(true); } public function test_limits_and_offsets() { @@ -4613,7 +4613,7 @@ class moodle_database_for_testing extends moodle_database { /** - * Dumb test class with toString() returrning 1. + * Dumb test class with toString() returning 1. */ class dml_test_object_one { public function __toString() { diff --git a/lib/evalmath/evalmath.class.php b/lib/evalmath/evalmath.class.php index 9d9c7d6250b..8f68d2a9de4 100644 --- a/lib/evalmath/evalmath.class.php +++ b/lib/evalmath/evalmath.class.php @@ -557,9 +557,8 @@ class EvalMathFuncs { return $min + $randomno; } - static function rand_float(){ - $randomvalue = array_shift(unpack('v', md5(self::get_random_seed(), true))); - return $randomvalue / 65536; + static function rand_float() { + $randomvalues = unpack('v', md5(self::get_random_seed(), true)); + return array_shift($randomvalues) / 65536; } - } diff --git a/lib/filebrowser/file_browser.php b/lib/filebrowser/file_browser.php index 2b1a83d1d1d..f2105cb8d11 100644 --- a/lib/filebrowser/file_browser.php +++ b/lib/filebrowser/file_browser.php @@ -93,6 +93,7 @@ class file_browser { /** * Returns info about the files at System context + * @todo MDL-33372 - Provide a way of displaying recent files for blog entries. * * @param object $context context object * @param string $component component diff --git a/lib/filebrowser/file_info.php b/lib/filebrowser/file_info.php index 6f9d302bde5..d5bcadecc7b 100644 --- a/lib/filebrowser/file_info.php +++ b/lib/filebrowser/file_info.php @@ -226,6 +226,24 @@ abstract class file_info { return 0; } + /** + * Whether or not this is a external resource + * + * @return bool + */ + public function is_external_file() { + return false; + } + + /** + * Returns file status flag. + * + * @return int 0 means file OK, anything else is a problem and file can not be used + */ + public function get_status() { + return 0; + } + /** * Returns the localised human-readable name of the file together with virtual path * diff --git a/lib/filebrowser/file_info_stored.php b/lib/filebrowser/file_info_stored.php index d16f13c2ab8..44fa566517b 100644 --- a/lib/filebrowser/file_info_stored.php +++ b/lib/filebrowser/file_info_stored.php @@ -309,6 +309,24 @@ class file_info_stored extends file_info { return $this->lf->get_sortorder(); } + /** + * Whether or not this is a external resource + * + * @return bool + */ + public function is_external_file() { + return $this->lf->is_external_file(); + } + + /** + * Returns file status flag. + * + * @return int 0 means file OK, anything else is a problem and file can not be used + */ + public function get_status() { + return $this->lf->get_status(); + } + /** * Returns list of children. * diff --git a/lib/filelib.php b/lib/filelib.php index 0d18cfa6c6d..e814feeb4d0 100644 --- a/lib/filelib.php +++ b/lib/filelib.php @@ -601,7 +601,7 @@ function file_get_drafarea_files($draftitemid, $filepath = '/') { } // find the file this draft file was created from and count all references in local // system pointing to that file - $source = unserialize($file->get_source()); + $source = @unserialize($file->get_source()); if (isset($source->original)) { $item->refcount = $fs->search_references_count($source->original); } @@ -679,7 +679,7 @@ function file_get_submitted_draft_itemid($elname) { * @return stored_file */ function file_restore_source_field_from_draft_file($storedfile) { - $source = unserialize($storedfile->get_source()); + $source = @unserialize($storedfile->get_source()); if (!empty($source)) { if (is_object($source)) { $restoredsource = $source->source; @@ -1360,35 +1360,35 @@ function download_file_content_write_handler($received, $ch, $data) { function &get_mimetypes_array() { static $mimearray = array ( 'xxx' => array ('type'=>'document/unknown', 'icon'=>'unknown'), - '3gp' => array ('type'=>'video/quicktime', 'icon'=>'mov', 'groups'=>array('video'), 'string'=>'video'), - 'aac' => array ('type'=>'audio/aac', 'icon'=>'mp3', 'groups'=>array('audio'), 'string'=>'audio'), + '3gp' => array ('type'=>'video/quicktime', 'icon'=>'quicktime', 'groups'=>array('video'), 'string'=>'video'), + 'aac' => array ('type'=>'audio/aac', 'icon'=>'audio', 'groups'=>array('audio'), 'string'=>'audio'), 'ai' => array ('type'=>'application/postscript', 'icon'=>'eps', 'groups'=>array('image'), 'string'=>'image'), 'aif' => array ('type'=>'audio/x-aiff', 'icon'=>'audio', 'groups'=>array('audio'), 'string'=>'audio'), 'aiff' => array ('type'=>'audio/x-aiff', 'icon'=>'audio', 'groups'=>array('audio'), 'string'=>'audio'), 'aifc' => array ('type'=>'audio/x-aiff', 'icon'=>'audio', 'groups'=>array('audio'), 'string'=>'audio'), 'applescript' => array ('type'=>'text/plain', 'icon'=>'text'), - 'asc' => array ('type'=>'text/plain', 'icon'=>'text'), - 'asm' => array ('type'=>'text/plain', 'icon'=>'text'), + 'asc' => array ('type'=>'text/plain', 'icon'=>'sourcecode'), + 'asm' => array ('type'=>'text/plain', 'icon'=>'sourcecode'), 'au' => array ('type'=>'audio/au', 'icon'=>'audio', 'groups'=>array('audio'), 'string'=>'audio'), 'avi' => array ('type'=>'video/x-ms-wm', 'icon'=>'avi', 'groups'=>array('video','web_video'), 'string'=>'video'), 'bmp' => array ('type'=>'image/bmp', 'icon'=>'bmp', 'groups'=>array('image'), 'string'=>'image'), - 'c' => array ('type'=>'text/plain', 'icon'=>'text'), + 'c' => array ('type'=>'text/plain', 'icon'=>'sourcecode'), 'cct' => array ('type'=>'shockwave/director', 'icon'=>'flash'), - 'cpp' => array ('type'=>'text/plain', 'icon'=>'text'), - 'cs' => array ('type'=>'application/x-csh', 'icon'=>'text'), + 'cpp' => array ('type'=>'text/plain', 'icon'=>'sourcecode'), + 'cs' => array ('type'=>'application/x-csh', 'icon'=>'sourcecode'), 'css' => array ('type'=>'text/css', 'icon'=>'text', 'groups'=>array('web_file')), - 'csv' => array ('type'=>'text/csv', 'icon'=>'xlsx', 'groups'=>array('spreadsheet')), - 'dv' => array ('type'=>'video/x-dv', 'icon'=>'mov', 'groups'=>array('video'), 'string'=>'video'), - 'dmg' => array ('type'=>'application/octet-stream', 'icon'=>'dmg'), + 'csv' => array ('type'=>'text/csv', 'icon'=>'spreadsheet', 'groups'=>array('spreadsheet')), + 'dv' => array ('type'=>'video/x-dv', 'icon'=>'quicktime', 'groups'=>array('video'), 'string'=>'video'), + 'dmg' => array ('type'=>'application/octet-stream', 'icon'=>'unknown'), - 'doc' => array ('type'=>'application/msword', 'icon'=>'docx', 'groups'=>array('document')), - 'docx' => array ('type'=>'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'icon'=>'docx', 'groups'=>array('document')), - 'docm' => array ('type'=>'application/vnd.ms-word.document.macroEnabled.12', 'icon'=>'docx'), - 'dotx' => array ('type'=>'application/vnd.openxmlformats-officedocument.wordprocessingml.template', 'icon'=>'docx'), - 'dotm' => array ('type'=>'application/vnd.ms-word.template.macroEnabled.12', 'icon'=>'docx'), + 'doc' => array ('type'=>'application/msword', 'icon'=>'document', 'groups'=>array('document')), + 'docx' => array ('type'=>'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'icon'=>'document', 'groups'=>array('document')), + 'docm' => array ('type'=>'application/vnd.ms-word.document.macroEnabled.12', 'icon'=>'document'), + 'dotx' => array ('type'=>'application/vnd.openxmlformats-officedocument.wordprocessingml.template', 'icon'=>'document'), + 'dotm' => array ('type'=>'application/vnd.ms-word.template.macroEnabled.12', 'icon'=>'document'), 'dcr' => array ('type'=>'application/x-director', 'icon'=>'flash'), - 'dif' => array ('type'=>'video/x-dv', 'icon'=>'mov', 'groups'=>array('video'), 'string'=>'video'), + 'dif' => array ('type'=>'video/x-dv', 'icon'=>'quicktime', 'groups'=>array('video'), 'string'=>'video'), 'dir' => array ('type'=>'application/x-director', 'icon'=>'flash'), 'dxr' => array ('type'=>'application/x-director', 'icon'=>'flash'), 'eps' => array ('type'=>'application/postscript', 'icon'=>'eps'), @@ -1396,37 +1396,37 @@ function &get_mimetypes_array() { 'flv' => array ('type'=>'video/x-flv', 'icon'=>'flash', 'groups'=>array('video','web_video'), 'string'=>'video'), 'f4v' => array ('type'=>'video/mp4', 'icon'=>'flash', 'groups'=>array('video','web_video'), 'string'=>'video'), 'gif' => array ('type'=>'image/gif', 'icon'=>'gif', 'groups'=>array('image', 'web_image'), 'string'=>'image'), - 'gtar' => array ('type'=>'application/x-gtar', 'icon'=>'zip', 'groups'=>array('archive'), 'string'=>'archive'), - 'tgz' => array ('type'=>'application/g-zip', 'icon'=>'zip', 'groups'=>array('archive'), 'string'=>'archive'), - 'gz' => array ('type'=>'application/g-zip', 'icon'=>'zip', 'groups'=>array('archive'), 'string'=>'archive'), - 'gzip' => array ('type'=>'application/g-zip', 'icon'=>'zip', 'groups'=>array('archive'), 'string'=>'archive'), - 'h' => array ('type'=>'text/plain', 'icon'=>'text'), - 'hpp' => array ('type'=>'text/plain', 'icon'=>'text'), - 'hqx' => array ('type'=>'application/mac-binhex40', 'icon'=>'zip', 'groups'=>array('archive'), 'string'=>'archive'), - 'htc' => array ('type'=>'text/x-component', 'icon'=>'html'), + 'gtar' => array ('type'=>'application/x-gtar', 'icon'=>'archive', 'groups'=>array('archive'), 'string'=>'archive'), + 'tgz' => array ('type'=>'application/g-zip', 'icon'=>'archive', 'groups'=>array('archive'), 'string'=>'archive'), + 'gz' => array ('type'=>'application/g-zip', 'icon'=>'archive', 'groups'=>array('archive'), 'string'=>'archive'), + 'gzip' => array ('type'=>'application/g-zip', 'icon'=>'archive', 'groups'=>array('archive'), 'string'=>'archive'), + 'h' => array ('type'=>'text/plain', 'icon'=>'sourcecode'), + 'hpp' => array ('type'=>'text/plain', 'icon'=>'sourcecode'), + 'hqx' => array ('type'=>'application/mac-binhex40', 'icon'=>'archive', 'groups'=>array('archive'), 'string'=>'archive'), + 'htc' => array ('type'=>'text/x-component', 'icon'=>'markup'), 'html' => array ('type'=>'text/html', 'icon'=>'html', 'groups'=>array('web_file')), - 'xhtml'=> array ('type'=>'application/xhtml+xml', 'icon'=>'html', 'groups'=>array('web_file')), + 'xhtml'=> array ('type'=>'application/xhtml+xml', 'icon'=>'markup', 'groups'=>array('web_file')), 'htm' => array ('type'=>'text/html', 'icon'=>'html', 'groups'=>array('web_file')), 'ico' => array ('type'=>'image/vnd.microsoft.icon', 'icon'=>'image', 'groups'=>array('image'), 'string'=>'image'), 'ics' => array ('type'=>'text/calendar', 'icon'=>'text'), 'isf' => array ('type'=>'application/inspiration', 'icon'=>'isf'), 'ist' => array ('type'=>'application/inspiration.template', 'icon'=>'isf'), - 'java' => array ('type'=>'text/plain', 'icon'=>'text'), - 'jcb' => array ('type'=>'text/xml', 'icon'=>'xml'), - 'jcl' => array ('type'=>'text/xml', 'icon'=>'xml'), - 'jcw' => array ('type'=>'text/xml', 'icon'=>'xml'), - 'jmt' => array ('type'=>'text/xml', 'icon'=>'xml'), - 'jmx' => array ('type'=>'text/xml', 'icon'=>'xml'), + 'java' => array ('type'=>'text/plain', 'icon'=>'sourcecode'), + 'jcb' => array ('type'=>'text/xml', 'icon'=>'markup'), + 'jcl' => array ('type'=>'text/xml', 'icon'=>'markup'), + 'jcw' => array ('type'=>'text/xml', 'icon'=>'markup'), + 'jmt' => array ('type'=>'text/xml', 'icon'=>'markup'), + 'jmx' => array ('type'=>'text/xml', 'icon'=>'markup'), 'jpe' => array ('type'=>'image/jpeg', 'icon'=>'jpeg', 'groups'=>array('image', 'web_image'), 'string'=>'image'), 'jpeg' => array ('type'=>'image/jpeg', 'icon'=>'jpeg', 'groups'=>array('image', 'web_image'), 'string'=>'image'), 'jpg' => array ('type'=>'image/jpeg', 'icon'=>'jpeg', 'groups'=>array('image', 'web_image'), 'string'=>'image'), - 'jqz' => array ('type'=>'text/xml', 'icon'=>'xml'), + 'jqz' => array ('type'=>'text/xml', 'icon'=>'markup'), 'js' => array ('type'=>'application/x-javascript', 'icon'=>'text', 'groups'=>array('web_file')), 'latex'=> array ('type'=>'application/x-latex', 'icon'=>'text'), - 'm' => array ('type'=>'text/plain', 'icon'=>'text'), + 'm' => array ('type'=>'text/plain', 'icon'=>'sourcecode'), 'mbz' => array ('type'=>'application/vnd.moodle.backup', 'icon'=>'moodle'), - 'mov' => array ('type'=>'video/quicktime', 'icon'=>'mov', 'groups'=>array('video','web_video'), 'string'=>'video'), - 'movie'=> array ('type'=>'video/x-sgi-movie', 'icon'=>'mov', 'groups'=>array('video'), 'string'=>'video'), + 'mov' => array ('type'=>'video/quicktime', 'icon'=>'quicktime', 'groups'=>array('video','web_video'), 'string'=>'video'), + 'movie'=> array ('type'=>'video/x-sgi-movie', 'icon'=>'quicktime', 'groups'=>array('video'), 'string'=>'video'), 'm3u' => array ('type'=>'audio/x-mpegurl', 'icon'=>'mp3', 'groups'=>array('audio'), 'string'=>'audio'), 'mp3' => array ('type'=>'audio/mp3', 'icon'=>'mp3', 'groups'=>array('audio','web_audio'), 'string'=>'audio'), 'mp4' => array ('type'=>'video/mp4', 'icon'=>'mpeg', 'groups'=>array('video','web_video'), 'string'=>'video'), @@ -1436,74 +1436,74 @@ function &get_mimetypes_array() { 'mpe' => array ('type'=>'video/mpeg', 'icon'=>'mpeg', 'groups'=>array('video','web_video'), 'string'=>'video'), 'mpg' => array ('type'=>'video/mpeg', 'icon'=>'mpeg', 'groups'=>array('video','web_video'), 'string'=>'video'), - 'odt' => array ('type'=>'application/vnd.oasis.opendocument.text', 'icon'=>'odt', 'groups'=>array('document')), - 'ott' => array ('type'=>'application/vnd.oasis.opendocument.text-template', 'icon'=>'odt', 'groups'=>array('document')), + 'odt' => array ('type'=>'application/vnd.oasis.opendocument.text', 'icon'=>'writer', 'groups'=>array('document')), + 'ott' => array ('type'=>'application/vnd.oasis.opendocument.text-template', 'icon'=>'writer', 'groups'=>array('document')), 'oth' => array ('type'=>'application/vnd.oasis.opendocument.text-web', 'icon'=>'oth', 'groups'=>array('document')), - 'odm' => array ('type'=>'application/vnd.oasis.opendocument.text-master', 'icon'=>'odt'), - 'odg' => array ('type'=>'application/vnd.oasis.opendocument.graphics', 'icon'=>'odg'), - 'otg' => array ('type'=>'application/vnd.oasis.opendocument.graphics-template', 'icon'=>'odg'), - 'odp' => array ('type'=>'application/vnd.oasis.opendocument.presentation', 'icon'=>'odp'), - 'otp' => array ('type'=>'application/vnd.oasis.opendocument.presentation-template', 'icon'=>'odp'), - 'ods' => array ('type'=>'application/vnd.oasis.opendocument.spreadsheet', 'icon'=>'ods', 'groups'=>array('spreadsheet')), - 'ots' => array ('type'=>'application/vnd.oasis.opendocument.spreadsheet-template', 'icon'=>'ods', 'groups'=>array('spreadsheet')), - 'odc' => array ('type'=>'application/vnd.oasis.opendocument.chart', 'icon'=>'odc'), - 'odf' => array ('type'=>'application/vnd.oasis.opendocument.formula', 'icon'=>'odf'), - 'odb' => array ('type'=>'application/vnd.oasis.opendocument.database', 'icon'=>'odb'), - 'odi' => array ('type'=>'application/vnd.oasis.opendocument.image', 'icon'=>'odg'), - 'oga' => array ('type'=>'audio/ogg', 'icon'=>'wma', 'groups'=>array('audio'), 'string'=>'audio'), - 'ogg' => array ('type'=>'audio/ogg', 'icon'=>'wma', 'groups'=>array('audio'), 'string'=>'audio'), - 'ogv' => array ('type'=>'video/ogg', 'icon'=>'wmv', 'groups'=>array('video'), 'string'=>'video'), + 'odm' => array ('type'=>'application/vnd.oasis.opendocument.text-master', 'icon'=>'writer'), + 'odg' => array ('type'=>'application/vnd.oasis.opendocument.graphics', 'icon'=>'draw'), + 'otg' => array ('type'=>'application/vnd.oasis.opendocument.graphics-template', 'icon'=>'draw'), + 'odp' => array ('type'=>'application/vnd.oasis.opendocument.presentation', 'icon'=>'impress'), + 'otp' => array ('type'=>'application/vnd.oasis.opendocument.presentation-template', 'icon'=>'impress'), + 'ods' => array ('type'=>'application/vnd.oasis.opendocument.spreadsheet', 'icon'=>'calc', 'groups'=>array('spreadsheet')), + 'ots' => array ('type'=>'application/vnd.oasis.opendocument.spreadsheet-template', 'icon'=>'calc', 'groups'=>array('spreadsheet')), + 'odc' => array ('type'=>'application/vnd.oasis.opendocument.chart', 'icon'=>'chart'), + 'odf' => array ('type'=>'application/vnd.oasis.opendocument.formula', 'icon'=>'math'), + 'odb' => array ('type'=>'application/vnd.oasis.opendocument.database', 'icon'=>'base'), + 'odi' => array ('type'=>'application/vnd.oasis.opendocument.image', 'icon'=>'draw'), + 'oga' => array ('type'=>'audio/ogg', 'icon'=>'audio', 'groups'=>array('audio'), 'string'=>'audio'), + 'ogg' => array ('type'=>'audio/ogg', 'icon'=>'audio', 'groups'=>array('audio'), 'string'=>'audio'), + 'ogv' => array ('type'=>'video/ogg', 'icon'=>'video', 'groups'=>array('video'), 'string'=>'video'), 'pct' => array ('type'=>'image/pict', 'icon'=>'image', 'groups'=>array('image'), 'string'=>'image'), 'pdf' => array ('type'=>'application/pdf', 'icon'=>'pdf'), - 'php' => array ('type'=>'text/plain', 'icon'=>'text'), + 'php' => array ('type'=>'text/plain', 'icon'=>'sourcecode'), 'pic' => array ('type'=>'image/pict', 'icon'=>'image', 'groups'=>array('image'), 'string'=>'image'), 'pict' => array ('type'=>'image/pict', 'icon'=>'image', 'groups'=>array('image'), 'string'=>'image'), 'png' => array ('type'=>'image/png', 'icon'=>'png', 'groups'=>array('image', 'web_image'), 'string'=>'image'), - 'pps' => array ('type'=>'application/vnd.ms-powerpoint', 'icon'=>'pptx', 'groups'=>array('presentation')), - 'ppt' => array ('type'=>'application/vnd.ms-powerpoint', 'icon'=>'pptx', 'groups'=>array('presentation')), - 'pptx' => array ('type'=>'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'icon'=>'pptx'), - 'pptm' => array ('type'=>'application/vnd.ms-powerpoint.presentation.macroEnabled.12', 'icon'=>'pptx'), - 'potx' => array ('type'=>'application/vnd.openxmlformats-officedocument.presentationml.template', 'icon'=>'pptx'), - 'potm' => array ('type'=>'application/vnd.ms-powerpoint.template.macroEnabled.12', 'icon'=>'pptx'), - 'ppam' => array ('type'=>'application/vnd.ms-powerpoint.addin.macroEnabled.12', 'icon'=>'pptx'), - 'ppsx' => array ('type'=>'application/vnd.openxmlformats-officedocument.presentationml.slideshow', 'icon'=>'pptx'), - 'ppsm' => array ('type'=>'application/vnd.ms-powerpoint.slideshow.macroEnabled.12', 'icon'=>'pptx'), + 'pps' => array ('type'=>'application/vnd.ms-powerpoint', 'icon'=>'powerpoint', 'groups'=>array('presentation')), + 'ppt' => array ('type'=>'application/vnd.ms-powerpoint', 'icon'=>'powerpoint', 'groups'=>array('presentation')), + 'pptx' => array ('type'=>'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'icon'=>'powerpoint'), + 'pptm' => array ('type'=>'application/vnd.ms-powerpoint.presentation.macroEnabled.12', 'icon'=>'powerpoint'), + 'potx' => array ('type'=>'application/vnd.openxmlformats-officedocument.presentationml.template', 'icon'=>'powerpoint'), + 'potm' => array ('type'=>'application/vnd.ms-powerpoint.template.macroEnabled.12', 'icon'=>'powerpoint'), + 'ppam' => array ('type'=>'application/vnd.ms-powerpoint.addin.macroEnabled.12', 'icon'=>'powerpoint'), + 'ppsx' => array ('type'=>'application/vnd.openxmlformats-officedocument.presentationml.slideshow', 'icon'=>'powerpoint'), + 'ppsm' => array ('type'=>'application/vnd.ms-powerpoint.slideshow.macroEnabled.12', 'icon'=>'powerpoint'), 'ps' => array ('type'=>'application/postscript', 'icon'=>'pdf'), - 'qt' => array ('type'=>'video/quicktime', 'icon'=>'mov', 'groups'=>array('video','web_video'), 'string'=>'video'), + 'qt' => array ('type'=>'video/quicktime', 'icon'=>'quicktime', 'groups'=>array('video','web_video'), 'string'=>'video'), 'ra' => array ('type'=>'audio/x-realaudio-plugin', 'icon'=>'audio', 'groups'=>array('audio','web_audio'), 'string'=>'audio'), 'ram' => array ('type'=>'audio/x-pn-realaudio-plugin', 'icon'=>'audio', 'groups'=>array('audio'), 'string'=>'audio'), - 'rhb' => array ('type'=>'text/xml', 'icon'=>'xml'), + 'rhb' => array ('type'=>'text/xml', 'icon'=>'markup'), 'rm' => array ('type'=>'audio/x-pn-realaudio-plugin', 'icon'=>'audio', 'groups'=>array('audio'), 'string'=>'audio'), 'rmvb' => array ('type'=>'application/vnd.rn-realmedia-vbr', 'icon'=>'video', 'groups'=>array('video'), 'string'=>'video'), 'rtf' => array ('type'=>'text/rtf', 'icon'=>'text', 'groups'=>array('document')), 'rtx' => array ('type'=>'text/richtext', 'icon'=>'text'), 'rv' => array ('type'=>'audio/x-pn-realaudio-plugin', 'icon'=>'audio', 'groups'=>array('video'), 'string'=>'video'), - 'sh' => array ('type'=>'application/x-sh', 'icon'=>'text'), - 'sit' => array ('type'=>'application/x-stuffit', 'icon'=>'zip', 'groups'=>array('archive'), 'string'=>'archive'), + 'sh' => array ('type'=>'application/x-sh', 'icon'=>'sourcecode'), + 'sit' => array ('type'=>'application/x-stuffit', 'icon'=>'archive', 'groups'=>array('archive'), 'string'=>'archive'), 'smi' => array ('type'=>'application/smil', 'icon'=>'text'), 'smil' => array ('type'=>'application/smil', 'icon'=>'text'), - 'sqt' => array ('type'=>'text/xml', 'icon'=>'xml'), + 'sqt' => array ('type'=>'text/xml', 'icon'=>'markup'), 'svg' => array ('type'=>'image/svg+xml', 'icon'=>'image', 'groups'=>array('image','web_image'), 'string'=>'image'), 'svgz' => array ('type'=>'image/svg+xml', 'icon'=>'image', 'groups'=>array('image','web_image'), 'string'=>'image'), 'swa' => array ('type'=>'application/x-director', 'icon'=>'flash'), 'swf' => array ('type'=>'application/x-shockwave-flash', 'icon'=>'flash', 'groups'=>array('video','web_video')), 'swfl' => array ('type'=>'application/x-shockwave-flash', 'icon'=>'flash', 'groups'=>array('video','web_video')), - 'sxw' => array ('type'=>'application/vnd.sun.xml.writer', 'icon'=>'odt'), - 'stw' => array ('type'=>'application/vnd.sun.xml.writer.template', 'icon'=>'odt'), - 'sxc' => array ('type'=>'application/vnd.sun.xml.calc', 'icon'=>'ods'), - 'stc' => array ('type'=>'application/vnd.sun.xml.calc.template', 'icon'=>'ods'), - 'sxd' => array ('type'=>'application/vnd.sun.xml.draw', 'icon'=>'odg'), - 'std' => array ('type'=>'application/vnd.sun.xml.draw.template', 'icon'=>'odg'), - 'sxi' => array ('type'=>'application/vnd.sun.xml.impress', 'icon'=>'odp'), - 'sti' => array ('type'=>'application/vnd.sun.xml.impress.template', 'icon'=>'odp'), - 'sxg' => array ('type'=>'application/vnd.sun.xml.writer.global', 'icon'=>'odt'), - 'sxm' => array ('type'=>'application/vnd.sun.xml.math', 'icon'=>'odf'), + 'sxw' => array ('type'=>'application/vnd.sun.xml.writer', 'icon'=>'writer'), + 'stw' => array ('type'=>'application/vnd.sun.xml.writer.template', 'icon'=>'writer'), + 'sxc' => array ('type'=>'application/vnd.sun.xml.calc', 'icon'=>'calc'), + 'stc' => array ('type'=>'application/vnd.sun.xml.calc.template', 'icon'=>'calc'), + 'sxd' => array ('type'=>'application/vnd.sun.xml.draw', 'icon'=>'draw'), + 'std' => array ('type'=>'application/vnd.sun.xml.draw.template', 'icon'=>'draw'), + 'sxi' => array ('type'=>'application/vnd.sun.xml.impress', 'icon'=>'impress'), + 'sti' => array ('type'=>'application/vnd.sun.xml.impress.template', 'icon'=>'impress'), + 'sxg' => array ('type'=>'application/vnd.sun.xml.writer.global', 'icon'=>'writer'), + 'sxm' => array ('type'=>'application/vnd.sun.xml.math', 'icon'=>'math'), - 'tar' => array ('type'=>'application/x-tar', 'icon'=>'zip', 'groups'=>array('archive'), 'string'=>'archive'), + 'tar' => array ('type'=>'application/x-tar', 'icon'=>'archive', 'groups'=>array('archive'), 'string'=>'archive'), 'tif' => array ('type'=>'image/tiff', 'icon'=>'tiff', 'groups'=>array('image'), 'string'=>'image'), 'tiff' => array ('type'=>'image/tiff', 'icon'=>'tiff', 'groups'=>array('image'), 'string'=>'image'), 'tex' => array ('type'=>'application/x-tex', 'icon'=>'text'), @@ -1512,24 +1512,24 @@ function &get_mimetypes_array() { 'tsv' => array ('type'=>'text/tab-separated-values', 'icon'=>'text'), 'txt' => array ('type'=>'text/plain', 'icon'=>'text', 'defaulticon'=>true), 'wav' => array ('type'=>'audio/wav', 'icon'=>'wav', 'groups'=>array('audio'), 'string'=>'audio'), - 'webm' => array ('type'=>'video/webm', 'icon'=>'wmv', 'groups'=>array('video'), 'string'=>'video'), + 'webm' => array ('type'=>'video/webm', 'icon'=>'video', 'groups'=>array('video'), 'string'=>'video'), 'wmv' => array ('type'=>'video/x-ms-wmv', 'icon'=>'wmv', 'groups'=>array('video'), 'string'=>'video'), 'asf' => array ('type'=>'video/x-ms-asf', 'icon'=>'wmv', 'groups'=>array('video'), 'string'=>'video'), 'xdp' => array ('type'=>'application/pdf', 'icon'=>'pdf'), 'xfd' => array ('type'=>'application/pdf', 'icon'=>'pdf'), 'xfdf' => array ('type'=>'application/pdf', 'icon'=>'pdf'), - 'xls' => array ('type'=>'application/vnd.ms-excel', 'icon'=>'xlsx', 'groups'=>array('spreadsheet')), - 'xlsx' => array ('type'=>'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'icon'=>'xlsx'), - 'xlsm' => array ('type'=>'application/vnd.ms-excel.sheet.macroEnabled.12', 'icon'=>'xlsx', 'groups'=>array('spreadsheet')), - 'xltx' => array ('type'=>'application/vnd.openxmlformats-officedocument.spreadsheetml.template', 'icon'=>'xlsx'), - 'xltm' => array ('type'=>'application/vnd.ms-excel.template.macroEnabled.12', 'icon'=>'xlsx'), - 'xlsb' => array ('type'=>'application/vnd.ms-excel.sheet.binary.macroEnabled.12', 'icon'=>'xlsx'), - 'xlam' => array ('type'=>'application/vnd.ms-excel.addin.macroEnabled.12', 'icon'=>'xlsx'), + 'xls' => array ('type'=>'application/vnd.ms-excel', 'icon'=>'spreadsheet', 'groups'=>array('spreadsheet')), + 'xlsx' => array ('type'=>'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'icon'=>'spreadsheet'), + 'xlsm' => array ('type'=>'application/vnd.ms-excel.sheet.macroEnabled.12', 'icon'=>'spreadsheet', 'groups'=>array('spreadsheet')), + 'xltx' => array ('type'=>'application/vnd.openxmlformats-officedocument.spreadsheetml.template', 'icon'=>'spreadsheet'), + 'xltm' => array ('type'=>'application/vnd.ms-excel.template.macroEnabled.12', 'icon'=>'spreadsheet'), + 'xlsb' => array ('type'=>'application/vnd.ms-excel.sheet.binary.macroEnabled.12', 'icon'=>'spreadsheet'), + 'xlam' => array ('type'=>'application/vnd.ms-excel.addin.macroEnabled.12', 'icon'=>'spreadsheet'), - 'xml' => array ('type'=>'application/xml', 'icon'=>'xml'), - 'xsl' => array ('type'=>'text/xml', 'icon'=>'xml'), - 'zip' => array ('type'=>'application/zip', 'icon'=>'zip', 'groups'=>array('archive'), 'string'=>'archive') + 'xml' => array ('type'=>'application/xml', 'icon'=>'markup'), + 'xsl' => array ('type'=>'text/xml', 'icon'=>'markup'), + 'zip' => array ('type'=>'application/zip', 'icon'=>'archive', 'groups'=>array('archive'), 'string'=>'archive') ); return $mimearray; } diff --git a/lib/filestorage/file_storage.php b/lib/filestorage/file_storage.php index fd9f63c3c17..933c5c39dbb 100644 --- a/lib/filestorage/file_storage.php +++ b/lib/filestorage/file_storage.php @@ -1659,7 +1659,14 @@ class file_storage { * @return array */ public static function unpack_reference($str, $cleanparams = false) { - $params = unserialize(base64_decode($str)); + $decoded = base64_decode($str, true); + if ($decoded === false) { + throw new file_reference_exception(null, $str, null, null, 'Invalid base64 format'); + } + $params = @unserialize($decoded); // hide E_NOTICE + if ($params === false) { + throw new file_reference_exception(null, $decoded, null, null, 'Not an unserializeable value'); + } if (is_array($params) && $cleanparams) { $params = array( 'component' => is_null($params['component']) ? '' : clean_param($params['component'], PARAM_COMPONENT), diff --git a/lib/filestorage/stored_file.php b/lib/filestorage/stored_file.php index ea718ae4b03..e9410bd40a4 100644 --- a/lib/filestorage/stored_file.php +++ b/lib/filestorage/stored_file.php @@ -390,6 +390,29 @@ class stored_file { return copy($path, $pathname); } + /** + * Copy content of file to temporary folder and returns file path + * + * @param string $dir name of the temporary directory + * @param string $fileprefix prefix of temporary file. + * @return string|bool path of temporary file or false. + */ + public function copy_content_to_temp($dir = 'files', $fileprefix = 'tempup_') { + $tempfile = false; + if (!$dir = make_temp_directory($dir)) { + return false; + } + if (!$tempfile = tempnam($dir, $fileprefix)) { + return false; + } + if (!$this->copy_content_to($tempfile)) { + // something went wrong + @unlink($tempfile); + return false; + } + return $tempfile; + } + /** * List contents of archive. * diff --git a/lib/filestorage/zip_packer.php b/lib/filestorage/zip_packer.php index 2cae4351137..a7726a66dbb 100644 --- a/lib/filestorage/zip_packer.php +++ b/lib/filestorage/zip_packer.php @@ -299,7 +299,7 @@ class zip_packer extends file_packer { global $CFG; if (!is_string($archivefile)) { - return $archivefile->extract_to_pathname($this, $contextid, $component, $filearea, $itemid, $pathbase, $userid); + return $archivefile->extract_to_storage($this, $contextid, $component, $filearea, $itemid, $pathbase, $userid); } check_dir_exists($CFG->tempdir.'/zip'); diff --git a/lib/form/dndupload.js b/lib/form/dndupload.js index 2e1514c9c3f..53018b9f08e 100644 --- a/lib/form/dndupload.js +++ b/lib/form/dndupload.js @@ -30,12 +30,12 @@ M.form_dndupload.init = function(Y, options) { Y: null, // URL for upload requests url: M.cfg.wwwroot + '/repository/repository_ajax.php?action=upload', + // options may include: itemid, acceptedtypes, maxfiles, maxbytes, clientid, repositoryid, author + options: {}, // itemid used for repository upload itemid: null, // accepted filetypes accepted by this form passed to repository acceptedtypes: [], - // maximum number of files this form allows - maxfiles: 0, // maximum size of files allowed in this form maxbytes: 0, // unqiue id of this form field used for html elements @@ -86,9 +86,9 @@ M.form_dndupload.init = function(Y, options) { return; // no upload repository is enabled to upload to } + this.options = options; this.acceptedtypes = options.acceptedtypes; this.clientid = options.clientid; - this.maxfiles = options.maxfiles; this.maxbytes = options.maxbytes; this.itemid = options.itemid; this.author = options.author; @@ -170,7 +170,7 @@ M.form_dndupload.init = function(Y, options) { * onto the page */ drag_enter_page: function(e) { - if (!this.has_files(e) || this.reached_maxfiles()) { + if (!this.has_files(e)) { return false; } @@ -209,7 +209,7 @@ M.form_dndupload.init = function(Y, options) { * @param e event object * @return boolean true if a valid file drag event */ - check_drag: function(e, maxfilesalert) { + check_drag: function(e) { if (!this.has_files(e)) { return false; } @@ -217,13 +217,6 @@ M.form_dndupload.init = function(Y, options) { e.preventDefault(); e.stopPropagation(); - if (this.reached_maxfiles()) { - if (typeof(maxfilesalert) != 'undefined' && maxfilesalert) { - alert(M.util.get_string('maxfilesreached', 'moodle', this.maxfiles)); - } - return false; - } - return true; }, @@ -299,21 +292,28 @@ M.form_dndupload.init = function(Y, options) { var files = e._event.dataTransfer.files; if (this.filemanager) { - var currentfilecount = this.filemanager.filecount; - if (((currentfilecount + files.length) > this.maxfiles) && (this.maxfiles != -1)) { - alert(M.util.get_string('maxfilesreached', 'moodle', this.maxfiles)); - return false; - } - this.show_progress_spinner(); - for (var i=0, f; f=files[i]; i++) { - if (this.upload_file(f)) { - currentfilecount++; - } - } + var options = { + files: files, + options: this.options, + repositoryid: this.repositoryid, + currentfilecount: this.filemanager.filecount, // All files uploaded. + currentfiles: this.filemanager.options.list, // Only the current folder. + callback: Y.bind('update_filemanager', this) + }; + var uploader = new dnduploader(options); + uploader.start_upload(); } else { - this.show_progress_spinner(); if (files.length >= 1) { - this.upload_file(files[0]); + options = { + files:[files[0]], + options: this.options, + repositoryid: this.repositoryid, + currentfilecount: 0, + currentfiles: [], + callback: Y.bind('callback', this) + }; + uploader = new dnduploader(options); + uploader.start_upload(); } } @@ -336,20 +336,6 @@ M.form_dndupload.init = function(Y, options) { return false; }, - /** - * Check if reached the maximumum number of allowed files - * - * @return boolean true if reached maximum number of files - */ - reached_maxfiles: function() { - if (this.filemanager) { - if (this.filemanager.filecount >= this.maxfiles && this.maxfiles != -1) { - return true; - } - } - return false; - }, - /** * Highlight the area where files could be dropped */ @@ -375,20 +361,6 @@ M.form_dndupload.init = function(Y, options) { this.container.removeClass('dndupload-over'); }, - /** - * Display a progress spinner in the destination node - */ - show_progress_spinner: function() { - this.container.addClass('dndupload-uploading'); - }, - - /** - * Remove progress spinner in the destination node - */ - hide_progress_spinner: function() { - this.container.removeClass('dndupload-uploading'); - }, - /** * Tell the attached filemanager element (if any) to refresh on file * upload @@ -398,18 +370,361 @@ M.form_dndupload.init = function(Y, options) { // update the filemanager that we've uploaded the files this.filemanager.filepicker_callback(); } + } + }; + + var dnduploader = function(options) { + dnduploader.superclass.constructor.apply(this, arguments); + }; + + Y.extend(dnduploader, Y.Base, { + // The URL to send the upload data to. + api: M.cfg.wwwroot+'/repository/repository_ajax.php', + // Options passed into the filemanager/filepicker element. + options: {}, + // The function to call when all uploads complete. + callback: null, + // The list of files dropped onto the element. + files: null, + // The ID of the 'upload' repository. + repositoryid: 0, + // Array of files already in the current folder (to check for name clashes). + currentfiles: null, + // Total number of files already uploaded (to check for exceeding limits). + currentfilecount: 0, + // The list of files to upload. + uploadqueue: [], + // This list of files with name clashes. + renamequeue: [], + // Set to true if the user has clicked on 'overwrite all'. + overwriteall: false, + // Set to true if the user has clicked on 'rename all'. + renameall: false, + + /** + * Initialise the settings for the dnduploader + * @param object params - includes: + * options (copied from the filepicker / filemanager) + * repositoryid - ID of the upload repository + * callback - the function to call when uploads are complete + * currentfiles - the list of files already in the current folder in the filemanager + * currentfilecount - the total files already in the filemanager + * files - the list of files to upload + * @return void + */ + initializer: function(params) { + this.options = params.options; + this.repositoryid = params.repositoryid; + this.callback = params.callback; + this.currentfiles = params.currentfiles; + this.currentfilecount = params.currentfilecount; + + this.initialise_queue(params.files); }, /** - * Upload a single file via an AJAX call to the 'upload' repository + * Entry point for starting the upload process (starts by processing any + * renames needed) */ - upload_file: function(file) { - if (file.size > this.maxbytes && this.maxbytes > 0) { - // Check filesize before attempting to upload - this.hide_progress_spinner(); - alert(M.util.get_string('uploadformlimit', 'moodle')+"\n'"+file.name+"'"); + start_upload: function() { + this.process_renames(); // Automatically calls 'do_upload' once renames complete. + }, + + /** + * Display a message in a popup + * @param string msg - the message to display + * @param string type - 'error' or 'info' + */ + print_msg: function(msg, type) { + var header = M.str.moodle.error; + if (type != 'error') { + type = 'info'; // one of only two types excepted + header = M.str.moodle.info; + } + if (!this.msg_dlg) { + this.msg_dlg_node = Y.Node.createWithFilesSkin(M.core_filepicker.templates.message); + this.msg_dlg_node.generateID(); + + this.msg_dlg = new Y.Panel({ + srcNode : this.msg_dlg_node, + zIndex : 800000, + centered : true, + modal : true, + visible : false, + render : true + }); + this.msg_dlg.plug(Y.Plugin.Drag,{handles:['#'+this.msg_dlg_node.get('id')+' .yui3-widget-hd']}); + this.msg_dlg_node.one('.fp-msg-butok').on('click', function(e) { + e.preventDefault(); + this.msg_dlg.hide(); + }, this); + } + + this.msg_dlg.set('headerContent', header); + this.msg_dlg_node.removeClass('fp-msg-info').removeClass('fp-msg-error').addClass('fp-msg-'+type) + this.msg_dlg_node.one('.fp-msg-text').setContent(msg); + this.msg_dlg.show(); + }, + + /** + * Check the size of each file and add to either the uploadqueue or, if there + * is a name clash, the renamequeue + * @param FileList files - the files to upload + * @return void + */ + initialise_queue: function(files) { + this.uploadqueue = []; + this.renamequeue = []; + + // Loop through the files and find any name clashes with existing files + var i; + for (i=0; i 0 && files[i].size > this.options.maxbytes) { + // Check filesize before attempting to upload + this.print_msg(M.util.get_string('uploadformlimit', 'moodle', files[i].name), 'error'); + this.uploadqueue = []; // No uploads if one file is too big. + return; + } + + if (this.has_name_clash(files[i].name)) { + this.renamequeue.push(files[i]); + } else { + if (!this.add_to_upload_queue(files[i], files[i].name, false)) { + return; + } + } + } + }, + + /** + * Add a single file to the uploadqueue, whilst checking the maxfiles limit + * @param File file - the file to add + * @param string filename - the name to give the file on upload + * @param bool overwrite - true to overwrite the existing file + * @return bool true if added successfully + */ + add_to_upload_queue: function(file, filename, overwrite) { + if (!overwrite) { + this.currentfilecount++; + } + if (this.options.maxfiles > 0 && this.currentfilecount > this.options.maxfiles) { + // Too many files - abort entire upload. + this.uploadqueue = []; + this.renamequeue = []; + this.print_msg(M.util.get_string('maxfilesreached', 'moodle', this.options.maxfiles), 'error'); return false; } + this.uploadqueue.push({file:file, filename:filename, overwrite:overwrite}); + return true; + }, + + /** + * Take the next file from the renamequeue and ask the user what to do with + * it. Called recursively until the queue is empty, then calls do_upload. + * @return void + */ + process_renames: function() { + if (this.renamequeue.length == 0) { + // All rename processing complete - start the actual upload. + this.do_upload(); + return; + } + var multiplefiles = (this.renamequeue.length > 1); + + // Get the next file from the rename queue. + var file = this.renamequeue.shift(); + // Generate a non-conflicting name for it. + var newname = this.generate_unique_name(file.name); + + // If the user has clicked on overwrite/rename ALL then process + // this file, as appropriate, then process the rest of the queue. + if (this.overwriteall) { + this.add_to_upload_queue(file, file.name, true); + this.process_renames(); + return; + } + if (this.renameall) { + this.add_to_upload_queue(file, newname, false); + this.process_renames(); + return; + } + + // Ask the user what to do with this file. + var self = this; + + var process_dlg_node; + if (multiplefiles) { + process_dlg_node = Y.Node.createWithFilesSkin(M.core_filepicker.templates.processexistingfilemultiple); + } else { + process_dlg_node = Y.Node.createWithFilesSkin(M.core_filepicker.templates.processexistingfile); + } + var node = process_dlg_node; + node.generateID(); + var process_dlg = new Y.Panel({ + srcNode : node, + headerContent: M.str.repository.fileexistsdialogheader, + zIndex : 800000, + centered : true, + modal : true, + visible : false, + render : true, + buttons : {} + }); + process_dlg.plug(Y.Plugin.Drag,{handles:['#'+node.get('id')+' .yui3-widget-hd']}); + + // Overwrite original. + node.one('.fp-dlg-butoverwrite').on('click', function(e) { + e.preventDefault(); + process_dlg.hide(); + self.add_to_upload_queue(file, file.name, true); + self.process_renames(); + }, this); + + // Rename uploaded file. + node.one('.fp-dlg-butrename').on('click', function(e) { + e.preventDefault(); + process_dlg.hide(); + self.add_to_upload_queue(file, newname, false); + self.process_renames(); + }, this); + + // Cancel all uploads. + node.one('.fp-dlg-butcancel').on('click', function(e) { + e.preventDefault(); + process_dlg.hide(); + }, this); + + // When we are at the file limit, only allow 'overwrite', not rename. + if (this.currentfilecount == this.options.maxfiles) { + node.one('.fp-dlg-butrename').setStyle('display', 'none'); + if (multiplefiles) { + node.one('.fp-dlg-butrenameall').setStyle('display', 'none'); + } + } + + // If there are more files still to go, offer the 'overwrite/rename all' options. + if (multiplefiles) { + // Overwrite all original files. + node.one('.fp-dlg-butoverwriteall').on('click', function(e) { + e.preventDefault(); + process_dlg.hide(); + this.overwriteall = true; + self.add_to_upload_queue(file, file.name, true); + self.process_renames(); + }, this); + + // Rename all new files. + node.one('.fp-dlg-butrenameall').on('click', function(e) { + e.preventDefault(); + process_dlg.hide(); + this.renameall = true; + self.add_to_upload_queue(file, newname, false); + self.process_renames(); + }, this); + } + node.one('.fp-dlg-text').setContent(M.util.get_string('fileexists', 'moodle', file.name)); + process_dlg_node.one('.fp-dlg-butrename').setContent(M.util.get_string('renameto', 'repository', newname)); + + // Destroy the dialog once it has been hidden. + process_dlg.after('visibleChange', function(e) { + if (!process_dlg.get('visible')) { + process_dlg.destroy(true); + } + }); + + process_dlg.show(); + }, + + /** + * Checks if there is already a file with the given name in the current folder + * or in the list of already uploading files + * @param string filename - the name to test + * @return bool true if the name already exists + */ + has_name_clash: function(filename) { + // Check against the already uploaded files + var i; + for (i=0; i 0) { + var filedetails = this.uploadqueue.shift(); + this.upload_file(filedetails.file, filedetails.filename, filedetails.overwrite); + } else { + this.uploadfinished(lastresult); + } + }, + + /** + * Run the callback to the filemanager/filepicker + */ + uploadfinished: function(lastresult) { + this.callback(lastresult); + }, + + /** + * Upload a single file via an AJAX call to the 'upload' repository. Automatically + * calls do_upload as each upload completes. + * @param File file - the file to upload + * @param string filename - the name to give the file + * @param bool overwrite - true if the existing file should be overwritten + */ + upload_file: function(file, filename, overwrite) { // This would be an ideal place to use the Y.io function // however, this does not support data encoded using the @@ -421,13 +736,13 @@ M.form_dndupload.init = function(Y, options) { var self = this; xhr.onreadystatechange = function() { // Process the server response if (xhr.readyState == 4) { - self.hide_progress_spinner(); if (xhr.status == 200) { var result = JSON.parse(xhr.responseText); if (result) { if (result.error) { - alert(result.error); - } else if (self.callback) { + self.print_msg(result.error, 'error'); // TODO add filename? + self.uploadfinished(); + } else { // Only update the filepicker if there were no errors if (result.event == 'fileexists') { // Do not worry about this, as we only care about the last @@ -435,45 +750,51 @@ M.form_dndupload.init = function(Y, options) { result.file = result.newfile.filename; result.url = result.newfile.url; } - result.client_id = self.clientid; - self.callback(result); - } else { - self.update_filemanager(); + result.client_id = self.options.clientid; } } + self.do_upload(result); // continue uploading } else { - alert(M.util.get_string('serverconnection', 'error')); + self.print_msg(M.util.get_string('serverconnection', 'error'), 'error'); + self.uploadfinished(); } } }; // Prepare the data to send var formdata = new FormData(); + formdata.append('action', 'upload'); formdata.append('repo_upload_file', file); // The FormData class allows us to attach a file formdata.append('sesskey', M.cfg.sesskey); formdata.append('repo_id', this.repositoryid); - formdata.append('itemid', this.itemid); - if (this.author) { - formdata.append('author', this.author); + formdata.append('itemid', this.options.itemid); + if (this.options.author) { + formdata.append('author', this.options.author); } - if (this.filemanager) { // Filepickers do not have folders - formdata.append('savepath', this.filemanager.currentpath); + if (this.options.filemanager) { // Filepickers do not have folders + formdata.append('savepath', this.options.filemanager.currentpath); + } + formdata.append('title', filename); + if (overwrite) { + formdata.append('overwrite', 1); } - if (this.acceptedtypes.constructor == Array) { - for (var i=0; i'+stripHTML(o.responseText)+'', 'invalidjson') + Y.error(M.str.repository.invalidjson+":\n"+o.responseText); return; } if (data && data.tree && scope.set_current_tree) { @@ -262,16 +261,12 @@ M.form_filemanager.init = function(Y, options) { var button_addfile = this.filemanager.one('.fp-btn-add'); // setup 'add file' button - // if maxfiles == -1, the no limit - button_addfile.on('click', function(e) { - e.preventDefault(); - var options = this.filepicker_options; - options.formcallback = this.filepicker_callback; - // XXX: magic here, to let filepicker use filemanager scope - options.magicscope = this; - options.savepath = this.currentpath; - M.core_filepicker.show(Y, options); - }, this); + button_addfile.on('click', this.show_filepicker, this); + + var dndarrow = this.filemanager.one('.dndupload-arrow'); + if (dndarrow) { + dndarrow.on('click', this.show_filepicker, this); + } // setup 'make a folder' button if (this.options.subdirs) { @@ -370,6 +365,18 @@ M.form_filemanager.init = function(Y, options) { } }, this); }, + + show_filepicker: function (e) { + // if maxfiles == -1, the no limit + e.preventDefault(); + var options = this.filepicker_options; + options.formcallback = this.filepicker_callback; + // XXX: magic here, to let filepicker use filemanager scope + options.magicscope = this; + options.savepath = this.currentpath; + M.core_filepicker.show(Y, options); + }, + print_path: function() { var p = this.options.path; this.pathbar.setContent('').addClass('empty'); @@ -825,8 +832,8 @@ M.form_filemanager.init = function(Y, options) { e.preventDefault(); var params = {}; var fileinfo = this.selectui.fileinfo; - if (fileinfo.type == 'folder') { - // this button should not even be shown for folders + if (!this.enablemainfile || fileinfo.type == 'folder') { + // this button should not even be shown for folders or when mainfile is disabled return; } params['filepath'] = fileinfo.filepath; diff --git a/lib/form/filepicker.php b/lib/form/filepicker.php index bcee75d22a8..58253bbe6c9 100644 --- a/lib/form/filepicker.php +++ b/lib/form/filepicker.php @@ -76,7 +76,7 @@ class MoodleQuickForm_filepicker extends HTML_QuickForm_input { $fpmaxbytes = $options['maxbytes']; } $coursemaxbytes = 0; - if (!empty($PAGE->course)) { + if (!empty($PAGE->course->maxbytes)) { $coursemaxbytes = $PAGE->course->maxbytes; } $this->_options['maxbytes'] = get_user_max_upload_file_size($PAGE->context, $CFG->maxbytes, $coursemaxbytes, $fpmaxbytes); @@ -207,7 +207,10 @@ class MoodleQuickForm_filepicker extends HTML_QuickForm_input { $usercontext = get_context_instance(CONTEXT_USER, $USER->id); if ($files = $fs->get_area_files($usercontext->id, 'user', 'draft', $draftitemid, 'id DESC', false)) { $file = array_shift($files); - if ($this->_options['maxbytes'] and $file->get_filesize() > $this->_options['maxbytes']) { + if ($this->_options['maxbytes'] + and $this->_options['maxbytes'] !== USER_CAN_IGNORE_FILE_SIZE_LIMITS + and $file->get_filesize() > $this->_options['maxbytes']) { + // bad luck, somebody tries to sneak in oversized file $file->delete(); } diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 6978a424b7c..2dd1f58addf 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -473,6 +473,11 @@ define('HUB_MOODLEORGHUBURL', "http://hub.moodle.org"); */ define('MOODLE_OFFICIAL_MOBILE_SERVICE', 'moodle_mobile_app'); +/** + * Indicates the user has the capabilities required to ignore activity and course file size restrictions + */ +define('USER_CAN_IGNORE_FILE_SIZE_LIMITS', -1); + /// PARAMETER HANDLING //////////////////////////////////////////////////// /** @@ -5860,10 +5865,9 @@ function get_user_max_upload_file_size($context, $sitebytes=0, $coursebytes=0, $ $user = $USER; } - // Temp. commenting this until MDL-27156 fixes it! - // if (has_capability('moodle/course:ignorefilesizelimits', $context, $user)) { - // return -1; - // } + if (has_capability('moodle/course:ignorefilesizelimits', $context, $user)) { + return USER_CAN_IGNORE_FILE_SIZE_LIMITS; + } return get_max_upload_file_size($sitebytes, $coursebytes, $modulebytes); } @@ -6045,6 +6049,10 @@ function display_size($size) { static $gb, $mb, $kb, $b; + if ($size === USER_CAN_IGNORE_FILE_SIZE_LIMITS) { + return get_string('unlimited'); + } + if (empty($gb)) { $gb = get_string('sizegb'); $mb = get_string('sizemb'); diff --git a/lib/outputrequirementslib.php b/lib/outputrequirementslib.php index c4fdd8f200c..6ad4bead7e0 100644 --- a/lib/outputrequirementslib.php +++ b/lib/outputrequirementslib.php @@ -500,8 +500,8 @@ class page_requirements_manager { case 'core_dndupload': $module = array('name' => 'core_dndupload', 'fullpath' => '/lib/form/dndupload.js', - 'requires' => array('node', 'event', 'json'), - 'strings' => array(array('uploadformlimit', 'moodle'), array('droptoupload', 'moodle'), array('maxfilesreached', 'moodle'), array('dndenabled_inbox', 'moodle'))); + 'requires' => array('node', 'event', 'json', 'core_filepicker'), + 'strings' => array(array('uploadformlimit', 'moodle'), array('droptoupload', 'moodle'), array('maxfilesreached', 'moodle'), array('dndenabled_inbox', 'moodle'), array('fileexists', 'moodle'))); break; } @@ -749,7 +749,7 @@ class page_requirements_manager { if (!is_array($modules)) { $modules = array($modules); } - if (empty($CFG->useexternalyui) || true) { + if (empty($CFG->useexternalyui)) { // We need to set the M.yui.galleryversion to the correct version $jscode = 'M.yui.galleryversion='.json_encode($galleryversion).';'; } else { diff --git a/lib/portfolio/forms.php b/lib/portfolio/forms.php index 7b7c66908ed..2e95777326d 100644 --- a/lib/portfolio/forms.php +++ b/lib/portfolio/forms.php @@ -199,13 +199,9 @@ final class portfolio_admin_form extends moodleform { // let the plugin add the fields they want (either statically or not) if (portfolio_static_function($this->plugin, 'has_admin_config')) { - if (!$this->instance) { - require_once($CFG->libdir . '/portfolio/plugin.php'); - require_once($CFG->dirroot . '/portfolio/' . $this->plugin . '/lib.php'); - call_user_func(array('portfolio_plugin_' . $this->plugin, 'admin_config_form'), $mform); - } else { - $this->instance->admin_config_form($mform); - } + require_once($CFG->libdir . '/portfolio/plugin.php'); + require_once($CFG->dirroot . '/portfolio/' . $this->plugin . '/lib.php'); + call_user_func(array('portfolio_plugin_' . $this->plugin, 'admin_config_form'), $mform); } // and set the data if we have some. @@ -237,12 +233,7 @@ final class portfolio_admin_form extends moodleform { } $pluginerrors = array(); - if ($this->instance) { - $pluginerrors = $this->instance->admin_config_validation($data); - } - else { - $pluginerrors = portfolio_static_function($this->plugin, 'admin_config_validation', $data); - } + $pluginerrors = portfolio_static_function($this->plugin, 'admin_config_validation', $data); if (is_array($pluginerrors)) { $errors = array_merge($errors, $pluginerrors); } diff --git a/lib/portfolio/plugin.php b/lib/portfolio/plugin.php index 6c32ffc6420..34c40c8d3fd 100644 --- a/lib/portfolio/plugin.php +++ b/lib/portfolio/plugin.php @@ -347,7 +347,7 @@ abstract class portfolio_plugin_base { * * @param moodleform $mform passed by reference, add elements to it. */ - public function admin_config_form(&$mform) {} + public static function admin_config_form(&$mform) {} /** * Just like the moodle form validation function, @@ -356,7 +356,7 @@ abstract class portfolio_plugin_base { * * @param array $data data from form. */ - public function admin_config_validation($data) {} + public static function admin_config_validation($data) {} /** * mform to display to the user exporting data using this plugin. diff --git a/lib/tests/csslib_test.php b/lib/tests/csslib_test.php index c5f12233b8b..f00a88f7838 100644 --- a/lib/tests/csslib_test.php +++ b/lib/tests/csslib_test.php @@ -213,6 +213,16 @@ class css_optimiser_testcase extends advanced_testcase { $css = '#filesskin .yui3-widget-hd{background:#CCC;background:-webkit-gradient(linear, left top, left bottom, from(#FFFFFF), to(#CCCCCC));background:-moz-linear-gradient(top, #FFFFFF, #CCCCCC);}'; $this->assertEquals($css, $optimiser->process($css)); + + $css = '.userenrolment{background:-moz-linear-gradient(top, #FFFFFF, #CCCCCC) !important;}'; + $this->assertEquals($css, $optimiser->process($css)); + + $css = '.userenrolment{background:#CCC !important;background:-webkit-gradient(linear, left top, left bottom, from(#FFFFFF), to(#CCCCCC)) !important;background:-moz-linear-gradient(top, #FFFFFF, #CCCCCC) !important;}'; + $this->assertEquals($css, $optimiser->process($css)); + + $cssin = '.userenrolment{background:-moz-linear-gradient(top, #FFFFFF, #CCCCCC) !important;}.userenrolment {background: #CCCCCC!important;background: -webkit-gradient(linear, left top, left bottom, from(#FFFFFF), to(#CCCCCC))!important;}'; + $cssout = '.userenrolment{background:#CCC !important;background:-moz-linear-gradient(top, #FFFFFF, #CCCCCC) !important;background:-webkit-gradient(linear, left top, left bottom, from(#FFFFFF), to(#CCCCCC)) !important;}'; + $this->assertEquals($cssout, $optimiser->process($cssin)); } /** diff --git a/lib/tests/mathslib_test.php b/lib/tests/mathslib_test.php index 1df41fe4edd..e7a7ff85858 100644 --- a/lib/tests/mathslib_test.php +++ b/lib/tests/mathslib_test.php @@ -231,4 +231,10 @@ class mathsslib_testcase extends basic_testcase { $this->assertEquals($formula->evaluate(), 1e22, '', 1e22*1e-15); } + + public function test_rand_float() { + $formula = new calc_formula('=rand_float()'); + $result = $formula->evaluate(); + $this->assertTrue(is_float($result)); + } } diff --git a/lib/xmldb/xmldb_constants.php b/lib/xmldb/xmldb_constants.php index 347f728671d..de3f0c935e5 100644 --- a/lib/xmldb/xmldb_constants.php +++ b/lib/xmldb/xmldb_constants.php @@ -1,72 +1,92 @@ . -/////////////////////////////////////////////////////////////////////////// -// // -// NOTICE OF COPYRIGHT // -// // -// Moodle - Modular Object-Oriented Dynamic Learning Environment // -// http://moodle.com // -// // -// Copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com // -// (C) 2001-3001 Eloy Lafuente (stronk7) http://contiento.com // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation; either version 2 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License for more details: // -// // -// http://www.gnu.org/copyleft/gpl.html // -// // -/////////////////////////////////////////////////////////////////////////// +/** + * This file contains all the constants and variables used + * by the XMLDB interface + * + * @package core_xmldb + * @copyright 1999 onwards Martin Dougiamas http://dougiamas.com + * 2001-3001 Eloy Lafuente (stronk7) http://contiento.com + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ -/// This file contains all the constants and variables used -/// by the XMLDB interface +defined('MOODLE_INTERNAL') || die(); -/// First, some constants to be used by actions - define('ACTION_NONE', 0); //Default flags for class - define('ACTION_GENERATE_HTML', 1); //The invoke function will return HTML - define('ACTION_GENERATE_XML', 2); //The invoke function will return HTML - define('ACTION_HAVE_SUBACTIONS', 1); //The class can have subaction -/// Now the allowed DB Field Types - define ('XMLDB_TYPE_INCORRECT', 0); //Wrong DB Type - define ('XMLDB_TYPE_INTEGER', 1); //Integer - define ('XMLDB_TYPE_NUMBER', 2); //Decimal number - define ('XMLDB_TYPE_FLOAT', 3); //Floating Point number - define ('XMLDB_TYPE_CHAR', 4); //String - define ('XMLDB_TYPE_TEXT', 5); //Text - define ('XMLDB_TYPE_BINARY', 6); //Binary - define ('XMLDB_TYPE_DATETIME', 7); //Datetime - define ('XMLDB_TYPE_TIMESTAMP', 8); //Timestamp +// ==== First, some constants to be used by actions ==== +/** Default flags for class */ +define('ACTION_NONE', 0); +/** The invoke function will return HTML */ +define('ACTION_GENERATE_HTML', 1); +/** The invoke function will return HTML */ +define('ACTION_GENERATE_XML', 2); +/** The class can have subaction */ +define('ACTION_HAVE_SUBACTIONS', 1); -/// Now the allowed DB Keys - define ('XMLDB_KEY_INCORRECT', 0); //Wrong DB Key - define ('XMLDB_KEY_PRIMARY', 1); //Primary Keys - define ('XMLDB_KEY_UNIQUE', 2); //Unique Keys - define ('XMLDB_KEY_FOREIGN', 3); //Foreign Keys - define ('XMLDB_KEY_CHECK', 4); //Check Constraints - NOT USED! - define ('XMLDB_KEY_FOREIGN_UNIQUE',5); //Foreign Key + Unique Key +// ==== Now the allowed DB Field Types ==== +/** Wrong DB Type */ +define ('XMLDB_TYPE_INCORRECT', 0); +/** Integer */ +define ('XMLDB_TYPE_INTEGER', 1); +/** Decimal number */ +define ('XMLDB_TYPE_NUMBER', 2); +/** Floating Point number */ +define ('XMLDB_TYPE_FLOAT', 3); +/** String */ +define ('XMLDB_TYPE_CHAR', 4); +/** Text */ +define ('XMLDB_TYPE_TEXT', 5); +/** Binary */ +define ('XMLDB_TYPE_BINARY', 6); +/** Datetime */ +define ('XMLDB_TYPE_DATETIME', 7); +/** Timestamp */ +define ('XMLDB_TYPE_TIMESTAMP', 8); -/// Now the allowed Statement Types - define ('XMLDB_STATEMENT_INCORRECT', 0); //Wrong Statement Type - define ('XMLDB_STATEMENT_INSERT', 1); //Insert Statements - define ('XMLDB_STATEMENT_UPDATE', 2); //Update Statements - define ('XMLDB_STATEMENT_DELETE', 3); //Delete Statements - define ('XMLDB_STATEMENT_CUSTOM', 4); //Custom Statements +// ==== Now the allowed DB Keys ==== +/** Wrong DB Key */ +define ('XMLDB_KEY_INCORRECT', 0); +/** Primary Keys */ +define ('XMLDB_KEY_PRIMARY', 1); +/** Unique Keys */ +define ('XMLDB_KEY_UNIQUE', 2); +/** Foreign Keys */ +define ('XMLDB_KEY_FOREIGN', 3); +/** Check Constraints - NOT USED! */ +define ('XMLDB_KEY_CHECK', 4); +/** Foreign Key + Unique Key */ +define ('XMLDB_KEY_FOREIGN_UNIQUE',5); -/// Some other useful Constants - define ('XMLDB_UNSIGNED', true); //If the field is going to be unsigned @deprecated since 2.3 - define ('XMLDB_NOTNULL', true); //If the field is going to be not null - define ('XMLDB_SEQUENCE', true); //If the field is going to be a sequence - define ('XMLDB_INDEX_UNIQUE', true); //If the index is going to be unique - define ('XMLDB_INDEX_NOTUNIQUE',false); //If the index is NOT going to be unique +// ==== Some other useful Constants ==== +/** If the field is going to be unsigned @deprecated since 2.3 */ +define ('XMLDB_UNSIGNED', true); +/** If the field is going to be not null */ +define ('XMLDB_NOTNULL', true); +/** If the field is going to be a sequence */ +define ('XMLDB_SEQUENCE', true); +/** If the index is going to be unique */ +define ('XMLDB_INDEX_UNIQUE', true); +/** If the index is NOT going to be unique */ +define ('XMLDB_INDEX_NOTUNIQUE',false); -/// Some strings used widely - define ('XMLDB_LINEFEED', "\n"); - define ('XMLDB_PHP_HEADER', ' if ($oldversion < XXXXXXXXXX) {' . XMLDB_LINEFEED); - define ('XMLDB_PHP_FOOTER', ' }' . XMLDB_LINEFEED); +// ==== Some strings used widely ==== +/** New line in xmldb generated files */ +define ('XMLDB_LINEFEED', "\n"); +/** Upgrade start in upgrade.php */ +define ('XMLDB_PHP_HEADER', ' if ($oldversion < XXXXXXXXXX) {' . XMLDB_LINEFEED); +/** Upgrade end in upgrade.php */ +define ('XMLDB_PHP_FOOTER', ' }' . XMLDB_LINEFEED); diff --git a/lib/xmldb/xmldb_field.php b/lib/xmldb/xmldb_field.php index 11e7a2d39a1..ce919d92bb1 100644 --- a/lib/xmldb/xmldb_field.php +++ b/lib/xmldb/xmldb_field.php @@ -1,39 +1,50 @@ . -/////////////////////////////////////////////////////////////////////////// -// // -// NOTICE OF COPYRIGHT // -// // -// Moodle - Modular Object-Oriented Dynamic Learning Environment // -// http://moodle.com // -// // -// Copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com // -// (C) 2001-3001 Eloy Lafuente (stronk7) http://contiento.com // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation; either version 2 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License for more details: // -// // -// http://www.gnu.org/copyleft/gpl.html // -// // -/////////////////////////////////////////////////////////////////////////// +/** + * This class represent one XMLDB Field + * + * @package core_xmldb + * @copyright 1999 onwards Martin Dougiamas http://dougiamas.com + * 2001-3001 Eloy Lafuente (stronk7) http://contiento.com + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); -/// This class represent one XMLDB Field class xmldb_field extends xmldb_object { - var $type; - var $length; - var $notnull; - var $default; - var $sequence; - var $decimals; + /** @var int XMLDB_TYPE_ constants */ + protected $type; + + /** @var int size of field */ + protected $length; + + /** @var bool is null forbidden? XMLDB_NOTNULL */ + protected $notnull; + + /** @var mixed default value */ + protected $default; + + /** @var bool use automatic counter */ + protected $sequence; + + /** @var int number of decimals */ + protected $decimals; /** * Note: @@ -72,14 +83,22 @@ class xmldb_field extends xmldb_object { /** * Creates one new xmldb_field + * @param string $name of field + * @param int $type XMLDB_TYPE_INTEGER, XMLDB_TYPE_NUMBER, XMLDB_TYPE_CHAR, XMLDB_TYPE_TEXT, XMLDB_TYPE_BINARY + * @param string $precision length for integers and chars, two-comma separated numbers for numbers + * @param bool $unsigned XMLDB_UNSIGNED or null (or false) + * @param bool $notnull XMLDB_NOTNULL or null (or false) + * @param bool $sequence XMLDB_SEQUENCE or null (or false) + * @param mixed $default meaningful default o null (or false) + * @param xmldb_object $previous */ - function __construct($name, $type=null, $precision=null, $unsigned=null, $notnull=null, $sequence=null, $default=null, $previous=null) { - $this->type = NULL; - $this->length = NULL; + public function __construct($name, $type=null, $precision=null, $unsigned=null, $notnull=null, $sequence=null, $default=null, $previous=null) { + $this->type = null; + $this->length = null; $this->notnull = false; - $this->default = NULL; + $this->default = null; $this->sequence = false; - $this->decimals = NULL; + $this->decimals = null; parent::__construct($name); $this->set_attributes($type, $precision, $unsigned, $notnull, $sequence, $default, $previous); } @@ -87,14 +106,15 @@ class xmldb_field extends xmldb_object { /** * Set all the attributes of one xmldb_field * - * @param string type XMLDB_TYPE_INTEGER, XMLDB_TYPE_NUMBER, XMLDB_TYPE_CHAR, XMLDB_TYPE_TEXT, XMLDB_TYPE_BINARY - * @param string precision length for integers and chars, two-comma separated numbers for numbers - * @param string unsigned XMLDB_UNSIGNED or null (or false) - * @param string notnull XMLDB_NOTNULL or null (or false) - * @param string sequence XMLDB_SEQUENCE or null (or false) - * @param string default meaningful default o null (or false) + * @param int $type XMLDB_TYPE_INTEGER, XMLDB_TYPE_NUMBER, XMLDB_TYPE_CHAR, XMLDB_TYPE_TEXT, XMLDB_TYPE_BINARY + * @param string $precision length for integers and chars, two-comma separated numbers for numbers + * @param bool $unsigned XMLDB_UNSIGNED or null (or false) + * @param bool $notnull XMLDB_NOTNULL or null (or false) + * @param bool $sequence XMLDB_SEQUENCE or null (or false) + * @param mixed $default meaningful default o null (or false) + * @param xmldb_object $previous */ - function set_attributes($type, $precision=null, $unsigned=null, $notnull=null, $sequence=null, $default=null, $previous=null) { + public function set_attributes($type, $precision=null, $unsigned=null, $notnull=null, $sequence=null, $default=null, $previous=null) { $this->type = $type; /// Try to split the precision into length and decimals and apply /// each one as needed @@ -120,108 +140,122 @@ class xmldb_field extends xmldb_object { /** * Get the type + * @return int */ - function getType() { + public function getType() { return $this->type; } /** * Get the length + * @return int */ - function getLength() { + public function getLength() { return $this->length; } /** * Get the decimals + * @return string */ - function getDecimals() { + public function getDecimals() { return $this->decimals; } /** * Get the notnull + * @return bool */ - function getNotNull() { + public function getNotNull() { return $this->notnull; } /** * Get the unsigned * @deprecated since moodle 2.3 + * @return bool */ - function getUnsigned() { + public function getUnsigned() { return false; } /** * Get the sequence + * @return bool */ - function getSequence() { + public function getSequence() { return $this->sequence; } /** * Get the default + * @return mixed */ - function getDefault() { + public function getDefault() { return $this->default; } /** * Set the field type + * @param int $type */ - function setType($type) { + public function setType($type) { $this->type = $type; } /** * Set the field length + * @param int $length */ - function setLength($length) { + public function setLength($length) { $this->length = $length; } /** * Set the field decimals + * @param string */ - function setDecimals($decimals) { + public function setDecimals($decimals) { $this->decimals = $decimals; } /** * Set the field unsigned * @deprecated since moodle 2.3 + * @param bool $unsigned */ - function setUnsigned($unsigned=true) { + public function setUnsigned($unsigned=true) { } /** * Set the field notnull + * @param bool $notnull */ - function setNotNull($notnull=true) { + public function setNotNull($notnull=true) { $this->notnull = $notnull; } /** * Set the field sequence + * @param bool $sequence */ - function setSequence($sequence=true) { + public function setSequence($sequence=true) { $this->sequence = $sequence; } /** * Set the field default + * @param mixed $default */ - function setDefault($default) { - /// Check, warn and auto-fix '' (empty) defaults for CHAR NOT NULL columns, changing them - /// to NULL so XMLDB will apply the proper default + public function setDefault($default) { + // Check, warn and auto-fix '' (empty) defaults for CHAR NOT NULL columns, changing them + // to NULL so XMLDB will apply the proper default if ($this->type == XMLDB_TYPE_CHAR && $this->notnull && $default === '') { $this->errormsg = 'XMLDB has detected one CHAR NOT NULL column (' . $this->name . ") with '' (empty string) as DEFAULT value. This type of columns must have one meaningful DEFAULT declared or none (NULL). XMLDB have fixed it automatically changing it to none (NULL). The process will continue ok and proper defaults will be created accordingly with each DB requirements. Please fix it in source (XML and/or upgrade script) to avoid this message to be displayed."; $this->debug($this->errormsg); $default = null; } - /// Check, warn and autofix TEXT|BINARY columns having a default clause (only null is allowed) + // Check, warn and autofix TEXT|BINARY columns having a default clause (only null is allowed) if (($this->type == XMLDB_TYPE_TEXT || $this->type == XMLDB_TYPE_BINARY) && $default !== null) { $this->errormsg = 'XMLDB has detected one TEXT/BINARY column (' . $this->name . ") with some DEFAULT defined. This type of columns cannot have any default value. Please fix it in source (XML and/or upgrade script) to avoid this message to be displayed."; $this->debug($this->errormsg); @@ -232,18 +266,20 @@ class xmldb_field extends xmldb_object { /** * Load data from XML to the table + * @param array $xmlarr + * @return mixed */ - function arr2xmldb_field($xmlarr) { + public function arr2xmldb_field($xmlarr) { $result = true; - /// Debug the table - /// traverse_xmlize($xmlarr); //Debug - /// print_object ($GLOBALS['traverse_array']); //Debug - /// $GLOBALS['traverse_array']=""; //Debug + // Debug the table + // traverse_xmlize($xmlarr); //Debug + // print_object ($GLOBALS['traverse_array']); //Debug + // $GLOBALS['traverse_array']=""; //Debug - /// Process table attributes (name, type, length - /// notnull, sequence, decimals, comment, previous, next) + // Process table attributes (name, type, length + // notnull, sequence, decimals, comment, previous, next) if (isset($xmlarr['@']['NAME'])) { $this->name = trim($xmlarr['@']['NAME']); } else { @@ -253,7 +289,7 @@ class xmldb_field extends xmldb_object { } if (isset($xmlarr['@']['TYPE'])) { - /// Check for valid type + // Check for valid type $type = $this->getXMLDBFieldType(trim($xmlarr['@']['TYPE'])); if ($type) { $this->type = $type; @@ -270,7 +306,7 @@ class xmldb_field extends xmldb_object { if (isset($xmlarr['@']['LENGTH'])) { $length = trim($xmlarr['@']['LENGTH']); - /// Check for integer values + // Check for integer values if ($this->type == XMLDB_TYPE_INTEGER || $this->type == XMLDB_TYPE_NUMBER || $this->type == XMLDB_TYPE_CHAR) { @@ -284,12 +320,12 @@ class xmldb_field extends xmldb_object { $result = false; } } - /// Remove length from text and binary + // Remove length from text and binary if ($this->type == XMLDB_TYPE_TEXT || $this->type == XMLDB_TYPE_BINARY) { $length = null; } - /// Finally, set the length + // Finally, set the length $this->length = $length; } @@ -323,10 +359,10 @@ class xmldb_field extends xmldb_object { $this->setDefault(trim($xmlarr['@']['DEFAULT'])); } - $decimals = NULL; + $decimals = null; if (isset($xmlarr['@']['DECIMALS'])) { $decimals = trim($xmlarr['@']['DECIMALS']); - /// Check for integer values + // Check for integer values if ($this->type == XMLDB_TYPE_NUMBER || $this->type == XMLDB_TYPE_FLOAT) { if (!(is_numeric($decimals)&&(intval($decimals)==floatval($decimals)))) { @@ -348,7 +384,7 @@ class xmldb_field extends xmldb_object { $decimals = 0; } } - // Finally, set the decimals + // Finally, set the decimals if ($this->type == XMLDB_TYPE_NUMBER || $this->type == XMLDB_TYPE_FLOAT) { $this->decimals = $decimals; @@ -366,7 +402,7 @@ class xmldb_field extends xmldb_object { $this->next = trim($xmlarr['@']['NEXT']); } - /// Set some attributes + // Set some attributes if ($result) { $this->loaded = true; } @@ -377,8 +413,10 @@ class xmldb_field extends xmldb_object { /** * This function returns the correct XMLDB_TYPE_XXX value for the * string passed as argument + * @param string $type + * @return int */ - function getXMLDBFieldType($type) { + public function getXMLDBFieldType($type) { $result = XMLDB_TYPE_INCORRECT; @@ -405,15 +443,17 @@ class xmldb_field extends xmldb_object { $result = XMLDB_TYPE_DATETIME; break; } - /// Return the normalized XMLDB_TYPE + // Return the normalized XMLDB_TYPE return $result; } /** * This function returns the correct name value for the * XMLDB_TYPE_XXX passed as argument + * @param int $type + * @return string */ - function getXMLDBTypeName($type) { + public function getXMLDBTypeName($type) { $result = ""; @@ -440,16 +480,18 @@ class xmldb_field extends xmldb_object { $result = 'datetime'; break; } - /// Return the normalized name + // Return the normalized name return $result; } /** * This function calculate and set the hash of one xmldb_field + * @param bool $recursive + * @return void, modifies $this->hash */ - function calculateHash($recursive = false) { + public function calculateHash($recursive = false) { if (!$this->loaded) { - $this->hash = NULL; + $this->hash = null; } else { $key = $this->name . $this->type . $this->length . $this->notnull . $this->sequence . @@ -459,9 +501,10 @@ class xmldb_field extends xmldb_object { } /** - *This function will output the XML text for one field + * This function will output the XML text for one field + * @return string */ - function xmlOutput() { + public function xmlOutput() { $o = ''; $o.= ' getXMLDBTypeName($this->type) . '"'; @@ -474,7 +517,7 @@ class xmldb_field extends xmldb_object { $notnull = 'false'; } $o.= ' NOTNULL="' . $notnull . '"'; - if (!$this->sequence && $this->default !== NULL) { + if (!$this->sequence && $this->default !== null) { $o.= ' DEFAULT="' . $this->default . '"'; } if ($this->sequence) { @@ -483,7 +526,7 @@ class xmldb_field extends xmldb_object { $sequence = 'false'; } $o.= ' SEQUENCE="' . $sequence . '"'; - if ($this->decimals !== NULL) { + if ($this->decimals !== null) { $o.= ' DECIMALS="' . $this->decimals . '"'; } if ($this->comment) { @@ -503,10 +546,12 @@ class xmldb_field extends xmldb_object { /** * This function will set all the attributes of the xmldb_field object * based on information passed in one ADOField + * @param string $adofield + * @return void, sets $this->type */ - function setFromADOField($adofield) { + public function setFromADOField($adofield) { - /// Calculate the XMLDB_TYPE + // Calculate the XMLDB_TYPE switch (strtolower($adofield->type)) { case 'int': case 'tinyint': @@ -549,7 +594,7 @@ class xmldb_field extends xmldb_object { default: $this->type = XMLDB_TYPE_TEXT; } - /// Calculate the length of the field + // Calculate the length of the field if ($adofield->max_length > 0 && ($this->type == XMLDB_TYPE_INTEGER || $this->type == XMLDB_TYPE_NUMBER || @@ -563,38 +608,40 @@ class xmldb_field extends xmldb_object { if ($this->type == XMLDB_TYPE_BINARY) { $this->length = null; } - /// Calculate the decimals of the field + // Calculate the decimals of the field if ($adofield->max_length > 0 && $adofield->scale && ($this->type == XMLDB_TYPE_NUMBER || $this->type == XMLDB_TYPE_FLOAT)) { $this->decimals = $adofield->scale; } - /// Calculate the notnull field + // Calculate the notnull field if ($adofield->not_null) { $this->notnull = true; } - /// Calculate the default field + // Calculate the default field if ($adofield->has_default) { $this->default = $adofield->default_value; } - /// Calculate the sequence field + // Calculate the sequence field if ($adofield->auto_increment) { $this->sequence = true; } - /// Some more fields + // Some more fields $this->loaded = true; $this->changed = true; } /** * Returns the PHP code needed to define one xmldb_field + * @param bool $includeprevious + * @return string */ - function getPHP($includeprevious=true) { + public function getPHP($includeprevious=true) { $result = ''; - /// The XMLDBTYPE + // The XMLDBTYPE switch ($this->getType()) { case XMLDB_TYPE_INTEGER: $result .= 'XMLDB_TYPE_INTEGER' . ', '; @@ -621,7 +668,7 @@ class xmldb_field extends xmldb_object { $result .= 'XMLDB_TYPE_TIMESTAMP' . ', '; break; } - /// The length + // The length $length = $this->getLength(); $decimals = $this->getDecimals(); if (!empty($length)) { @@ -633,30 +680,30 @@ class xmldb_field extends xmldb_object { } else { $result .= 'null, '; } - /// Unsigned is not used any more since Moodle 2.3 + // Unsigned is not used any more since Moodle 2.3 $result .= 'null, '; - /// Not Null + // Not Null $notnull = $this->getNotnull(); if (!empty($notnull)) { $result .= 'XMLDB_NOTNULL' . ', '; } else { $result .= 'null, '; } - /// Sequence + // Sequence $sequence = $this->getSequence(); if (!empty($sequence)) { $result .= 'XMLDB_SEQUENCE' . ', '; } else { $result .= 'null, '; } - /// Default + // Default $default = $this->getDefault(); if ($default !== null && !$this->getSequence()) { $result .= "'" . $default . "'"; } else { $result .= 'null'; } - /// Previous (decided by parameter) + // Previous (decided by parameter) if ($includeprevious) { $previous = $this->getPrevious(); if (!empty($previous)) { @@ -665,18 +712,19 @@ class xmldb_field extends xmldb_object { $result .= ', null'; } } - /// Return result + // Return result return $result; } /** * Shows info in a readable format + * @return string */ - function readableInfo() { + public function readableInfo() { $o = ''; - /// type + // type $o .= $this->getXMLDBTypeName($this->type); - /// length + // length if ($this->type == XMLDB_TYPE_INTEGER || $this->type == XMLDB_TYPE_NUMBER || $this->type == XMLDB_TYPE_FLOAT || @@ -685,19 +733,19 @@ class xmldb_field extends xmldb_object { $o .= ' (' . $this->length; if ($this->type == XMLDB_TYPE_NUMBER || $this->type == XMLDB_TYPE_FLOAT) { - if ($this->decimals !== NULL) { + if ($this->decimals !== null) { $o .= ', ' . $this->decimals; } } $o .= ')'; } } - /// not null + // not null if ($this->notnull) { $o .= ' not null'; } - /// default - if ($this->default !== NULL) { + // default + if ($this->default !== null) { $o .= ' default '; if ($this->type == XMLDB_TYPE_CHAR || $this->type == XMLDB_TYPE_TEXT) { @@ -706,7 +754,7 @@ class xmldb_field extends xmldb_object { $o .= $this->default; } } - /// sequence + // sequence if ($this->sequence) { $o .= ' auto-numbered'; } @@ -723,7 +771,7 @@ class xmldb_field extends xmldb_object { * @param xmldb_table $xmldb_table optional when object is table * @return string null if ok, error message if problem found */ - function validateDefinition(xmldb_table $xmldb_table=null) { + public function validateDefinition(xmldb_table $xmldb_table=null) { if (!$xmldb_table) { return 'Invalid xmldb_field->validateDefinition() call, $xmldb_table is required.'; } diff --git a/lib/xmldb/xmldb_file.php b/lib/xmldb/xmldb_file.php index 92fa9b162b4..67acce05381 100644 --- a/lib/xmldb/xmldb_file.php +++ b/lib/xmldb/xmldb_file.php @@ -1,51 +1,60 @@ . -/////////////////////////////////////////////////////////////////////////// -// // -// NOTICE OF COPYRIGHT // -// // -// Moodle - Modular Object-Oriented Dynamic Learning Environment // -// http://moodle.com // -// // -// Copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com // -// (C) 2001-3001 Eloy Lafuente (stronk7) http://contiento.com // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation; either version 2 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License for more details: // -// // -// http://www.gnu.org/copyleft/gpl.html // -// // -/////////////////////////////////////////////////////////////////////////// +/** + * This class represent one XMLDB file + * + * @package core_xmldb + * @copyright 1999 onwards Martin Dougiamas http://dougiamas.com + * 2001-3001 Eloy Lafuente (stronk7) http://contiento.com + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); -/// This class represents an entire XMLDB file class xmldb_file extends xmldb_object { - var $path; - var $schema; - var $dtd; - var $xmldb_structure; + /** @var string path to file */ + protected $path; + + /** @var string path to schema */ + protected $schema; + + /** @var string document dtd */ + protected $dtd; + + /** @var xmldb_structure the structure stored in file */ + protected $xmldb_structure; /** * Constructor of the xmldb_file + * @param string $path */ - function __construct($path) { + public function __construct($path) { parent::__construct($path); $this->path = $path; - $this->xmldb_structure = NULL; + $this->xmldb_structure = null; } /** * Determine if the XML file exists + * @return bool */ - function fileExists() { + public function fileExists() { if (file_exists($this->path) && is_readable($this->path)) { return true; } @@ -54,15 +63,16 @@ class xmldb_file extends xmldb_object { /** * Determine if the XML is writeable + * @return bool */ - function fileWriteable() { + public function fileWriteable() { if (is_writeable(dirname($this->path))) { return true; } return false; } - function &getStructure() { + public function getStructure() { return $this->xmldb_structure; } @@ -70,10 +80,11 @@ class xmldb_file extends xmldb_object { * This function will check/validate the XML file for correctness * Dynamically if will use the best available checker/validator * (expat syntax checker or DOM schema validator + * @return true */ - function validateXMLStructure() { + public function validateXMLStructure() { - /// Create and load XML file + // Create and load XML file $parser = new DOMDocument(); $contents = file_get_contents($this->path); if (strpos($contents, '')) { @@ -89,30 +100,30 @@ class xmldb_file extends xmldb_object { libxml_clear_errors(); $parser->loadXML($contents); - /// Only validate if we have a schema + // Only validate if we have a schema if (!empty($this->schema) && file_exists($this->schema)) { $parser->schemaValidate($this->schema); } - /// Check for errors + // Check for errors $errors = libxml_get_errors(); // Stop capturing errors libxml_use_internal_errors($olderrormode); - /// Prepare errors + // Prepare errors if (!empty($errors)) { - /// Create one structure to store errors + // Create one structure to store errors $structure = new xmldb_structure($this->path); - /// Add errors to structure + // Add errors to structure $structure->errormsg = 'XML Error: '; foreach ($errors as $error) { $structure->errormsg .= sprintf("%s at line %d. ", trim($error->message, "\n\r\t ."), $error->line); } - /// Add structure to file + // Add structure to file $this->xmldb_structure = $structure; - /// Check has failed + // Check has failed return false; } @@ -121,10 +132,11 @@ class xmldb_file extends xmldb_object { /** * Load and the XMLDB structure from file + * @return true */ - function loadXMLStructure() { + public function loadXMLStructure() { if ($this->fileExists()) { - /// Let's validate the XML file + // Let's validate the XML file if (!$this->validateXMLStructure()) { return false; } @@ -134,12 +146,12 @@ class xmldb_file extends xmldb_object { $contents = preg_replace('|.*|s', '', $contents); debugging('STATEMENTS section is not supported any more, please use db/install.php or db/log.php'); } - /// File exists, so let's process it - /// Load everything to a big array + // File exists, so let's process it + // Load everything to a big array $xmlarr = xmlize($contents); - /// Convert array to xmldb structure + // Convert array to xmldb structure $this->xmldb_structure = $this->arr2xmldb_structure($xmlarr); - /// Analize results + // Analyze results if ($this->xmldb_structure->isLoaded()) { $this->loaded = true; return true; @@ -152,8 +164,10 @@ class xmldb_file extends xmldb_object { /** * This function takes an xmlized array and put it into one xmldb_structure + * @param array $xmlarr + * @return xmldb_structure */ - function arr2xmldb_structure ($xmlarr) { + public function arr2xmldb_structure ($xmlarr) { $structure = new xmldb_structure($this->path); $structure->arr2xmldb_structure($xmlarr); return $structure; @@ -161,24 +175,27 @@ class xmldb_file extends xmldb_object { /** * This function sets the DTD of the XML file + * @param string */ - function setDTD($path) { + public function setDTD($path) { $this->dtd = $path; } /** * This function sets the schema of the XML file + * @param string */ - function setSchema($path) { + public function setSchema($path) { $this->schema = $path; } /** * This function saves the whole xmldb_structure to its file + * @return int|bool false on failure, number of written bytes on success */ - function saveXMLFile() { + public function saveXMLFile() { - $structure =& $this->getStructure(); + $structure = $this->getStructure(); $result = file_put_contents($this->path, $structure->xmlOutput()); diff --git a/lib/xmldb/xmldb_index.php b/lib/xmldb/xmldb_index.php index 8e02412d43c..c578a00d5e3 100644 --- a/lib/xmldb/xmldb_index.php +++ b/lib/xmldb/xmldb_index.php @@ -1,35 +1,38 @@ . -/////////////////////////////////////////////////////////////////////////// -// // -// NOTICE OF COPYRIGHT // -// // -// Moodle - Modular Object-Oriented Dynamic Learning Environment // -// http://moodle.com // -// // -// Copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com // -// (C) 2001-3001 Eloy Lafuente (stronk7) http://contiento.com // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation; either version 2 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License for more details: // -// // -// http://www.gnu.org/copyleft/gpl.html // -// // -/////////////////////////////////////////////////////////////////////////// +/** + * This class represent one XMLDB Index + * + * @package core_xmldb + * @copyright 1999 onwards Martin Dougiamas http://dougiamas.com + * 2001-3001 Eloy Lafuente (stronk7) http://contiento.com + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); -/// This class represent one XMLDB Index class xmldb_index extends xmldb_object { - var $unique; - var $fields; + /** @var bool is unique? */ + protected $unique; + + /** @var array index fields */ + protected $fields; /** * Note: @@ -49,12 +52,16 @@ class xmldb_index extends xmldb_object { /** * Creates one new xmldb_index + * + * @param string $name + * @param string type XMLDB_INDEX_UNIQUE, XMLDB_INDEX_NOTUNIQUE + * @param array fields an array of fieldnames to build the index over */ - function __construct($name, $type=null, $fields=array()) { + public function __construct($name, $type=null, $fields=array()) { $this->unique = false; $this->fields = array(); parent::__construct($name); - return $this->set_attributes($type, $fields); + $this->set_attributes($type, $fields); } /** @@ -63,52 +70,58 @@ class xmldb_index extends xmldb_object { * @param string type XMLDB_INDEX_UNIQUE, XMLDB_INDEX_NOTUNIQUE * @param array fields an array of fieldnames to build the index over */ - function set_attributes($type, $fields) { + public function set_attributes($type, $fields) { $this->unique = !empty($type) ? true : false; $this->fields = $fields; } /** * Get the index unique + * @return bool */ - function getUnique() { + public function getUnique() { return $this->unique; } /** * Set the index unique + * @param bool $unique */ - function setUnique($unique = true) { + public function setUnique($unique = true) { $this->unique = $unique; } /** * Set the index fields + * @param array $fields */ - function setFields($fields) { + public function setFields($fields) { $this->fields = $fields; } /** * Get the index fields + * @return array */ - function &getFields() { + public function getFields() { return $this->fields; } /** * Load data from XML to the index + * @param $xmlarr array + * @return bool */ - function arr2xmldb_index($xmlarr) { + public function arr2xmldb_index($xmlarr) { $result = true; - /// Debug the table - /// traverse_xmlize($xmlarr); //Debug - /// print_object ($GLOBALS['traverse_array']); //Debug - /// $GLOBALS['traverse_array']=""; //Debug + // Debug the table + // traverse_xmlize($xmlarr); //Debug + // print_object ($GLOBALS['traverse_array']); //Debug + // $GLOBALS['traverse_array']=""; //Debug - /// Process key attributes (name, unique, fields, comment, previous, next) + // Process key attributes (name, unique, fields, comment, previous, next) if (isset($xmlarr['@']['NAME'])) { $this->name = trim($xmlarr['@']['NAME']); } else { @@ -157,7 +170,7 @@ class xmldb_index extends xmldb_object { $this->debug($this->errormsg); $result = false; } - /// Finally, set the array of fields + // Finally, set the array of fields $this->fields = $fieldsarr; if (isset($xmlarr['@']['COMMENT'])) { @@ -172,7 +185,7 @@ class xmldb_index extends xmldb_object { $this->next = trim($xmlarr['@']['NEXT']); } - /// Set some attributes + // Set some attributes if ($result) { $this->loaded = true; } @@ -182,10 +195,11 @@ class xmldb_index extends xmldb_object { /** * This function calculate and set the hash of one xmldb_index + * @retur nvoid, changes $this->hash */ - function calculateHash($recursive = false) { + public function calculateHash($recursive = false) { if (!$this->loaded) { - $this->hash = NULL; + $this->hash = null; } else { $key = $this->unique . implode (', ', $this->fields); $this->hash = md5($key); @@ -194,8 +208,9 @@ class xmldb_index extends xmldb_object { /** *This function will output the XML text for one index + * @return string */ - function xmlOutput() { + public function xmlOutput() { $o = ''; $o.= ' unique) { @@ -222,56 +237,60 @@ class xmldb_index extends xmldb_object { /** * This function will set all the attributes of the xmldb_index object * based on information passed in one ADOindex + * @param array + * @return void */ - function setFromADOIndex($adoindex) { + public function setFromADOIndex($adoindex) { - /// Set the unique field + // Set the unique field $this->unique = false; - /// Set the fields, converting all them to lowercase + // Set the fields, converting all them to lowercase $fields = array_flip(array_change_key_case(array_flip($adoindex['columns']))); $this->fields = $fields; - /// Some more fields + // Some more fields $this->loaded = true; $this->changed = true; } /** * Returns the PHP code needed to define one xmldb_index + * @return string */ - function getPHP() { + public function getPHP() { $result = ''; - /// The type + // The type $unique = $this->getUnique(); if (!empty($unique)) { $result .= 'XMLDB_INDEX_UNIQUE, '; } else { $result .= 'XMLDB_INDEX_NOTUNIQUE, '; } - /// The fields + // The fields $indexfields = $this->getFields(); if (!empty($indexfields)) { $result .= 'array(' . "'". implode("', '", $indexfields) . "')"; } else { $result .= 'null'; } - /// Return result + // Return result return $result; } /** * Shows info in a readable format + * @return string */ - function readableInfo() { + public function readableInfo() { $o = ''; - /// unique + // unique if ($this->unique) { $o .= 'unique'; } else { $o .= 'not unique'; } - /// fields + // fields $o .= ' (' . implode(', ', $this->fields) . ')'; return $o; @@ -286,7 +305,7 @@ class xmldb_index extends xmldb_object { * @param xmldb_table $xmldb_table optional when object is table * @return string null if ok, error message if problem found */ - function validateDefinition(xmldb_table $xmldb_table=null) { + public function validateDefinition(xmldb_table $xmldb_table=null) { if (!$xmldb_table) { return 'Invalid xmldb_index->validateDefinition() call, $xmldb_table si required.'; } @@ -344,5 +363,4 @@ class xmldb_index extends xmldb_object { return null; } - } diff --git a/lib/xmldb/xmldb_key.php b/lib/xmldb/xmldb_key.php index de02a3f72d9..26ad368b49e 100644 --- a/lib/xmldb/xmldb_key.php +++ b/lib/xmldb/xmldb_key.php @@ -1,45 +1,57 @@ . -/////////////////////////////////////////////////////////////////////////// -// // -// NOTICE OF COPYRIGHT // -// // -// Moodle - Modular Object-Oriented Dynamic Learning Environment // -// http://moodle.com // -// // -// Copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com // -// (C) 2001-3001 Eloy Lafuente (stronk7) http://contiento.com // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation; either version 2 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License for more details: // -// // -// http://www.gnu.org/copyleft/gpl.html // -// // -/////////////////////////////////////////////////////////////////////////// +/** + * This class represent one XMLDB Key + * + * @package core_xmldb + * @copyright 1999 onwards Martin Dougiamas http://dougiamas.com + * 2001-3001 Eloy Lafuente (stronk7) http://contiento.com + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); -/// This class represent one XMLDB Key class xmldb_key extends xmldb_object { - var $type; - var $fields; - var $reftable; - var $reffields; + /** @var int type of key */ + protected $type; + + /** @var array of fields */ + protected $fields; + + /** @var string referenced table */ + protected $reftable; + + /** @var array referenced fields */ + protected $reffields; /** * Creates one new xmldb_key + * @param string $name + * @param string $type XMLDB_KEY_[PRIMARY|UNIQUE|FOREIGN|FOREIGN_UNIQUE] + * @param array $fields an array of fieldnames to build the key over + * @param string $reftable name of the table the FK points to or null + * @param array $reffields an array of fieldnames in the FK table or null */ - function __construct($name, $type=null, $fields=array(), $reftable=null, $reffields=null) { - $this->type = NULL; + public function __construct($name, $type=null, $fields=array(), $reftable=null, $reffields=null) { + $this->type = null; $this->fields = array(); - $this->reftable = NULL; + $this->reftable = null; $this->reffields = array(); parent::__construct($name); $this->set_attributes($type, $fields, $reftable, $reffields); @@ -48,12 +60,12 @@ class xmldb_key extends xmldb_object { /** * Set all the attributes of one xmldb_key * - * @param string type XMLDB_KEY_[PRIMARY|UNIQUE|FOREIGN|FOREIGN_UNIQUE] - * @param array fields an array of fieldnames to build the key over - * @param string reftable name of the table the FK points to or null - * @param array reffields an array of fieldnames in the FK table or null + * @param string $type XMLDB_KEY_[PRIMARY|UNIQUE|FOREIGN|FOREIGN_UNIQUE] + * @param array $fields an array of fieldnames to build the key over + * @param string $reftable name of the table the FK points to or null + * @param array $reffields an array of fieldnames in the FK table or null */ - function set_attributes($type, $fields, $reftable=null, $reffields=null) { + public function set_attributes($type, $fields, $reftable=null, $reffields=null) { $this->type = $type; $this->fields = $fields; $this->reftable = $reftable; @@ -62,74 +74,84 @@ class xmldb_key extends xmldb_object { /** * Get the key type + * @return int */ - function getType() { + public function getType() { return $this->type; } /** * Set the key type + * @param int $type */ - function setType($type) { + public function setType($type) { $this->type = $type; } /** * Set the key fields + * @param array $fields */ - function setFields($fields) { + public function setFields($fields) { $this->fields = $fields; } /** * Set the key reftable + * @param string $reftable */ - function setRefTable($reftable) { + public function setRefTable($reftable) { $this->reftable = $reftable; } /** * Set the key reffields + * @param array $reffields */ - function setRefFields($reffields) { + public function setRefFields($reffields) { $this->reffields = $reffields; } /** * Get the key fields + * @return array */ - function &getFields() { + public function getFields() { return $this->fields; } /** * Get the key reftable + * @return string */ - function &getRefTable() { + public function getRefTable() { return $this->reftable; } /** * Get the key reffields + * @return array reference to ref fields */ - function &getRefFields() { + public function getRefFields() { return $this->reffields; } /** * Load data from XML to the key + * @param array $xmlarr + * @return bool success */ - function arr2xmldb_key($xmlarr) { + public function arr2xmldb_key($xmlarr) { $result = true; - /// Debug the table - /// traverse_xmlize($xmlarr); //Debug - /// print_object ($GLOBALS['traverse_array']); //Debug - /// $GLOBALS['traverse_array']=""; //Debug + // Debug the table + // traverse_xmlize($xmlarr); //Debug + // print_object ($GLOBALS['traverse_array']); //Debug + // $GLOBALS['traverse_array']=""; //Debug - /// Process key attributes (name, type, fields, reftable, - /// reffields, comment, previous, next) + // Process key attributes (name, type, fields, reftable, + // reffields, comment, previous, next) if (isset($xmlarr['@']['NAME'])) { $this->name = trim($xmlarr['@']['NAME']); } else { @@ -139,7 +161,7 @@ class xmldb_key extends xmldb_object { } if (isset($xmlarr['@']['TYPE'])) { - /// Check for valid type + // Check for valid type $type = $this->getXMLDBKeyType(trim($xmlarr['@']['TYPE'])); if ($type) { $this->type = $type; @@ -177,11 +199,11 @@ class xmldb_key extends xmldb_object { $this->debug($this->errormsg); $result = false; } - /// Finally, set the array of fields + // Finally, set the array of fields $this->fields = $fieldsarr; if (isset($xmlarr['@']['REFTABLE'])) { - /// Check we are in a FK + // Check we are in a FK if ($this->type == XMLDB_KEY_FOREIGN || $this->type == XMLDB_KEY_FOREIGN_UNIQUE) { $reftable = strtolower(trim($xmlarr['@']['REFTABLE'])); @@ -201,14 +223,14 @@ class xmldb_key extends xmldb_object { $this->debug($this->errormsg); $result = false; } - /// Finally, set the reftable + // Finally, set the reftable if ($this->type == XMLDB_KEY_FOREIGN || $this->type == XMLDB_KEY_FOREIGN_UNIQUE) { $this->reftable = $reftable; } if (isset($xmlarr['@']['REFFIELDS'])) { - /// Check we are in a FK + // Check we are in a FK if ($this->type == XMLDB_KEY_FOREIGN || $this->type == XMLDB_KEY_FOREIGN_UNIQUE) { $reffields = strtolower(trim($xmlarr['@']['REFFIELDS'])); @@ -239,7 +261,7 @@ class xmldb_key extends xmldb_object { $this->debug($this->errormsg); $result = false; } - /// Finally, set the array of reffields + // Finally, set the array of reffields if ($this->type == XMLDB_KEY_FOREIGN || $this->type == XMLDB_KEY_FOREIGN_UNIQUE) { $this->reffields = $reffieldsarr; @@ -257,7 +279,7 @@ class xmldb_key extends xmldb_object { $this->next = trim($xmlarr['@']['NEXT']); } - /// Set some attributes + // Set some attributes if ($result) { $this->loaded = true; } @@ -268,8 +290,10 @@ class xmldb_key extends xmldb_object { /** * This function returns the correct XMLDB_KEY_XXX value for the * string passed as argument + * @param string $type + * @return int */ - function getXMLDBKeyType($type) { + public function getXMLDBKeyType($type) { $result = XMLDB_KEY_INCORRECT; @@ -286,23 +310,25 @@ class xmldb_key extends xmldb_object { case 'foreign-unique': $result = XMLDB_KEY_FOREIGN_UNIQUE; break; - /// case 'check': //Not supported - /// $result = XMLDB_KEY_CHECK; - /// break; + // case 'check': //Not supported + // $result = XMLDB_KEY_CHECK; + // break; } - /// Return the normalized XMLDB_KEY + // Return the normalized XMLDB_KEY return $result; } /** * This function returns the correct name value for the * XMLDB_KEY_XXX passed as argument + * @param int $type + * @return string */ - function getXMLDBKeyName($type) { + public function getXMLDBKeyName($type) { $result = ''; - switch (strtolower($type)) { + switch ($type) { case XMLDB_KEY_PRIMARY: $result = 'primary'; break; @@ -315,20 +341,21 @@ class xmldb_key extends xmldb_object { case XMLDB_KEY_FOREIGN_UNIQUE: $result = 'foreign-unique'; break; - /// case XMLDB_KEY_CHECK: //Not supported - /// $result = 'check'; - /// break; + // case XMLDB_KEY_CHECK: //Not supported + // $result = 'check'; + // break; } - /// Return the normalized name + // Return the normalized name return $result; } /** * This function calculate and set the hash of one xmldb_key + * @param bool $recursive */ - function calculateHash($recursive = false) { + public function calculateHash($recursive = false) { if (!$this->loaded) { - $this->hash = NULL; + $this->hash = null; } else { $key = $this->type . implode(', ', $this->fields); if ($this->type == XMLDB_KEY_FOREIGN || @@ -342,8 +369,9 @@ class xmldb_key extends xmldb_object { /** *This function will output the XML text for one key + * @return string */ - function xmlOutput() { + public function xmlOutput() { $o = ''; $o.= ' getXMLDBKeyName($this->type) . '"'; @@ -370,10 +398,11 @@ class xmldb_key extends xmldb_object { /** * This function will set all the attributes of the xmldb_key object * based on information passed in one ADOkey + * @oaram array $adokey */ - function setFromADOKey($adokey) { + public function setFromADOKey($adokey) { - /// Calculate the XMLDB_KEY + // Calculate the XMLDB_KEY switch (strtolower($adokey['name'])) { case 'primary': $this->type = XMLDB_KEY_PRIMARY; @@ -381,22 +410,23 @@ class xmldb_key extends xmldb_object { default: $this->type = XMLDB_KEY_UNIQUE; } - /// Set the fields, converting all them to lowercase + // Set the fields, converting all them to lowercase $fields = array_flip(array_change_key_case(array_flip($adokey['columns']))); $this->fields = $fields; - /// Some more fields + // Some more fields $this->loaded = true; $this->changed = true; } /** * Returns the PHP code needed to define one xmldb_key + * @return string */ - function getPHP() { + public function getPHP() { $result = ''; - /// The type + // The type switch ($this->getType()) { case XMLDB_KEY_PRIMARY: $result .= 'XMLDB_KEY_PRIMARY' . ', '; @@ -411,24 +441,24 @@ class xmldb_key extends xmldb_object { $result .= 'XMLDB_KEY_FOREIGN_UNIQUE' . ', '; break; } - /// The fields + // The fields $keyfields = $this->getFields(); if (!empty($keyfields)) { $result .= 'array(' . "'". implode("', '", $keyfields) . "')"; } else { $result .= 'null'; } - /// The FKs attributes + // The FKs attributes if ($this->getType() == XMLDB_KEY_FOREIGN || $this->getType() == XMLDB_KEY_FOREIGN_UNIQUE) { - /// The reftable + // The reftable $reftable = $this->getRefTable(); if (!empty($reftable)) { $result .= ", '" . $reftable . "', "; } else { $result .= 'null, '; } - /// The reffields + // The reffields $reffields = $this->getRefFields(); if (!empty($reffields)) { $result .= 'array(' . "'". implode("', '", $reffields) . "')"; @@ -436,20 +466,21 @@ class xmldb_key extends xmldb_object { $result .= 'null'; } } - /// Return result + // Return result return $result; } /** * Shows info in a readable format + * @return string */ - function readableInfo() { + public function readableInfo() { $o = ''; - /// type + // type $o .= $this->getXMLDBKeyName($this->type); - /// fields + // fields $o .= ' (' . implode(', ', $this->fields) . ')'; - /// foreign key + // foreign key if ($this->type == XMLDB_KEY_FOREIGN || $this->type == XMLDB_KEY_FOREIGN_UNIQUE) { $o .= ' references ' . $this->reftable . ' (' . implode(', ', $this->reffields) . ')'; diff --git a/lib/xmldb/xmldb_object.php b/lib/xmldb/xmldb_object.php index 4fd59acbee5..334610f8b0c 100644 --- a/lib/xmldb/xmldb_object.php +++ b/lib/xmldb/xmldb_object.php @@ -1,158 +1,188 @@ . -/////////////////////////////////////////////////////////////////////////// -// // -// NOTICE OF COPYRIGHT // -// // -// Moodle - Modular Object-Oriented Dynamic Learning Environment // -// http://moodle.com // -// // -// Copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com // -// (C) 2001-3001 Eloy Lafuente (stronk7) http://contiento.com // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation; either version 2 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License for more details: // -// // -// http://www.gnu.org/copyleft/gpl.html // -// // -/////////////////////////////////////////////////////////////////////////// +/** + * This class represent the XMLDB base class where all the common pieces are defined + * + * @package core_xmldb + * @copyright 1999 onwards Martin Dougiamas http://dougiamas.com + * 2001-3001 Eloy Lafuente (stronk7) http://contiento.com + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); -/// This class represent the XMLDB base class where all the common pieces -/// are defined class xmldb_object { - var $name; - var $comment; - var $previous; - var $next; - var $hash; - var $loaded; - var $changed; - var $errormsg; + /** @var string name of obejct */ + protected $name; + + /** @var string comment on object */ + protected $comment; + + /** @var xmldb_object */ + protected $previous; + + /** @var xmldb_object */ + protected $next; + + /** @var string hash of object */ + protected $hash; + + /** @var bool is it loaded yet */ + protected $loaded; + + /** @var bool was object changed */ + protected $changed; + + /** @var string error message */ + protected $errormsg; /** * Creates one new xmldb_object + * @param string $name */ - function __construct($name) { + public function __construct($name) { $this->name = $name; - $this->comment = NULL; - $this->previous = NULL; - $this->next = NULL; - $this->hash = NULL; + $this->comment = null; + $this->previous = null; + $this->next = null; + $this->hash = null; $this->loaded = false; $this->changed = false; - $this->errormsg = NULL; + $this->errormsg = null; } /** * This function returns true/false, if the xmldb_object has been loaded + * @return bool */ - function isLoaded() { + public function isLoaded() { return $this->loaded; } /** * This function returns true/false, if the xmldb_object has changed + * @return bool */ - function hasChanged() { + public function hasChanged() { return $this->changed; } /** * This function returns the comment of one xmldb_object + * @return string */ - function getComment() { + public function getComment() { return $this->comment; } /** * This function returns the hash of one xmldb_object + * @return string */ - function getHash() { + public function getHash() { return $this->hash; } /** * This function will return the name of the previous xmldb_object + * @return xmldb_object */ - function getPrevious() { + public function getPrevious() { return $this->previous; } /** * This function will return the name of the next xmldb_object + * @return xmldb_object */ - function getNext() { + public function getNext() { return $this->next; } /** * This function will return the name of the xmldb_object + * @return string */ - function getName() { + public function getName() { return $this->name; } /** * This function will return the error detected in the object + * @return string */ - function getError() { + public function getError() { return $this->errormsg; } /** * This function will set the comment of the xmldb_object + * @param string $comment */ - function setComment($comment) { + public function setComment($comment) { $this->comment = $comment; } /** * This function will set the previous of the xmldb_object + * @param xmldb_object $previous */ - function setPrevious($previous) { + public function setPrevious($previous) { $this->previous = $previous; } /** * This function will set the next of the xmldb_object + * @param xmldb_object $next */ - function setNext($next) { + public function setNext($next) { $this->next = $next; } /** * This function will set the hash of the xmldb_object + * @param string $hash */ - function setHash($hash) { + public function setHash($hash) { $this->hash = $hash; } /** * This function will set the loaded field of the xmldb_object + * @param bool $loaded */ - function setLoaded($loaded = true) { + public function setLoaded($loaded = true) { $this->loaded = $loaded; } /** * This function will set the changed field of the xmldb_object + * @param bool $changed */ - function setChanged($changed = true) { + public function setChanged($changed = true) { $this->changed = $changed; } /** * This function will set the name field of the xmldb_object + * @param string $name */ - function setName($name) { + public function setName($name) { $this->name = $name; } @@ -160,8 +190,9 @@ class xmldb_object { /** * This function will check if one key name is ok or no (true/false) * only lowercase a-z, 0-9 and _ are allowed + * @return bool */ - function checkName () { + public function checkName () { $result = true; if ($this->name != preg_replace('/[^a-z0-9_ -]/i', '', $this->name)) { @@ -173,12 +204,14 @@ class xmldb_object { /** * This function will check that all the elements in one array * have a correct name [a-z0-9_] + * @param array $arr + * @return bool */ - function checkNameValues(&$arr) { + public function checkNameValues($arr) { $result = true; - /// TODO: Perhaps, add support for reserved words + // TODO: Perhaps, add support for reserved words - /// Check the name only contains valid chars + // Check the name only contains valid chars if ($arr) { foreach($arr as $element) { if (!$element->checkName()) { @@ -186,7 +219,7 @@ class xmldb_object { } } } - /// Check there aren't duplicate names + // Check there aren't duplicate names if ($arr) { $existing_fields = array(); foreach($arr as $element) { @@ -202,8 +235,10 @@ class xmldb_object { /** * Reconstruct previous/next attributes. + * @param array $arr + * @return bool true if $arr modified */ - function fixPrevNext(&$arr) { + public function fixPrevNext(&$arr) { global $CFG; if (empty($CFG->xmldbreconstructprevnext)) { @@ -235,14 +270,16 @@ class xmldb_object { /** * This function will check that all the elements in one array * have a consistent info in their previous/next fields + * @param array $arr + * @return bool true means ok, false invalid prev/next present */ - function checkPreviousNextValues(&$arr) { + public function checkPreviousNextValues($arr) { global $CFG; if (!empty($CFG->xmldbdisablenextprevchecking)) { return true; } $result = true; - /// Check that only one element has the previous not set + // Check that only one element has the previous not set if ($arr) { $counter = 0; foreach($arr as $element) { @@ -255,7 +292,7 @@ class xmldb_object { $result = false; } } - /// Check that only one element has the next not set + // Check that only one element has the next not set if ($result && $arr) { $counter = 0; foreach($arr as $element) { @@ -268,31 +305,31 @@ class xmldb_object { $result = false; } } - /// Check that all the previous elements are existing elements + // Check that all the previous elements are existing elements if ($result && $arr) { foreach($arr as $element) { if ($element->getPrevious()) { $i = $this->findObjectInArray($element->getPrevious(), $arr); - if ($i === NULL) { + if ($i === null) { debugging('Object ' . $element->getName() . ' says PREVIOUS="' . $element->getPrevious() . '" but that other object does not exist.', DEBUG_DEVELOPER); $result = false; } } } } - /// Check that all the next elements are existing elements + // Check that all the next elements are existing elements if ($result && $arr) { foreach($arr as $element) { if ($element->getNext()) { $i = $this->findObjectInArray($element->getNext(), $arr); - if ($i === NULL) { + if ($i === null) { debugging('Object ' . $element->getName() . ' says NEXT="' . $element->getNext() . '" but that other object does not exist.', DEBUG_DEVELOPER); $result = false; } } } } - /// Check that there aren't duplicates in the previous values + // Check that there aren't duplicates in the previous values if ($result && $arr) { $existarr = array(); foreach($arr as $element) { @@ -304,7 +341,7 @@ class xmldb_object { } } } - /// Check that there aren't duplicates in the next values + // Check that there aren't duplicates in the next values if ($result && $arr) { $existarr = array(); foreach($arr as $element) { @@ -316,7 +353,7 @@ class xmldb_object { } } } - /// Check that there aren't next values pointing to themselves + // Check that there aren't next values pointing to themselves if ($result && $arr) { foreach($arr as $element) { if ($element->getNext() == $element->getName()) { @@ -325,7 +362,7 @@ class xmldb_object { } } } - /// Check that there aren't prev values pointing to themselves + // Check that there aren't prev values pointing to themselves if ($result && $arr) { foreach($arr as $element) { if ($element->getPrevious() == $element->getName()) { @@ -340,18 +377,20 @@ class xmldb_object { /** * This function will order all the elements in one array, following * the previous/next rules + * @param array $arr + * @return array|bool */ - function orderElements($arr) { + public function orderElements($arr) { global $CFG; $result = true; if (!empty($CFG->xmldbdisablenextprevchecking)) { return $arr; } - /// Create a new array + // Create a new array $newarr = array(); if (!empty($arr)) { - $currentelement = NULL; - /// Get the element without previous + $currentelement = null; + // Get the element without previous foreach($arr as $key => $element) { if (!$element->getPrevious()) { $currentelement = $arr[$key]; @@ -361,7 +400,7 @@ class xmldb_object { if (!$currentelement) { $result = false; } - /// Follow the next rules + // Follow the next rules $counter = 1; while ($result && $currentelement->getNext()) { $i = $this->findObjectInArray($currentelement->getNext(), $arr); @@ -369,11 +408,11 @@ class xmldb_object { $newarr[$counter] = $arr[$i]; $counter++; } - /// Compare number of elements between original and new array + // Compare number of elements between original and new array if ($result && count($arr) != count($newarr)) { $result = false; } - /// Check that previous/next is ok (redundant but...) + // Check that previous/next is ok (redundant but...) if ($this->checkPreviousNextValues($newarr)) { $result = $newarr; } else { @@ -387,22 +426,25 @@ class xmldb_object { /** * Returns the position of one object in the array. + * @param string $objectname + * @param array $arr + * @return mixed */ - function &findObjectInArray($objectname, $arr) { + public function findObjectInArray($objectname, $arr) { foreach ($arr as $i => $object) { if ($objectname == $object->getName()) { return $i; } } - $null = NULL; - return $null; + return null; } /** * This function will display a readable info about the xmldb_object * (should be implemented inside each XMLDBxxx object) + * @return string */ - function readableInfo() { + public function readableInfo() { return get_class($this); } @@ -416,12 +458,13 @@ class xmldb_object { * * Call to the external hook function can be disabled by request by * defining XMLDB_SKIP_DEBUG_HOOK + * @param string $message */ - function debug($message) { + public function debug($message) { - /// Check for xmldb_debug($message, $xmldb_object) + // Check for xmldb_debug($message, $xmldb_object) $funcname = 'xmldb_debug'; - /// If exists and XMLDB_SKIP_DEBUG_HOOK is undefined + // If exists and XMLDB_SKIP_DEBUG_HOOK is undefined if (function_exists($funcname) && !defined('XMLDB_SKIP_DEBUG_HOOK')) { $funcname($message, $this); } @@ -430,13 +473,15 @@ class xmldb_object { /** * Returns one array of elements from one comma separated string, * supporting quoted strings containing commas and concat function calls + * @param string $string + * @return array */ - function comma2array($string) { + public function comma2array($string) { $foundquotes = array(); $foundconcats = array(); - /// Extract all the concat elements from the string + // Extract all the concat elements from the string preg_match_all("/(CONCAT\(.*?\))/is", $string, $matches); foreach (array_unique($matches[0]) as $key=>$value) { $foundconcats['<#'.$key.'#>'] = $value; @@ -445,8 +490,8 @@ class xmldb_object { $string = str_replace($foundconcats,array_keys($foundconcats),$string); } - /// Extract all the quoted elements from the string (skipping - /// backslashed quotes that are part of the content. + // Extract all the quoted elements from the string (skipping + // backslashed quotes that are part of the content. preg_match_all("/(''|'.*?[^\\\\]')/is", $string, $matches); foreach (array_unique($matches[0]) as $key=>$value) { $foundquotes['<%'.$key.'%>'] = $value; @@ -455,23 +500,23 @@ class xmldb_object { $string = str_replace($foundquotes,array_keys($foundquotes),$string); } - /// Explode safely the string + // Explode safely the string $arr = explode (',', $string); - /// Put the concat and quoted elements back again, trimming every element + // Put the concat and quoted elements back again, trimming every element if ($arr) { foreach ($arr as $key => $element) { - /// Clear some spaces + // Clear some spaces $element = trim($element); - /// Replace the quoted elements if exists + // Replace the quoted elements if exists if (!empty($foundquotes)) { $element = str_replace(array_keys($foundquotes), $foundquotes, $element); } - /// Replace the concat elements if exists + // Replace the concat elements if exists if (!empty($foundconcats)) { $element = str_replace(array_keys($foundconcats), $foundconcats, $element); } - /// Delete any backslash used for quotes. XMLDB stuff will add them before insert + // Delete any backslash used for quotes. XMLDB stuff will add them before insert $arr[$key] = str_replace("\\'", "'", $element); } } @@ -488,7 +533,7 @@ class xmldb_object { * @param xmldb_table $xmldb_table optional when object is table * @return string null if ok, error message if problem found */ - function validateDefinition(xmldb_table $xmldb_table=null) { + public function validateDefinition(xmldb_table $xmldb_table=null) { return null; } } diff --git a/lib/xmldb/xmldb_structure.php b/lib/xmldb/xmldb_structure.php index 41e48bb12d8..678a7d6e7c3 100644 --- a/lib/xmldb/xmldb_structure.php +++ b/lib/xmldb/xmldb_structure.php @@ -1,90 +1,101 @@ . -/////////////////////////////////////////////////////////////////////////// -// // -// NOTICE OF COPYRIGHT // -// // -// Moodle - Modular Object-Oriented Dynamic Learning Environment // -// http://moodle.com // -// // -// Copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com // -// (C) 2001-3001 Eloy Lafuente (stronk7) http://contiento.com // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation; either version 2 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License for more details: // -// // -// http://www.gnu.org/copyleft/gpl.html // -// // -/////////////////////////////////////////////////////////////////////////// +/** + * This class represent one XMLDB structure + * + * @package core_xmldb + * @copyright 1999 onwards Martin Dougiamas http://dougiamas.com + * 2001-3001 Eloy Lafuente (stronk7) http://contiento.com + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); -/// This class represent one XMLDB structure class xmldb_structure extends xmldb_object { - var $path; - var $version; - var $tables; + /** @var string */ + protected $path; + + /** @var string */ + protected $version; + + /** @var array tables */ + protected $tables; /** * Creates one new xmldb_structure + * @param string $name */ - function __construct($name) { + public function __construct($name) { parent::__construct($name); - $this->path = NULL; - $this->version = NULL; + $this->path = null; + $this->version = null; $this->tables = array(); } /** * Returns the path of the structure + * @return string */ - function getPath() { + public function getPath() { return $this->path; } /** * Returns the version of the structure + * @return string */ - function getVersion() { + public function getVersion() { return $this->version; } /** * Returns one xmldb_table + * @param string $tablename + * @return xmldb_table */ - function &getTable($tablename) { + public function getTable($tablename) { $i = $this->findTableInArray($tablename); - if ($i !== NULL) { + if ($i !== null) { return $this->tables[$i]; } - $null = NULL; - return $null; + return null; } /** * Returns the position of one table in the array. + * @param string $tablename + * @return mixed */ - function &findTableInArray($tablename) { + public function findTableInArray($tablename) { foreach ($this->tables as $i => $table) { if ($tablename == $table->getName()) { return $i; } } - $null = NULL; - return $null; + return null; } /** * This function will reorder the array of tables + * @return bool success */ - function orderTables() { + public function orderTables() { $result = $this->orderElements($this->tables); if ($result) { $this->setTables($result); @@ -96,42 +107,45 @@ class xmldb_structure extends xmldb_object { /** * Returns the tables of the structure + * @return array */ - function &getTables() { + public function getTables() { return $this->tables; } /** * Set the structure version + * @param string version */ - function setVersion($version) { + public function setVersion($version) { $this->version = $version; } /** * Add one table to the structure, allowing to specify the desired order * If it's not specified, then the table is added at the end. + * @param xmldb_table $table + * @param mixed $after */ - function addTable(&$table, $after=NULL) { + public function addTable($table, $after=null) { - /// Calculate the previous and next tables - $prevtable = NULL; - $nexttable = NULL; + // Calculate the previous and next tables + $prevtable = null; + $nexttable = null; if (!$after) { - $alltables =& $this->getTables(); - if ($alltables) { - end($alltables); - $prevtable =& $alltables[key($alltables)]; + if ($this->tables) { + end($this->tables); + $prevtable = $this->tables[key($this->tables)]; } } else { - $prevtable =& $this->getTable($after); + $prevtable = $this->getTable($after); } if ($prevtable && $prevtable->getNext()) { - $nexttable =& $this->getTable($prevtable->getNext()); + $nexttable = $this->getTable($prevtable->getNext()); } - /// Set current table previous and next attributes + // Set current table previous and next attributes if ($prevtable) { $table->setPrevious($prevtable->getName()); $prevtable->setNext($table->getName()); @@ -140,45 +154,46 @@ class xmldb_structure extends xmldb_object { $table->setNext($nexttable->getName()); $nexttable->setPrevious($table->getName()); } - /// Some more attributes + // Some more attributes $table->setLoaded(true); $table->setChanged(true); - /// Add the new table - $this->tables[] =& $table; - /// Reorder the whole structure + // Add the new table + $this->tables[] = $table; + // Reorder the whole structure $this->orderTables($this->tables); - /// Recalculate the hash + // Recalculate the hash $this->calculateHash(true); - /// We have one new table, so the structure has changed + // We have one new table, so the structure has changed $this->setVersion(userdate(time(), '%Y%m%d', 99, false)); $this->setChanged(true); } /** * Delete one table from the Structure + * @param string $tablename */ - function deleteTable($tablename) { + public function deleteTable($tablename) { - $table =& $this->getTable($tablename); + $table = $this->getTable($tablename); if ($table) { $i = $this->findTableInArray($tablename); - /// Look for prev and next table - $prevtable =& $this->getTable($table->getPrevious()); - $nexttable =& $this->getTable($table->getNext()); - /// Change their previous and next attributes + // Look for prev and next table + $prevtable = $this->getTable($table->getPrevious()); + $nexttable = $this->getTable($table->getNext()); + // Change their previous and next attributes if ($prevtable) { $prevtable->setNext($table->getNext()); } if ($nexttable) { $nexttable->setPrevious($table->getPrevious()); } - /// Delete the table + // Delete the table unset($this->tables[$i]); - /// Reorder the tables + // Reorder the tables $this->orderTables($this->tables); - /// Recalculate the hash + // Recalculate the hash $this->calculateHash(true); - /// We have one deleted table, so the structure has changed + // We have one deleted table, so the structure has changed $this->setVersion(userdate(time(), '%Y%m%d', 99, false)); $this->setChanged(true); } @@ -186,26 +201,29 @@ class xmldb_structure extends xmldb_object { /** * Set the tables + * @param array $tables */ - function setTables(&$tables) { + public function setTables($tables) { $this->tables = $tables; } /** * Load data from XML to the structure + * @param array $xmlarr + * @return bool */ - function arr2xmldb_structure($xmlarr) { + public function arr2xmldb_structure($xmlarr) { global $CFG; $result = true; - /// Debug the structure - /// traverse_xmlize($xmlarr); //Debug - /// print_object ($GLOBALS['traverse_array']); //Debug - /// $GLOBALS['traverse_array']=""; //Debug + // Debug the structure + // traverse_xmlize($xmlarr); //Debug + // print_object ($GLOBALS['traverse_array']); //Debug + // $GLOBALS['traverse_array']=""; //Debug - /// Process structure attributes (path, comment and version) + // Process structure attributes (path, comment and version) if (isset($xmlarr['XMLDB']['@']['PATH'])) { $this->path = trim($xmlarr['XMLDB']['@']['PATH']); } else { @@ -230,7 +248,7 @@ class xmldb_structure extends xmldb_object { $result = false; } - /// Iterate over tables + // Iterate over tables if (isset($xmlarr['XMLDB']['#']['TABLES']['0']['#']['TABLE'])) { foreach ($xmlarr['XMLDB']['#']['TABLES']['0']['#']['TABLE'] as $xmltable) { if (!$result) { //Skip on error @@ -252,22 +270,22 @@ class xmldb_structure extends xmldb_object { $result = false; } - /// Perform some general checks over tables + // Perform some general checks over tables if ($result && $this->tables) { - /// Check tables names are ok (lowercase, a-z _-) + // Check tables names are ok (lowercase, a-z _-) if (!$this->checkNameValues($this->tables)) { $this->errormsg = 'Some TABLES name values are incorrect'; $this->debug($this->errormsg); $result = false; } - /// Check previous & next are ok (duplicates and existing tables) + // Check previous & next are ok (duplicates and existing tables) $this->fixPrevNext($this->tables); if ($result && !$this->checkPreviousNextValues($this->tables)) { $this->errormsg = 'Some TABLES previous/next values are incorrect'; $this->debug($this->errormsg); $result = false; } - /// Order tables + // Order tables if ($result && !$this->orderTables($this->tables)) { $this->errormsg = 'Error ordering the tables'; $this->debug($this->errormsg); @@ -275,7 +293,7 @@ class xmldb_structure extends xmldb_object { } } - /// Set some attributes + // Set some attributes if ($result) { $this->loaded = true; } @@ -285,15 +303,16 @@ class xmldb_structure extends xmldb_object { /** * This function calculate and set the hash of one xmldb_structure + * @param bool $recursive */ - function calculateHash($recursive = false) { + public function calculateHash($recursive = false) { if (!$this->loaded) { - $this->hash = NULL; + $this->hash = null; } else { $key = $this->name . $this->path . $this->comment; if ($this->tables) { foreach ($this->tables as $tbl) { - $table =& $this->getTable($tbl->getName()); + $table = $this->getTable($tbl->getName()); if ($recursive) { $table->calculateHash($recursive); } @@ -306,8 +325,9 @@ class xmldb_structure extends xmldb_object { /** * This function will output the XML text for one structure + * @return string */ - function xmlOutput() { + public function xmlOutput() { $o = '' . "\n"; $o.= 'version . '"'; @@ -319,7 +339,7 @@ class xmldb_structure extends xmldb_object { $o.= ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'."\n"; $o.= ' xsi:noNamespaceSchemaLocation="'.$rel.'/lib/xmldb/xmldb.xsd"'."\n"; $o.= '>' . "\n"; - /// Now the tables + // Now the tables if ($this->tables) { $o.= ' ' . "\n"; foreach ($this->tables as $table) { @@ -336,16 +356,17 @@ class xmldb_structure extends xmldb_object { * This function returns the number of uses of one table inside * a whole XMLDStructure. Useful to detect if the table must be * locked. Return false if no uses are found. + * @param string $tablename + * @return mixed */ - function getTableUses($tablename) { + public function getTableUses($tablename) { $uses = array(); - /// Check if some foreign key in the whole structure is using it - /// (by comparing the reftable with the tablename) - $alltables = $this->getTables(); - if ($alltables) { - foreach ($alltables as $table) { + // Check if some foreign key in the whole structure is using it + // (by comparing the reftable with the tablename) + if ($this->tables) { + foreach ($this->tables as $table) { $keys = $table->getKeys(); if ($keys) { foreach ($keys as $key) { @@ -359,7 +380,7 @@ class xmldb_structure extends xmldb_object { } } - /// Return result + // Return result if (!empty($uses)) { return $uses; } else { @@ -371,12 +392,15 @@ class xmldb_structure extends xmldb_object { * This function returns the number of uses of one field inside * a whole xmldb_structure. Useful to detect if the field must be * locked. Return false if no uses are found. + * @param string $tablename + * @param string $fieldname + * @return mixed */ - function getFieldUses($tablename, $fieldname) { + public function getFieldUses($tablename, $fieldname) { $uses = array(); - /// Check if any key in the table is using it + // Check if any key in the table is using it $table = $this->getTable($tablename); if ($keys = $table->getKeys()) { foreach ($keys as $key) { @@ -386,7 +410,7 @@ class xmldb_structure extends xmldb_object { } } } - /// Check if any index in the table is using it + // Check if any index in the table is using it $table = $this->getTable($tablename); if ($indexes = $table->getIndexes()) { foreach ($indexes as $index) { @@ -395,11 +419,10 @@ class xmldb_structure extends xmldb_object { } } } - /// Check if some foreign key in the whole structure is using it - /// By comparing the reftable and refields with the field) - $alltables = $this->getTables(); - if ($alltables) { - foreach ($alltables as $table) { + // Check if some foreign key in the whole structure is using it + // By comparing the reftable and refields with the field) + if ($this->tables) { + foreach ($this->tables as $table) { $keys = $table->getKeys(); if ($keys) { foreach ($keys as $key) { @@ -416,7 +439,7 @@ class xmldb_structure extends xmldb_object { } } - /// Return result + // Return result if (!empty($uses)) { return $uses; } else { @@ -428,18 +451,20 @@ class xmldb_structure extends xmldb_object { * This function returns the number of uses of one key inside * a whole xmldb_structure. Useful to detect if the key must be * locked. Return false if no uses are found. + * @param string $tablename + * @param string $keyname + * @return mixed */ - function getKeyUses($tablename, $keyname) { + public function getKeyUses($tablename, $keyname) { $uses = array(); - /// Check if some foreign key in the whole structure is using it - /// (by comparing the reftable and reffields with the fields in the key) + // Check if some foreign key in the whole structure is using it + // (by comparing the reftable and reffields with the fields in the key) $mytable = $this->getTable($tablename); $mykey = $mytable->getKey($keyname); - $alltables = $this->getTables(); - if ($alltables && $mykey) { - foreach ($alltables as $table) { + if ($this->tables && $mykey) { + foreach ($this->tables as $table) { $allkeys = $table->getKeys(); if ($allkeys) { foreach ($allkeys as $key) { @@ -455,7 +480,7 @@ class xmldb_structure extends xmldb_object { } } - /// Return result + // Return result if (!empty($uses)) { return $uses; } else { @@ -467,15 +492,18 @@ class xmldb_structure extends xmldb_object { * This function returns the number of uses of one index inside * a whole xmldb_structure. Useful to detect if the index must be * locked. Return false if no uses are found. + * @param string $tablename + * @param string $indexname + * @return mixed */ - function getIndexUses($tablename, $indexname) { + public function getIndexUses($tablename, $indexname) { $uses = array(); - /// Nothing to check, beause indexes haven't uses! Leave it here - /// for future checks... + // Nothing to check, because indexes haven't uses! Leave it here + // for future checks... - /// Return result + // Return result if (!empty($uses)) { return $uses; } else { @@ -487,27 +515,28 @@ class xmldb_structure extends xmldb_object { * This function will return all the errors found in one structure * looking recursively inside each table. Returns * an array of errors or false + * @return mixed */ - function getAllErrors() { + public function getAllErrors() { $errors = array(); - /// First the structure itself + // First the structure itself if ($this->getError()) { $errors[] = $this->getError(); } - /// Delegate to tables - if ($tables = $this->getTables()) { - foreach ($tables as $table) { + // Delegate to tables + if ($this->tables) { + foreach ($this->tables as $table) { if ($tableerrors = $table->getAllErrors()) { } } - /// Add them to the errors array + // Add them to the errors array if ($tableerrors) { $errors = array_merge($errors, $tableerrors); } } - /// Return decision + // Return decision if (count($errors)) { return $errors; } else { diff --git a/lib/xmldb/xmldb_table.php b/lib/xmldb/xmldb_table.php index 614354fed52..b3e77d875e4 100644 --- a/lib/xmldb/xmldb_table.php +++ b/lib/xmldb/xmldb_table.php @@ -1,50 +1,56 @@ . -/////////////////////////////////////////////////////////////////////////// -// // -// NOTICE OF COPYRIGHT // -// // -// Moodle - Modular Object-Oriented Dynamic Learning Environment // -// http://moodle.com // -// // -// Copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com // -// (C) 2001-3001 Eloy Lafuente (stronk7) http://contiento.com // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation; either version 2 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License for more details: // -// // -// http://www.gnu.org/copyleft/gpl.html // -// // -/////////////////////////////////////////////////////////////////////////// +/** + * This class represent one XMLDB table + * + * @package core_xmldb + * @copyright 1999 onwards Martin Dougiamas http://dougiamas.com + * 2001-3001 Eloy Lafuente (stronk7) http://contiento.com + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); -/// This class represent one XMLDB table class xmldb_table extends xmldb_object { - var $fields; - var $keys; - var $indexes; + /** @var array table columns */ + protected $fields; + + /** @var array keys */ + protected $keys; + + /** @var array indexes */ + protected $indexes; /** * Note: * - Oracle has 30 chars limit for all names, * 2 chars are reserved for prefix. * - * @const maximumn length of field names + * @const maximum length of field names */ const NAME_MAX_LENGTH = 28; /** * Creates one new xmldb_table + * @param string $name */ - function __construct($name) { + public function __construct($name) { parent::__construct($name); $this->fields = array(); $this->keys = array(); @@ -54,32 +60,35 @@ class xmldb_table extends xmldb_object { /** * Add one field to the table, allowing to specify the desired order * If it's not specified, then the field is added at the end + * @param xmldb_field $field + * @param xmldb_object $after + * @return xmldb_field */ - function addField(&$field, $after=NULL) { + public function addField($field, $after=null) { - /// Detect duplicates first + // Detect duplicates first if ($this->getField($field->getName())) { throw new coding_exception('Duplicate field '.$field->getName().' specified in table '.$this->getName()); } - /// Calculate the previous and next fields - $prevfield = NULL; - $nextfield = NULL; + // Calculate the previous and next fields + $prevfield = null; + $nextfield = null; if (!$after) { - $allfields =& $this->getFields(); + $allfields = $this->getFields(); if (!empty($allfields)) { end($allfields); - $prevfield =& $allfields[key($allfields)]; + $prevfield = $allfields[key($allfields)]; } } else { - $prevfield =& $this->getField($after); + $prevfield = $this->getField($after); } if ($prevfield && $prevfield->getNext()) { - $nextfield =& $this->getField($prevfield->getNext()); + $nextfield = $this->getField($prevfield->getNext()); } - /// Set current field previous and next attributes + // Set current field previous and next attributes if ($prevfield) { $field->setPrevious($prevfield->getName()); $prevfield->setNext($field->getName()); @@ -88,16 +97,16 @@ class xmldb_table extends xmldb_object { $field->setNext($nextfield->getName()); $nextfield->setPrevious($field->getName()); } - /// Some more attributes + // Some more attributes $field->setLoaded(true); $field->setChanged(true); - /// Add the new field + // Add the new field $this->fields[] = $field; - /// Reorder the field + // Reorder the field $this->orderFields($this->fields); - /// Recalculate the hash + // Recalculate the hash $this->calculateHash(true); - /// We have one new field, so the table has changed + // We have one new field, so the table has changed $this->setChanged(true); return $field; @@ -106,32 +115,34 @@ class xmldb_table extends xmldb_object { /** * Add one key to the table, allowing to specify the desired order * If it's not specified, then the key is added at the end + * @param xmldb_key $key + * @param xmldb_object $after */ - function addKey(&$key, $after=NULL) { + public function addKey($key, $after=null) { - /// Detect duplicates first + // Detect duplicates first if ($this->getKey($key->getName())) { throw new coding_exception('Duplicate key '.$key->getName().' specified in table '.$this->getName()); } - /// Calculate the previous and next keys - $prevkey = NULL; - $nextkey = NULL; + // Calculate the previous and next keys + $prevkey = null; + $nextkey = null; if (!$after) { - $allkeys =& $this->getKeys(); + $allkeys = $this->getKeys(); if (!empty($allkeys)) { end($allkeys); - $prevkey =& $allkeys[key($allkeys)]; + $prevkey = $allkeys[key($allkeys)]; } } else { - $prevkey =& $this->getKey($after); + $prevkey = $this->getKey($after); } if ($prevkey && $prevkey->getNext()) { - $nextkey =& $this->getKey($prevkey->getNext()); + $nextkey = $this->getKey($prevkey->getNext()); } - /// Set current key previous and next attributes + // Set current key previous and next attributes if ($prevkey) { $key->setPrevious($prevkey->getName()); $prevkey->setNext($key->getName()); @@ -140,48 +151,50 @@ class xmldb_table extends xmldb_object { $key->setNext($nextkey->getName()); $nextkey->setPrevious($key->getName()); } - /// Some more attributes + // Some more attributes $key->setLoaded(true); $key->setChanged(true); - /// Add the new key + // Add the new key $this->keys[] = $key; - /// Reorder the keys + // Reorder the keys $this->orderKeys($this->keys); - /// Recalculate the hash + // Recalculate the hash $this->calculateHash(true); - /// We have one new field, so the table has changed + // We have one new field, so the table has changed $this->setChanged(true); } /** * Add one index to the table, allowing to specify the desired order * If it's not specified, then the index is added at the end + * @param xmldb_index $index + * @param xmldb_object $after */ - function addIndex(&$index, $after=NULL) { + public function addIndex($index, $after=null) { - /// Detect duplicates first + // Detect duplicates first if ($this->getIndex($index->getName())) { throw new coding_exception('Duplicate index '.$index->getName().' specified in table '.$this->getName()); } - /// Calculate the previous and next indexes - $previndex = NULL; - $nextindex = NULL; + // Calculate the previous and next indexes + $previndex = null; + $nextindex = null; if (!$after) { - $allindexes =& $this->getIndexes(); + $allindexes = $this->getIndexes(); if (!empty($allindexes)) { end($allindexes); - $previndex =& $allindexes[key($allindexes)]; + $previndex = $allindexes[key($allindexes)]; } } else { - $previndex =& $this->getIndex($after); + $previndex = $this->getIndex($after); } if ($previndex && $previndex->getNext()) { - $nextindex =& $this->getIndex($previndex->getNext()); + $nextindex = $this->getIndex($previndex->getNext()); } - /// Set current index previous and next attributes + // Set current index previous and next attributes if ($previndex) { $index->setPrevious($previndex->getName()); $previndex->setNext($index->getName()); @@ -191,69 +204,75 @@ class xmldb_table extends xmldb_object { $nextindex->setPrevious($index->getName()); } - /// Some more attributes + // Some more attributes $index->setLoaded(true); $index->setChanged(true); - /// Add the new index + // Add the new index $this->indexes[] = $index; - /// Reorder the indexes + // Reorder the indexes $this->orderIndexes($this->indexes); - /// Recalculate the hash + // Recalculate the hash $this->calculateHash(true); - /// We have one new index, so the table has changed + // We have one new index, so the table has changed $this->setChanged(true); } /** * This function will return the array of fields in the table + * @return array */ - function &getFields() { + public function getFields() { return $this->fields; } /** * This function will return the array of keys in the table + * @return array */ - function &getKeys() { + public function getKeys() { return $this->keys; } /** * This function will return the array of indexes in the table + * @return array */ - function &getIndexes() { + public function getIndexes() { return $this->indexes; } /** * Returns one xmldb_field + * @param string $fieldname + * @return mixed */ - function &getField($fieldname) { + public function getField($fieldname) { $i = $this->findFieldInArray($fieldname); - if ($i !== NULL) { + if ($i !== null) { return $this->fields[$i]; } - $null = NULL; - return $null; + return null; } /** * Returns the position of one field in the array. + * @param string $fieldname + * @return mixed */ - function &findFieldInArray($fieldname) { + public function findFieldInArray($fieldname) { foreach ($this->fields as $i => $field) { if ($fieldname == $field->getName()) { return $i; } } - $null = NULL; - return $null; + return null; } /** * This function will reorder the array of fields + * @return bool */ - function orderFields() { + public function orderFields() { $result = $this->orderElements($this->fields); if ($result) { $this->setFields($result); @@ -265,33 +284,36 @@ class xmldb_table extends xmldb_object { /** * Returns one xmldb_key + * @param string $keyname + * @return mixed */ - function &getKey($keyname) { + public function getKey($keyname) { $i = $this->findKeyInArray($keyname); - if ($i !== NULL) { + if ($i !== null) { return $this->keys[$i]; } - $null = NULL; - return $null; + return null; } /** * Returns the position of one key in the array. + * @param string $keyname + * @return mixed */ - function &findKeyInArray($keyname) { + public function findKeyInArray($keyname) { foreach ($this->keys as $i => $key) { if ($keyname == $key->getName()) { return $i; } } - $null = NULL; - return $null; + return null; } /** * This function will reorder the array of keys + * @return bool */ - function orderKeys() { + public function orderKeys() { $result = $this->orderElements($this->keys); if ($result) { $this->setKeys($result); @@ -303,33 +325,36 @@ class xmldb_table extends xmldb_object { /** * Returns one xmldb_index + * @param string $indexname + * @return mixed */ - function &getIndex($indexname) { + public function getIndex($indexname) { $i = $this->findIndexInArray($indexname); - if ($i !== NULL) { + if ($i !== null) { return $this->indexes[$i]; } - $null = NULL; - return $null; + return null; } /** * Returns the position of one index in the array. + * @param string $indexname + * @return mixed */ - function &findIndexInArray($indexname) { + public function findIndexInArray($indexname) { foreach ($this->indexes as $i => $index) { if ($indexname == $index->getName()) { return $i; } } - $null = NULL; - return $null; + return null; } /** * This function will reorder the array of indexes + * @return bool */ - function orderIndexes() { + public function orderIndexes() { $result = $this->orderElements($this->indexes); if ($result) { $this->setIndexes($result); @@ -341,127 +366,135 @@ class xmldb_table extends xmldb_object { /** * This function will set the array of fields in the table + * @param array $fields */ - function setFields($fields) { + public function setFields($fields) { $this->fields = $fields; } /** * This function will set the array of keys in the table + * @param array $keys */ - function setKeys($keys) { + public function setKeys($keys) { $this->keys = $keys; } /** * This function will set the array of indexes in the table + * @param array $indexes */ - function setIndexes($indexes) { + public function setIndexes($indexes) { $this->indexes = $indexes; } /** * Delete one field from the table + * @param string $fieldname */ - function deleteField($fieldname) { + public function deleteField($fieldname) { - $field =& $this->getField($fieldname); + $field = $this->getField($fieldname); if ($field) { $i = $this->findFieldInArray($fieldname); - /// Look for prev and next field - $prevfield =& $this->getField($field->getPrevious()); - $nextfield =& $this->getField($field->getNext()); - /// Change their previous and next attributes + // Look for prev and next field + $prevfield = $this->getField($field->getPrevious()); + $nextfield = $this->getField($field->getNext()); + // Change their previous and next attributes if ($prevfield) { $prevfield->setNext($field->getNext()); } if ($nextfield) { $nextfield->setPrevious($field->getPrevious()); } - /// Delete the field + // Delete the field unset($this->fields[$i]); - /// Reorder the whole structure + // Reorder the whole structure $this->orderFields($this->fields); - /// Recalculate the hash + // Recalculate the hash $this->calculateHash(true); - /// We have one deleted field, so the table has changed + // We have one deleted field, so the table has changed $this->setChanged(true); } } /** * Delete one key from the table + * @param string $keyname */ - function deleteKey($keyname) { + public function deleteKey($keyname) { - $key =& $this->getKey($keyname); + $key = $this->getKey($keyname); if ($key) { $i = $this->findKeyInArray($keyname); - /// Look for prev and next key - $prevkey =& $this->getKey($key->getPrevious()); - $nextkey =& $this->getKey($key->getNext()); - /// Change their previous and next attributes + // Look for prev and next key + $prevkey = $this->getKey($key->getPrevious()); + $nextkey = $this->getKey($key->getNext()); + // Change their previous and next attributes if ($prevkey) { $prevkey->setNext($key->getNext()); } if ($nextkey) { $nextkey->setPrevious($key->getPrevious()); } - /// Delete the key + // Delete the key unset($this->keys[$i]); - /// Reorder the Keys + // Reorder the Keys $this->orderKeys($this->keys); - /// Recalculate the hash + // Recalculate the hash $this->calculateHash(true); - /// We have one deleted key, so the table has changed + // We have one deleted key, so the table has changed $this->setChanged(true); } } /** * Delete one index from the table + * @param string $indexname */ - function deleteIndex($indexname) { + public function deleteIndex($indexname) { - $index =& $this->getIndex($indexname); + $index = $this->getIndex($indexname); if ($index) { $i = $this->findIndexInArray($indexname); - /// Look for prev and next index - $previndex =& $this->getIndex($index->getPrevious()); - $nextindex =& $this->getIndex($index->getNext()); - /// Change their previous and next attributes + // Look for prev and next index + $previndex = $this->getIndex($index->getPrevious()); + $nextindex = $this->getIndex($index->getNext()); + // Change their previous and next attributes if ($previndex) { $previndex->setNext($index->getNext()); } if ($nextindex) { $nextindex->setPrevious($index->getPrevious()); } - /// Delete the index + // Delete the index unset($this->indexes[$i]); - /// Reorder the indexes + // Reorder the indexes $this->orderIndexes($this->indexes); - /// Recalculate the hash + // Recalculate the hash $this->calculateHash(true); - /// We have one deleted index, so the table has changed + // We have one deleted index, so the table has changed $this->setChanged(true); } } /** * Load data from XML to the table + * @param array $xmlarr + * @return bool success */ - function arr2xmldb_table($xmlarr) { + public function arr2xmldb_table($xmlarr) { global $CFG; $result = true; - /// Debug the table - /// traverse_xmlize($xmlarr); //Debug - /// print_object ($GLOBALS['traverse_array']); //Debug - /// $GLOBALS['traverse_array']=""; //Debug + // Debug the table + // traverse_xmlize($xmlarr); //Debug + // print_object ($GLOBALS['traverse_array']); //Debug + // $GLOBALS['traverse_array']=""; //Debug - /// Process table attributes (name, comment, previoustable and nexttable) + // Process table attributes (name, comment, previoustable and nexttable) if (isset($xmlarr['@']['NAME'])) { $this->name = trim($xmlarr['@']['NAME']); } else { @@ -485,7 +518,7 @@ class xmldb_table extends xmldb_object { $this->next = trim($xmlarr['@']['NEXT']); } - /// Iterate over fields + // Iterate over fields if (isset($xmlarr['#']['FIELDS']['0']['#']['FIELD'])) { foreach ($xmlarr['#']['FIELDS']['0']['#']['FIELD'] as $xmlfield) { if (!$result) { //Skip on error @@ -507,22 +540,22 @@ class xmldb_table extends xmldb_object { $result = false; } - /// Perform some general checks over fields + // Perform some general checks over fields if ($result && $this->fields) { - /// Check field names are ok (lowercase, a-z _-) + // Check field names are ok (lowercase, a-z _-) if (!$this->checkNameValues($this->fields)) { $this->errormsg = 'Some FIELDS name values are incorrect'; $this->debug($this->errormsg); $result = false; } - /// Check previous & next are ok (duplicates and existing fields) + // Check previous & next are ok (duplicates and existing fields) $this->fixPrevNext($this->fields); if ($result && !$this->checkPreviousNextValues($this->fields)) { $this->errormsg = 'Some FIELDS previous/next values are incorrect'; $this->debug($this->errormsg); $result = false; } - /// Order fields + // Order fields if ($result && !$this->orderFields($this->fields)) { $this->errormsg = 'Error ordering the fields'; $this->debug($this->errormsg); @@ -530,7 +563,7 @@ class xmldb_table extends xmldb_object { } } - /// Iterate over keys + // Iterate over keys if (isset($xmlarr['#']['KEYS']['0']['#']['KEY'])) { foreach ($xmlarr['#']['KEYS']['0']['#']['KEY'] as $xmlkey) { if (!$result) { //Skip on error @@ -552,33 +585,33 @@ class xmldb_table extends xmldb_object { $result = false; } - /// Perform some general checks over keys + // Perform some general checks over keys if ($result && $this->keys) { - /// Check keys names are ok (lowercase, a-z _-) + // Check keys names are ok (lowercase, a-z _-) if (!$this->checkNameValues($this->keys)) { $this->errormsg = 'Some KEYS name values are incorrect'; $this->debug($this->errormsg); $result = false; } - /// Check previous & next are ok (duplicates and existing keys) + // Check previous & next are ok (duplicates and existing keys) $this->fixPrevNext($this->keys); if ($result && !$this->checkPreviousNextValues($this->keys)) { $this->errormsg = 'Some KEYS previous/next values are incorrect'; $this->debug($this->errormsg); $result = false; } - /// Order keys + // Order keys if ($result && !$this->orderKeys($this->keys)) { $this->errormsg = 'Error ordering the keys'; $this->debug($this->errormsg); $result = false; } - /// TODO: Only one PK - /// TODO: Not keys with repeated fields - /// TODO: Check fields and reffieds exist in table + // TODO: Only one PK + // TODO: Not keys with repeated fields + // TODO: Check fields and reffieds exist in table } - /// Iterate over indexes + // Iterate over indexes if (isset($xmlarr['#']['INDEXES']['0']['#']['INDEX'])) { foreach ($xmlarr['#']['INDEXES']['0']['#']['INDEX'] as $xmlindex) { if (!$result) { //Skip on error @@ -596,32 +629,32 @@ class xmldb_table extends xmldb_object { } } - /// Perform some general checks over indexes + // Perform some general checks over indexes if ($result && $this->indexes) { - /// Check field names are ok (lowercase, a-z _-) + // Check field names are ok (lowercase, a-z _-) if (!$this->checkNameValues($this->indexes)) { $this->errormsg = 'Some INDEXES name values are incorrect'; $this->debug($this->errormsg); $result = false; } - /// Check previous & next are ok (duplicates and existing INDEXES) + // Check previous & next are ok (duplicates and existing INDEXES) $this->fixPrevNext($this->indexes); if ($result && !$this->checkPreviousNextValues($this->indexes)) { $this->errormsg = 'Some INDEXES previous/next values are incorrect'; $this->debug($this->errormsg); $result = false; } - /// Order indexes + // Order indexes if ($result && !$this->orderIndexes($this->indexes)) { $this->errormsg = 'Error ordering the indexes'; $this->debug($this->errormsg); $result = false; } - /// TODO: Not indexes with repeated fields - /// TODO: Check fields exist in table + // TODO: Not indexes with repeated fields + // TODO: Check fields exist in table } - /// Set some attributes + // Set some attributes if ($result) { $this->loaded = true; } @@ -631,15 +664,16 @@ class xmldb_table extends xmldb_object { /** * This function calculate and set the hash of one xmldb_table + * @param bool $recursive */ - function calculateHash($recursive = false) { + public function calculateHash($recursive = false) { if (!$this->loaded) { - $this->hash = NULL; + $this->hash = null; } else { $key = $this->name . $this->comment; if ($this->fields) { foreach ($this->fields as $fie) { - $field =& $this->getField($fie->getName()); + $field = $this->getField($fie->getName()); if ($recursive) { $field->calculateHash($recursive); } @@ -648,7 +682,7 @@ class xmldb_table extends xmldb_object { } if ($this->keys) { foreach ($this->keys as $ke) { - $k =& $this->getKey($ke->getName()); + $k = $this->getKey($ke->getName()); if ($recursive) { $k->calculateHash($recursive); } @@ -657,7 +691,7 @@ class xmldb_table extends xmldb_object { } if ($this->indexes) { foreach ($this->indexes as $in) { - $index =& $this->getIndex($in->getName()); + $index = $this->getIndex($in->getName()); if ($recursive) { $index->calculateHash($recursive); } @@ -677,7 +711,7 @@ class xmldb_table extends xmldb_object { * @param xmldb_table $xmldb_table optional when object is table * @return string null if ok, error message if problem found */ - function validateDefinition(xmldb_table $xmldb_table=null) { + public function validateDefinition(xmldb_table $xmldb_table=null) { // table parameter is ignored $name = $this->getName(); if (strlen($name) > self::NAME_MAX_LENGTH) { @@ -689,10 +723,12 @@ class xmldb_table extends xmldb_object { return null; } - /** + + /** * This function will output the XML text for one table + * @return string */ - function xmlOutput() { + public function xmlOutput() { $o = ''; $o.= ' comment) { @@ -705,7 +741,7 @@ class xmldb_table extends xmldb_object { $o.= ' NEXT="' . $this->next . '"'; } $o.= '>' . "\n"; - /// Now the fields + // Now the fields if ($this->fields) { $o.= ' ' . "\n"; foreach ($this->fields as $field) { @@ -713,7 +749,7 @@ class xmldb_table extends xmldb_object { } $o.= ' ' . "\n"; } - /// Now the keys + // Now the keys if ($this->keys) { $o.= ' ' . "\n"; foreach ($this->keys as $key) { @@ -721,7 +757,7 @@ class xmldb_table extends xmldb_object { } $o.= ' ' . "\n"; } - /// Now the indexes + // Now the indexes if ($this->indexes) { $o.= ' ' . "\n"; foreach ($this->indexes as $index) { @@ -738,16 +774,17 @@ class xmldb_table extends xmldb_object { * This function will add one new field to the table with all * its attributes defined * - * @param string name name of the field - * @param string type XMLDB_TYPE_INTEGER, XMLDB_TYPE_NUMBER, XMLDB_TYPE_CHAR, XMLDB_TYPE_TEXT, XMLDB_TYPE_BINARY - * @param string precision length for integers and chars, two-comma separated numbers for numbers - * @param string unsigned XMLDB_UNSIGNED or null (or false) - * @param string notnull XMLDB_NOTNULL or null (or false) - * @param string sequence XMLDB_SEQUENCE or null (or false) - * @param string default meaningful default o null (or false) - * @param string previous name of the previous field in the table or null (or false) + * @param string $name name of the field + * @param int $type XMLDB_TYPE_INTEGER, XMLDB_TYPE_NUMBER, XMLDB_TYPE_CHAR, XMLDB_TYPE_TEXT, XMLDB_TYPE_BINARY + * @param string $precision length for integers and chars, two-comma separated numbers for numbers + * @param bool $unsigned XMLDB_UNSIGNED or null (or false) + * @param bool $notnull XMLDB_NOTNULL or null (or false) + * @param bool $sequence XMLDB_SEQUENCE or null (or false) + * @param mixed $default meaningful default o null (or false) + * @param xmldb_object $previous name of the previous field in the table or null (or false) + * @return xmlddb_field */ - function add_field($name, $type, $precision=null, $unsigned=null, $notnull=null, $sequence=null, $default=null, $previous=null) { + public function add_field($name, $type, $precision=null, $unsigned=null, $notnull=null, $sequence=null, $default=null, $previous=null) { $field = new xmldb_field($name, $type, $precision, $unsigned, $notnull, $sequence, $default); $this->addField($field, $previous); @@ -758,13 +795,13 @@ class xmldb_table extends xmldb_object { * This function will add one new key to the table with all * its attributes defined * - * @param string name name of the key - * @param string type XMLDB_KEY_PRIMARY, XMLDB_KEY_UNIQUE, XMLDB_KEY_FOREIGN - * @param array fields an array of fieldnames to build the key over - * @param string reftable name of the table the FK points to or null - * @param array reffields an array of fieldnames in the FK table or null + * @param string $name name of the key + * @param int $type XMLDB_KEY_PRIMARY, XMLDB_KEY_UNIQUE, XMLDB_KEY_FOREIGN + * @param array $fields an array of fieldnames to build the key over + * @param string $reftable name of the table the FK points to or null + * @param array $reffields an array of fieldnames in the FK table or null */ - function add_key($name, $type, $fields, $reftable=null, $reffields=null) { + public function add_key($name, $type, $fields, $reftable=null, $reffields=null) { $key = new xmldb_key($name, $type, $fields, $reftable, $reffields); $this->addKey($key); } @@ -773,11 +810,11 @@ class xmldb_table extends xmldb_object { * This function will add one new index to the table with all * its attributes defined * - * @param string name name of the index - * @param string type XMLDB_INDEX_UNIQUE, XMLDB_INDEX_NOTUNIQUE - * @param array fields an array of fieldnames to build the index over + * @param string $name name of the index + * @param int $type XMLDB_INDEX_UNIQUE, XMLDB_INDEX_NOTUNIQUE + * @param array $fields an array of fieldnames to build the index over */ - function add_index($name, $type, $fields) { + public function add_index($name, $type, $fields) { $index = new xmldb_index($name, $type, $fields); $this->addIndex($index); } @@ -787,14 +824,14 @@ class xmldb_table extends xmldb_object { * looking recursively inside each field/key/index. Returns * an array of errors or false */ - function getAllErrors() { + public function getAllErrors() { $errors = array(); - /// First the table itself + // First the table itself if ($this->getError()) { $errors[] = $this->getError(); } - /// Delegate to fields + // Delegate to fields if ($fields = $this->getFields()) { foreach ($fields as $field) { if ($field->getError()) { @@ -802,7 +839,7 @@ class xmldb_table extends xmldb_object { } } } - /// Delegate to keys + // Delegate to keys if ($keys = $this->getKeys()) { foreach ($keys as $key) { if ($key->getError()) { @@ -810,7 +847,7 @@ class xmldb_table extends xmldb_object { } } } - /// Delegate to indexes + // Delegate to indexes if ($indexes = $this->getIndexes()) { foreach ($indexes as $index) { if ($index->getError()) { @@ -818,7 +855,7 @@ class xmldb_table extends xmldb_object { } } } - /// Return decision + // Return decision if (count($errors)) { return $errors; } else { diff --git a/lib/yui/blocks/blocks.js b/lib/yui/blocks/blocks.js index 8555f327f14..21cc5f1a7dc 100644 --- a/lib/yui/blocks/blocks.js +++ b/lib/yui/blocks/blocks.js @@ -87,7 +87,7 @@ YUI.add('moodle-core-blocks', function(Y) { }).plug(Y.Plugin.DDConstrained, { // Keep it inside the .course-content constrain: '#'+CSS.PAGECONTENT - }); + }).plug(Y.Plugin.DDWinScroll); } }, this); }, this); @@ -267,5 +267,5 @@ YUI.add('moodle-core-blocks', function(Y) { M.core_blocks.init_dragdrop = function(params) { new DRAGBLOCK(params); } -}, '@VERSION@', {requires:['base', 'node', 'io', 'dom', 'dd', 'moodle-core-dragdrop', 'moodle-enrol-notification']}); +}, '@VERSION@', {requires:['base', 'node', 'io', 'dom', 'dd', 'dd-scroll', 'moodle-core-dragdrop', 'moodle-enrol-notification']}); diff --git a/lib/yui/chooserdialogue/chooserdialogue.js b/lib/yui/chooserdialogue/chooserdialogue.js index ebc37e17b27..e67af297d4d 100644 --- a/lib/yui/chooserdialogue/chooserdialogue.js +++ b/lib/yui/chooserdialogue/chooserdialogue.js @@ -17,6 +17,9 @@ YUI.add('moodle-core-chooserdialogue', function(Y) { // Any event listeners we may need to cancel later listenevents : [], + // The initial overflow setting + initialoverflow : '', + setup_chooser_dialogue : function(bodycontent, headercontent, config) { // Set Default options var params = { @@ -66,8 +69,28 @@ YUI.add('moodle-core-chooserdialogue', function(Y) { var bb = this.overlay.get('boundingBox'); var dialogue = this.container.one('.alloptions'); + // Get the overflow setting when the chooser was opened - we + // may need this later + if (Y.UA.ie > 0) { + this.initialoverflow = Y.one('html').getStyle('overflow'); + } else { + this.initialoverflow = Y.one('body').getStyle('overflow'); + } + var thisevent; + // This will detect a change in orientation and retrigger centering + thisevent = Y.one('document').on('orientationchange', function(e) { + this.center_dialogue(dialogue); + }, this); + this.listenevents.push(thisevent); + + // Detect window resizes (most browsers) + thisevent = Y.one('window').on('resize', function(e) { + this.center_dialogue(dialogue); + }, this); + this.listenevents.push(thisevent); + // These will trigger a check_options call to display the correct help thisevent = this.container.on('click', this.check_options, this); this.listenevents.push(thisevent); @@ -95,10 +118,14 @@ YUI.add('moodle-core-chooserdialogue', function(Y) { }, this); // Hook onto the cancel button to hide the form - this.container.one('#addcancel').on('click', this.cancel_popup, this); + thisevent = this.container.one('#addcancel').on('click', this.cancel_popup, this); + this.listenevents.push(thisevent); + thisevent = bb.one('div.closebutton').on('click', this.cancel_popup, this); + this.listenevents.push(thisevent); // Grab global keyup events and handle them - Y.one('document').on('keyup', this.handle_key_press, this); + thisevent = Y.one('document').on('keyup', this.handle_key_press, this); + this.listenevents.push(thisevent); // Add references to various elements we adjust this.jumplink = this.container.one('#jump'); @@ -152,6 +179,7 @@ YUI.add('moodle-core-chooserdialogue', function(Y) { var bb = this.overlay.get('boundingBox'); var winheight = bb.get('winHeight'); + var winwidth = bb.get('winWidth'); var offsettop = 0; // Try and set a sensible max-height -- this must be done before setting the top @@ -169,9 +197,21 @@ YUI.add('moodle-core-chooserdialogue', function(Y) { // Set a fixed position if the window is large enough if (newheight > this.get('minheight')) { bb.setStyle('position', 'fixed'); + // Disable the page scrollbars + if (Y.UA.ie > 0) { + Y.one('html').setStyle('overflow', 'hidden'); + } else { + Y.one('body').setStyle('overflow', 'hidden'); + } } else { bb.setStyle('position', 'absolute'); offsettop = Y.one('window').get('scrollTop'); + // Ensure that the page scrollbars are enabled + if (Y.UA.ie > 0) { + Y.one('html').setStyle('overflow', this.initialoverflow); + } else { + Y.one('body').setStyle('overflow', this.initialoverflow); + } } // Take off 15px top and bottom for borders, plus 40px each for the title and button area before setting the @@ -187,6 +227,13 @@ YUI.add('moodle-core-chooserdialogue', function(Y) { // We need to set the height for the yui3-widget - can't work // out what we're setting at present -- shoud be the boudingBox bb.setStyle('top', dialoguetop + 'px'); + + // Calculate the left location of the chooser + // We don't set a minimum width in the same way as we do height as the width would be far lower than the + // optimal width for moodle anyway. + var dialoguewidth = bb.get('offsetWidth'); + var dialogueleft = (winwidth - dialoguewidth) / 2; + bb.setStyle('left', dialogueleft + 'px'); }, handle_key_press : function(e) { @@ -202,8 +249,16 @@ YUI.add('moodle-core-chooserdialogue', function(Y) { }, hide : function() { - // Detach the global keypress handler before hiding - Y.one('document').detach('keyup', this.handle_key_press, this); + // Cancel all listen events + this.cancel_listenevents(); + + // Re-enable the page scrollbars + if (Y.UA.ie > 0) { + Y.one('html').setStyle('overflow', this.initialoverflow); + } else { + Y.one('body').setStyle('overflow', this.initialoverflow); + } + this.container.detachAll(); this.overlay.hide(); }, diff --git a/mod/assign/gradingoptionsform.php b/mod/assign/gradingoptionsform.php index d9abe0fb35a..cf90c867108 100644 --- a/mod/assign/gradingoptionsform.php +++ b/mod/assign/gradingoptionsform.php @@ -47,14 +47,16 @@ class mod_assign_grading_options_form extends moodleform { $mform->addElement('header', 'general', get_string('gradingoptions', 'assign')); // visible elements - $options = array(-1=>'All',10=>'10', 20=>'20', 50=>'50', 100=>'100'); - $mform->addElement('select', 'perpage', get_string('assignmentsperpage', 'assign'), $options, array('class'=>'ignoredirty')); - $options = array(''=>get_string('filternone', 'assign'), ASSIGN_FILTER_SUBMITTED=>get_string('filtersubmitted', 'assign'), ASSIGN_FILTER_REQUIRE_GRADING=>get_string('filterrequiregrading', 'assign')); - $mform->addElement('select', 'filter', get_string('filter', 'assign'), $options, array('class'=>'ignoredirty')); + $options = array(-1=>get_string('all'),10=>'10', 20=>'20', 50=>'50', 100=>'100'); + $mform->addElement('select', 'perpage', get_string('assignmentsperpage', 'assign'), $options); + $options = array('' => get_string('filternone', 'assign'), + ASSIGN_FILTER_SUBMITTED => get_string('filtersubmitted', 'assign'), + ASSIGN_FILTER_REQUIRE_GRADING => get_string('filterrequiregrading', 'assign')); + $mform->addElement('select', 'filter', get_string('filter', 'assign'), $options); // quickgrading if ($instance['showquickgrading']) { - $mform->addElement('checkbox', 'quickgrading', get_string('quickgrading', 'assign'), '', array('class'=>'ignoredirty')); + $mform->addElement('checkbox', 'quickgrading', get_string('quickgrading', 'assign'), ''); $mform->addHelpButton('quickgrading', 'quickgrading', 'assign'); $mform->setDefault('quickgrading', $instance['quickgrading']); } diff --git a/mod/assign/gradingtable.php b/mod/assign/gradingtable.php index ad00b800ea4..abd5b7212b1 100644 --- a/mod/assign/gradingtable.php +++ b/mod/assign/gradingtable.php @@ -119,7 +119,7 @@ class assign_grading_table extends table_sql implements renderable { // Select $columns[] = 'select'; - $headers[] = get_string('select') . '
      '; + $headers[] = get_string('select') . '
      '; // Edit links if (!$this->is_downloading()) { @@ -303,7 +303,7 @@ class assign_grading_table extends table_sql implements renderable { * @return string */ function col_select(stdClass $row) { - return ''; + return ''; } /** @@ -373,7 +373,7 @@ class assign_grading_table extends table_sql implements renderable { function col_timemarked(stdClass $row) { $o = '-'; - if ($row->timemarked) { + if ($row->timemarked && $row->grade !== NULL && $row->grade >= 0) { $o = userdate($row->timemarked); } diff --git a/mod/assign/lang/en/assign.php b/mod/assign/lang/en/assign.php index bfe387b7f73..bb2fc384dca 100644 --- a/mod/assign/lang/en/assign.php +++ b/mod/assign/lang/en/assign.php @@ -22,6 +22,7 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +$string['addsubmission'] = 'Add submission'; $string['allowsubmissions'] = 'Allow the user to continue making submissions to this assignment.'; $string['allowsubmissionsshort'] = 'Allow submission changes'; $string['allowsubmissionsfromdate'] = 'Allow submissions from'; @@ -216,7 +217,7 @@ You can see the status of your assignment submission: {$a->url}'; $string['submissionreceipthtml'] = 'You have submitted an assignment submission for \'{$a->assignment}\'

      -You can the status of your assignment submission.'; +You can see the status of your assignment submission.'; $string['submissionreceiptsmall'] = 'You have submitted your assignment submission for {$a->assignment}'; $string['submissionslocked'] = 'This assignment is not accepting submissions'; $string['submissionslockedshort'] = 'Submission changes not allowed'; diff --git a/mod/assign/locallib.php b/mod/assign/locallib.php index a7466d13064..28e88300e4d 100644 --- a/mod/assign/locallib.php +++ b/mod/assign/locallib.php @@ -2121,7 +2121,9 @@ class assign { // trying to match those array keys in grade update function in gradelib.php // with keys in th database table assign_grades // starting around line 262 - $gradebookgrade['rawgrade'] = $grade->grade; + if ($grade->grade >= 0) { + $gradebookgrade['rawgrade'] = $grade->grade; + } $gradebookgrade['userid'] = $grade->userid; $gradebookgrade['usermodified'] = $grade->grader; $gradebookgrade['datesubmitted'] = NULL; @@ -3349,8 +3351,10 @@ class assign { // now get the feedback if ($gradebookplugin) { $grade = $this->get_user_grade($result->userid, false); - $gradebookgrade->feedbacktext = $gradebookplugin->text_for_gradebook($grade); - $gradebookgrade->feedbackformat = $gradebookplugin->format_for_gradebook($grade); + if ($grade) { + $gradebookgrade->feedbacktext = $gradebookplugin->text_for_gradebook($grade); + $gradebookgrade->feedbackformat = $gradebookplugin->format_for_gradebook($grade); + } } $grades[$gradebookgrade->userid] = $gradebookgrade; } diff --git a/mod/assign/module.js b/mod/assign/module.js index 5786e1e79b4..d01c9b30318 100644 --- a/mod/assign/module.js +++ b/mod/assign/module.js @@ -110,27 +110,8 @@ M.mod_assign.init_grading_table = function(Y) { }); }; -M.mod_assign.check_dirty_quickgrading_form = function(e) { - if (!M.core_formchangechecker.get_form_dirty_state()) { - // the form is not dirty, so don't display any message - return; - } - - // This is the error message that we'll show to browsers which support it - var warningmessage = 'There are unsaved quickgrading changes. Do you really wanto to leave this page?'; - - // Most browsers are happy with the returnValue being set on the event - // But some browsers do not consistently pass the event - if (e) { - e.returnValue = warningmessage; - } - - // But some require it to be returned instead - return warningmessage; -} M.mod_assign.init_grading_options = function(Y) { Y.use('node', function(Y) { - var paginationelement = Y.one('#id_perpage'); paginationelement.on('change', function(e) { Y.one('form.gradingoptionsform').submit(); @@ -145,28 +126,5 @@ M.mod_assign.init_grading_options = function(Y) { Y.one('form.gradingoptionsform').submit(); }); } - }); - - -}; -// override the default dirty form behaviour to ignore any input with the class "ignoredirty" -M.mod_assign.set_form_changed = M.core_formchangechecker.set_form_changed; -M.core_formchangechecker.set_form_changed = function(e) { - var target = e.currentTarget; - if (!target.hasClass('ignoredirty')) { - M.mod_assign.set_form_changed(e); - } -} - -M.mod_assign.get_form_dirty_state = M.core_formchangechecker.get_form_dirty_state; -M.core_formchangechecker.get_form_dirty_state = function() { - var state = M.core_formchangechecker.stateinformation; - if (state.focused_element) { - if (state.focused_element.element.hasClass('ignoredirty')) { - state.focused_element.initial_value = state.focused_element.element.get('value') - } - } - return M.mod_assign.get_form_dirty_state(); -} - +}; \ No newline at end of file diff --git a/mod/assign/renderer.php b/mod/assign/renderer.php index a55c621c9ff..ab3af8a60b7 100644 --- a/mod/assign/renderer.php +++ b/mod/assign/renderer.php @@ -273,11 +273,12 @@ class mod_assign_renderer extends plugin_renderer_base { $o .= $this->output->box_end(); // link to the grading page - $o .= $this->output->single_button(new moodle_url('/mod/assign/view.php', + $o .= $this->output->container_start('submissionlinks'); + $o .= $this->output->action_link(new moodle_url('/mod/assign/view.php', array('id' => $summary->coursemoduleid, 'action'=>'grading')), - get_string('viewgrading', 'assign'), - 'get'); + get_string('viewgrading', 'assign')); + $o .= $this->output->container_end(); // close the container and insert a spacer $o .= $this->output->container_end(); @@ -466,8 +467,13 @@ class mod_assign_renderer extends plugin_renderer_base { // links if ($status->canedit) { - $o .= $this->output->single_button(new moodle_url('/mod/assign/view.php', - array('id' => $status->coursemoduleid, 'action' => 'editsubmission')), get_string('editsubmission', 'assign'), 'get'); + if (!$status->submission) { + $o .= $this->output->single_button(new moodle_url('/mod/assign/view.php', + array('id' => $status->coursemoduleid, 'action' => 'editsubmission')), get_string('addsubmission', 'assign'), 'get'); + } else { + $o .= $this->output->single_button(new moodle_url('/mod/assign/view.php', + array('id' => $status->coursemoduleid, 'action' => 'editsubmission')), get_string('editsubmission', 'assign'), 'get'); + } } if ($status->cansubmit) { diff --git a/mod/assign/upgradelib.php b/mod/assign/upgradelib.php index 3852d076b8c..92d59a06e9a 100644 --- a/mod/assign/upgradelib.php +++ b/mod/assign/upgradelib.php @@ -154,8 +154,12 @@ class assign_upgrade_manager { // upgrade completion data $DB->set_field('course_modules_completion', 'coursemoduleid', $newcoursemodule->id, array('coursemoduleid'=>$oldcoursemodule->id)); - $DB->set_field('course_completion_criteria', 'module', 'assign', array('moduleinstance'=>$oldcoursemodule->id)); - $DB->set_field('course_completion_criteria', 'moduleinstance', $newcoursemodule->id, array('moduleinstance'=>$oldcoursemodule->id)); + $allcriteria = $DB->get_records('course_completion_criteria', array('moduleinstance'=>$oldcoursemodule->id)); + foreach ($allcriteria as $criteria) { + $criteria->module = 'assign'; + $criteria->moduleinstance = $newcoursemodule->id; + $DB->update_record('course_completion_criteria', $criteria); + } $completiondone = true; @@ -221,8 +225,13 @@ class assign_upgrade_manager { $newassignment->update_calendar($newcoursemodule->id); // copy the grades from the old assignment to the new one - $DB->set_field('grade_items', 'itemmodule', 'assign', array('iteminstance'=>$oldassignment->id, 'itemmodule'=>'assignment')); - $DB->set_field('grade_items', 'iteminstance', $newassignment->get_instance()->id, array('iteminstance'=>$oldassignment->id, 'itemmodule'=>'assign')); + + $gradeitem = $DB->get_record('grade_items', array('iteminstance'=>$oldassignment->id, 'itemmodule'=>'assignment'), 'id', IGNORE_MISSING); + if ($gradeitem) { + $gradeitem->iteminstance = $newassignment->get_instance()->id; + $gradeitem->itemmodule = 'assign'; + $DB->update_record('grade_items', $gradeitem); + } $gradesdone = true; } catch (Exception $exception) { @@ -234,14 +243,22 @@ class assign_upgrade_manager { // roll back the grades changes if ($gradesdone) { // copy the grades from the old assignment to the new one - $DB->set_field('grade_items', 'itemmodule', 'assignment', array('iteminstance'=>$newassignment->get_instance()->id, 'itemmodule'=>'assign')); - $DB->set_field('grade_items', 'iteminstance', $oldassignment->id, array('iteminstance'=>$newassignment->get_instance()->id, 'itemmodule'=>'assignment')); + $gradeitem = $DB->get_record('grade_items', array('iteminstance'=>$newassignment->get_instance()->id, 'itemmodule'=>'assign'), 'id', IGNORE_MISSING); + if ($gradeitem) { + $gradeitem->iteminstance = $oldassignment->id; + $gradeitem->itemmodule = 'assignment'; + $DB->update_record('grade_items', $gradeitem); + } } // roll back the completion changes if ($completiondone) { $DB->set_field('course_modules_completion', 'coursemoduleid', $oldcoursemodule->id, array('coursemoduleid'=>$newcoursemodule->id)); - $DB->set_field('course_completion_criteria', 'module', 'assignment', array('moduleinstance'=>$newcoursemodule->id)); - $DB->set_field('course_completion_criteria', 'moduleinstance', $oldcoursemodule->id, array('moduleinstance'=>$newcoursemodule->id)); + $allcriteria = $DB->get_records('course_completion_criteria', array('moduleinstance'=>$newcoursemodule->id)); + foreach ($allcriteria as $criteria) { + $criteria->module = 'assignment'; + $criteria->moduleinstance = $oldcoursemodule->id; + $DB->update_record('course_completion_criteria', $criteria); + } } // roll back the advanced grading update if ($gradingarea) { diff --git a/mod/book/README.md b/mod/book/README.md index c4161c14b29..4aa893388bf 100644 --- a/mod/book/README.md +++ b/mod/book/README.md @@ -19,24 +19,6 @@ Created by: * Petr Skoda (skodak) - most of the coding & design * Mojmir Volf, Eloy Lafuente, Antonio Vicent and others - - -Project page: - -* https://github.com/skodak/moodle-mod_book -* http://moodle.org/plugins/view.php?plugin=mod_book - - -Installation: - -* http://docs.moodle.org/20/en/Installing_contributed_modules_or_plugins - - -Issue tracker: - -* https://github.com/skodak/moodle-mod_book/issues?milestone=&labels= - - Intentionally omitted features: * more chapter levels - it would encourage teachers to write too much complex and long books, better use standard standalone HTML editor and import it as Resource. DocBook format is another suitable solution. @@ -44,8 +26,3 @@ Intentionally omitted features: * PDF export - there is no elegant way AFAIK to convert HTML to PDF, use virtual PDF printer or better use DocBook format for authoring * detailed student tracking (postponed till officially supported) * export as zipped set of HTML pages - instead use browser command Save page as... in print view - - -Future: - -* No more development planned diff --git a/mod/book/backup/moodle1/lib.php b/mod/book/backup/moodle1/lib.php index 5a5852603f5..00805bf2dbf 100644 --- a/mod/book/backup/moodle1/lib.php +++ b/mod/book/backup/moodle1/lib.php @@ -1,5 +1,5 @@ opening element + * This is executed when the parser reaches the opening element */ public function on_book_chapters_start() { $this->xmlwriter->begin_tag('chapters'); } /** - * This is executed when the parser reaches the closing element + * This is executed when the parser reaches the closing element */ public function on_book_chapters_end() { $this->xmlwriter->end_tag('chapters'); diff --git a/mod/book/backup/moodle2/restore_book_stepslib.php b/mod/book/backup/moodle2/restore_book_stepslib.php index 09ee5a0b877..93d826efa75 100644 --- a/mod/book/backup/moodle2/restore_book_stepslib.php +++ b/mod/book/backup/moodle2/restore_book_stepslib.php @@ -18,7 +18,6 @@ * Define all the restore steps that will be used by the restore_book_activity_task * * @package mod_book - * @subpackage book * @copyright 2010 Petr Skoda {@link http://skodak.org} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/mod/book/db/access.php b/mod/book/db/access.php index d831e3bfad5..850894d7df8 100644 --- a/mod/book/db/access.php +++ b/mod/book/db/access.php @@ -1,5 +1,5 @@ . - /** * Book module upgrade code * diff --git a/mod/book/delete.php b/mod/book/delete.php index 02203bb82dc..63c9507064a 100644 --- a/mod/book/delete.php +++ b/mod/book/delete.php @@ -1,5 +1,5 @@ get_record('book_chapters', array('id'=>$chapterid, 'bookid'=>$b // Header and strings. -$PAGE->set_title(format_string($book->name)); -$PAGE->add_body_class('mod_book'); -$PAGE->set_heading(format_string($course->fullname)); +$PAGE->set_title($book->name); +$PAGE->set_heading($course->fullname); // Form processing. if ($confirm) { // the operation was confirmed. diff --git a/mod/book/edit.php b/mod/book/edit.php index 50088adf8d3..541233daf48 100644 --- a/mod/book/edit.php +++ b/mod/book/edit.php @@ -1,5 +1,5 @@ is_cancelled()) { } // Otherwise fill and print the form. -$PAGE->set_title(format_string($book->name)); -$PAGE->add_body_class('mod_book'); -$PAGE->set_heading(format_string($course->fullname)); +$PAGE->set_title($book->name); +$PAGE->set_heading($course->fullname); echo $OUTPUT->header(); echo $OUTPUT->heading(get_string('editingchapter', 'mod_book')); diff --git a/mod/book/edit_form.php b/mod/book/edit_form.php index ca1e54fb27e..8384104e9fd 100644 --- a/mod/book/edit_form.php +++ b/mod/book/edit_form.php @@ -1,5 +1,5 @@ _customdata['chapter']; $options = $this->_customdata['options']; + // Disabled subchapter option when editing first node. + $disabledmsg = null; + if ($chapter->pagenum == 1) { + $disabledmsg = get_string('subchapternotice', 'book'); + } + $mform = $this->_form; $mform->addElement('header', 'general', get_string('edit')); @@ -42,7 +48,7 @@ class book_chapter_edit_form extends moodleform { $mform->setType('title', PARAM_RAW); $mform->addRule('title', null, 'required', null, 'client'); - $mform->addElement('advcheckbox', 'subchapter', get_string('subchapter', 'mod_book')); + $mform->addElement('advcheckbox', 'subchapter', get_string('subchapter', 'mod_book'), $disabledmsg); $mform->addElement('editor', 'content_editor', get_string('content', 'mod_book'), null, $options); $mform->setType('content_editor', PARAM_RAW); @@ -62,4 +68,12 @@ class book_chapter_edit_form extends moodleform { // set the defaults $this->set_data($chapter); } + + function definition_after_data(){ + $mform = $this->_form; + $pagenum = $mform->getElement('pagenum'); + if ($pagenum->getValue() == 1) { + $mform->hardFreeze('subchapter'); + } + } } diff --git a/mod/book/index.php b/mod/book/index.php index 02ed62dbda5..b413ba3cc2c 100644 --- a/mod/book/index.php +++ b/mod/book/index.php @@ -1,5 +1,5 @@ section; } } else { - $printsection = ''.userdate($book->timemodified).""; + $printsection = html_writer::tag('span', userdate($book->timemodified), array('class' => 'smallinfo')); } - $class = $book->visible ? '' : 'class="dimmed"'; // hidden modules are dimmed + $class = $book->visible ? null : array('class' => 'dimmed'); // hidden modules are dimmed $table->data[] = array ( $printsection, - "id\">".format_string($book->name)."", + html_writer::link(new moodle_url('view.php', array('id' => $cm->id)), format_string($book->name), $class), format_module_intro('book', $book, $cm->id)); } diff --git a/mod/book/lang/en/book.php b/mod/book/lang/en/book.php index 5d29b71943c..470e18e7d9d 100644 --- a/mod/book/lang/en/book.php +++ b/mod/book/lang/en/book.php @@ -1,5 +1,5 @@ cm->modname !== 'book') { - return; - } + global $USER, $PAGE; $plugins = get_plugin_list('booktool'); foreach ($plugins as $plugin => $dir) { diff --git a/mod/book/locallib.php b/mod/book/locallib.php index b0a23af236d..26d0e4069a8 100644 --- a/mod/book/locallib.php +++ b/mod/book/locallib.php @@ -1,5 +1,5 @@ subchapter) { - $ch->prev = $prev; - $ch->next = null; - if ($prev) { - $chapters[$prev]->next = $ch->id; - } if ($ch->hidden) { if ($book->numbering == BOOK_NUM_NUMBERS) { $ch->number = 'x'; @@ -97,11 +92,6 @@ function book_preload_chapters($book) { $ch->parent = null; $ch->subchapters = array(); } else { - $ch->prev = $prevsub; - $ch->next = null; - if ($prevsub) { - $chapters[$prevsub]->next = $ch->id; - } $ch->parent = $parent; $ch->subchapters = null; $chapters[$parent]->subchapters[$ch->id] = $ch->id; @@ -120,6 +110,7 @@ function book_preload_chapters($book) { $ch->number = $j; } } + if ($oldch->subchapter != $ch->subchapter or $oldch->pagenum != $ch->pagenum or $oldch->hidden != $ch->hidden) { // update only if something changed $DB->update_record('book_chapters', $ch); @@ -159,27 +150,6 @@ function book_get_chapter_title($chid, $chapters, $book, $context) { return $title; } -/** - * General logging to table - * @param string $str1 - * @param string $str2 - * @param int $level - * @return void - */ -function book_log($str1, $str2, $level = 0) { - switch ($level) { - case 1: - echo '
      '; - break; - case 2: - echo ''; - break; - default: - echo ''; - break; - } -} - /** * Add the book TOC sticky block to the 1st region available * @@ -217,7 +187,7 @@ function book_add_fake_block($chapters, $chapter, $book, $cm, $edit) { function book_get_toc($chapters, $chapter, $book, $cm, $edit) { global $USER, $OUTPUT; - $toc = ''; // Representation of toc (HTML) + $toc = ''; $nch = 0; // Chapter number $ns = 0; // Subchapter number $first = 1; @@ -226,27 +196,35 @@ function book_get_toc($chapters, $chapter, $book, $cm, $edit) { switch ($book->numbering) { case BOOK_NUM_NONE: - $toc .= '
      '; + $toc .= html_writer::start_tag('div', array('class' => 'book_toc_none')); break; case BOOK_NUM_NUMBERS: - $toc .= '
      '; + $toc .= html_writer::start_tag('div', array('class' => 'book_toc_numbered')); break; case BOOK_NUM_BULLETS: - $toc .= '
      '; + $toc .= html_writer::start_tag('div', array('class' => 'book_toc_bullets')); break; case BOOK_NUM_INDENTED: - $toc .= '
      '; + $toc .= html_writer::start_tag('div', array('class' => 'book_toc_indented')); break; } if ($edit) { // Teacher's TOC - $toc .= '
        '; + $toc .= html_writer::start_tag('ul'); $i = 0; foreach ($chapters as $ch) { $i++; $title = trim(format_string($ch->title, true, array('context'=>$context))); if (!$ch->subchapter) { - $toc .= ($first) ? '
      • ' : '
    • '; + + if ($first) { + $toc .= html_writer::start_tag('li'); + } else { + $toc .= html_writer::end_tag('ul'); + $toc .= html_writer::end_tag('li'); + $toc .= html_writer::start_tag('li'); + } + if (!$ch->hidden) { $nch++; $ns = 0; @@ -257,10 +235,18 @@ function book_get_toc($chapters, $chapter, $book, $cm, $edit) { if ($book->numbering == BOOK_NUM_NUMBERS) { $title = "x $title"; } - $title = ''.$title.''; + $title = html_writer::tag('span', $title, array('class' => 'dimmed_text')); } } else { - $toc .= ($first) ? '
      • ' : '
      • '; + + if ($first) { + $toc .= html_writer::start_tag('li'); + $toc .= html_writer::start_tag('ul'); + $toc .= html_writer::start_tag('li'); + } else { + $toc .= html_writer::start_tag('li'); + } + if (!$ch->hidden) { $ns++; if ($book->numbering == BOOK_NUM_NUMBERS) { @@ -274,75 +260,109 @@ function book_get_toc($chapters, $chapter, $book, $cm, $edit) { $title = "x.x $title"; } } - $title = ''.$title.''; + $title = html_writer::tag('span', $title, array('class' => 'dimmed_text')); } } if ($ch->id == $chapter->id) { - $toc .= ''.$title.''; + $toc .= html_writer::tag('strong', $title); } else { - $toc .= ''.$title.''; + $toc .= html_writer::link(new moodle_url('view.php', array('id' => $cm->id, 'chapterid' => $ch->id)), $title, array('title' => s($title))); } $toc .= '  '; if ($i != 1) { - $toc .= ' '.get_string('up').''; + $toc .= html_writer::link(new moodle_url('move.php', array('id' => $cm->id, 'chapterid' => $ch->id, 'up' => '1', 'sesskey' => $USER->sesskey)), + $OUTPUT->pix_icon('t/up', get_string('up')), array('title' => get_string('up'))); } if ($i != count($chapters)) { - $toc .= ' '.get_string('down').''; + $toc .= html_writer::link(new moodle_url('move.php', array('id' => $cm->id, 'chapterid' => $ch->id, 'up' => '0', 'sesskey' => $USER->sesskey)), + $OUTPUT->pix_icon('t/down', get_string('down')), array('title' => get_string('down'))); } - $toc .= ' '.get_string('edit').''; - $toc .= ' '.get_string('delete').''; + $toc .= html_writer::link(new moodle_url('edit.php', array('cmid' => $cm->id, 'id' => $ch->id)), + $OUTPUT->pix_icon('t/edit', get_string('edit')), array('title' => get_string('edit'))); + $toc .= html_writer::link(new moodle_url('delete.php', array('id' => $cm->id, 'chapterid' => $ch->id, 'sesskey' => $USER->sesskey)), + $OUTPUT->pix_icon('t/delete', get_string('delete')), array('title' => get_string('delete'))); if ($ch->hidden) { - $toc .= ' '.get_string('show').''; + $toc .= html_writer::link(new moodle_url('show.php', array('id' => $cm->id, 'chapterid' => $ch->id, 'sesskey' => $USER->sesskey)), + $OUTPUT->pix_icon('t/show', get_string('show')), array('title' => get_string('show'))); } else { - $toc .= ' '.get_string('hide').''; + $toc .= html_writer::link(new moodle_url('show.php', array('id' => $cm->id, 'chapterid' => $ch->id, 'sesskey' => $USER->sesskey)), + $OUTPUT->pix_icon('t/hide', get_string('hide')), array('title' => get_string('hide'))); } - $toc .= ' '.get_string('addafter', 'mod_book').''; + $toc .= html_writer::link(new moodle_url('edit.php', array('cmid' => $cm->id, 'pagenum' => $ch->pagenum, 'subchapter' => $ch->subchapter)), + $OUTPUT->pix_icon('add', get_string('addafter', 'mod_book'), 'mod_book'), array('title' => get_string('addafter', 'mod_book'))); - $toc .= (!$ch->subchapter) ? '
          ' : ''; + + if (!$ch->subchapter) { + $toc .= html_writer::start_tag('ul'); + } else { + $toc .= html_writer::end_tag('li'); + } $first = 0; } - $toc .= '
      '; + + $toc .= html_writer::end_tag('ul'); + $toc .= html_writer::end_tag('li'); + $toc .= html_writer::end_tag('ul'); + } else { // Normal students view - $toc .= '
        '; + $toc .= html_writer::start_tag('ul'); foreach ($chapters as $ch) { $title = trim(format_string($ch->title, true, array('context'=>$context))); if (!$ch->hidden) { if (!$ch->subchapter) { $nch++; $ns = 0; - $toc .= ($first) ? '
      • ' : '
    • '; + + if ($first) { + $toc .= html_writer::start_tag('li'); + } else { + $toc .= html_writer::end_tag('ul'); + $toc .= html_writer::end_tag('li'); + $toc .= html_writer::start_tag('li'); + } + if ($book->numbering == BOOK_NUM_NUMBERS) { $title = "$nch $title"; } } else { $ns++; - $toc .= ($first) ? '
      • ' : '
      • '; + + if ($first) { + $toc .= html_writer::start_tag('li'); + $toc .= html_writer::start_tag('ul'); + $toc .= html_writer::start_tag('li'); + } else { + $toc .= html_writer::start_tag('li'); + } + if ($book->numbering == BOOK_NUM_NUMBERS) { $title = "$nch.$ns $title"; } } if ($ch->id == $chapter->id) { - $toc .= ''.$title.''; + $toc .= html_writer::tag('strong', $title); } else { - $toc .= ''.$title.''; + $toc .= html_writer::link(new moodle_url('view.php', array('id' => $cm->id, 'chapterid' => $ch->id)), $title, array('title' => s($title))); } - $toc .= (!$ch->subchapter) ? '
          ' : ''; + + if (!$ch->subchapter) { + $toc .= html_writer::start_tag('ul'); + } else { + $toc .= html_writer::end_tag('li'); + } + $first = 0; } } - $toc .= '
      '; + + $toc .= html_writer::end_tag('ul'); + $toc .= html_writer::end_tag('li'); + $toc .= html_writer::end_tag('ul'); + } - $toc .= '
    • '; + $toc .= html_writer::end_tag('div'); $toc = str_replace('
        ', '', $toc); // Cleanup of invalid structures. diff --git a/mod/book/mod_form.php b/mod/book/mod_form.php index b795875c21a..8901645f5f1 100644 --- a/mod/book/mod_form.php +++ b/mod/book/mod_form.php @@ -1,5 +1,5 @@ id); require_capability('mod/book:read', $context); require_capability('booktool/exportimscp:export', $context); -$strbooks = get_string('modulenameplural', 'book'); -$strbook = get_string('modulename', 'book'); -$strtop = get_string('top', 'book'); - add_to_log($course->id, 'book', 'exportimscp', 'tool/exportimscp/index.php?id='.$cm->id, $book->id, $cm->id); $file = booktool_exportimscp_build_package($book, $context); diff --git a/mod/book/tool/exportimscp/lang/en/booktool_exportimscp.php b/mod/book/tool/exportimscp/lang/en/booktool_exportimscp.php index 5b6a50504cb..558469f8c9e 100644 --- a/mod/book/tool/exportimscp/lang/en/booktool_exportimscp.php +++ b/mod/book/tool/exportimscp/lang/en/booktool_exportimscp.php @@ -1,5 +1,5 @@ cm->modname !== 'book') { - return; - } + global $PAGE; if (has_capability('booktool/exportimscp:export', $PAGE->cm->context)) { $url = new moodle_url('/mod/book/tool/exportimscp/index.php', array('id'=>$PAGE->cm->id)); diff --git a/mod/book/tool/exportimscp/locallib.php b/mod/book/tool/exportimscp/locallib.php index 788c2f4cc43..374dbd6b555 100644 --- a/mod/book/tool/exportimscp/locallib.php +++ b/mod/book/tool/exportimscp/locallib.php @@ -1,5 +1,5 @@ set_title(format_string($book->name)); -$PAGE->add_body_class('mod_book'); -$PAGE->set_heading(format_string($course->fullname)); +$PAGE->set_title($book->name); +$PAGE->set_heading($course->fullname); // Prepare the page header. $strbook = get_string('modulename', 'mod_book'); diff --git a/mod/book/tool/importhtml/lang/en/booktool_importhtml.php b/mod/book/tool/importhtml/lang/en/booktool_importhtml.php index bbd811dc1ab..366810100a9 100644 --- a/mod/book/tool/importhtml/lang/en/booktool_importhtml.php +++ b/mod/book/tool/importhtml/lang/en/booktool_importhtml.php @@ -1,5 +1,5 @@ cm->modname !== 'book') { - return; - } + global $PAGE; if (has_capability('booktool/importhtml:import', $PAGE->cm->context)) { $url = new moodle_url('/mod/book/tool/importhtml/index.php', array('id'=>$PAGE->cm->id)); diff --git a/mod/book/tool/importhtml/locallib.php b/mod/book/tool/importhtml/locallib.php index 932054ba5f9..b846573267d 100644 --- a/mod/book/tool/importhtml/locallib.php +++ b/mod/book/tool/importhtml/locallib.php @@ -1,5 +1,5 @@ cm->modname !== 'book') { - return; - } - $params = $PAGE->url->params(); - if (empty($params['id']) or empty($params['chapterid'])) { return; } diff --git a/mod/book/tool/print/locallib.php b/mod/book/tool/print/locallib.php index 524ad16f2d7..200bee74867 100644 --- a/mod/book/tool/print/locallib.php +++ b/mod/book/tool/print/locallib.php @@ -1,5 +1,5 @@ numbering) { case BOOK_NUM_NONE: - $toc .= '
        '; + $toc .= html_writer::start_tag('div', array('class' => 'book_toc_none')); break; case BOOK_NUM_NUMBERS: - $toc .= '
        '; + $toc .= html_writer::start_tag('div', array('class' => 'book_toc_numbered')); break; case BOOK_NUM_BULLETS: - $toc .= '
        '; + $toc .= html_writer::start_tag('div', array('class' => 'book_toc_bullets')); break; case BOOK_NUM_INDENTED: - $toc .= '
        '; + $toc .= html_writer::start_tag('div', array('class' => 'book_toc_indented')); break; } - $toc .= ''; // Representation of toc (HTML). + $toc .= html_writer::tag('a', '', array('name' => 'toc')); // Representation of toc (HTML). if ($book->customtitles) { - $toc .= '

        '.get_string('toc', 'mod_book').'

        '; + $toc .= html_writer::tag('h1', get_string('toc', 'mod_book')); } else { - $toc .= '

        '.get_string('toc', 'mod_book').'

        '; + $toc .= html_writer::tag('p', get_string('toc', 'mod_book'), array('class' => 'book_chapter_title')); } - $toc .= '
          '; + $toc .= html_writer::start_tag('ul'); foreach ($chapters as $ch) { if (!$ch->hidden) { $title = book_get_chapter_title($ch->id, $chapters, $book, $context); if (!$ch->subchapter) { - $toc .= $first ? '
        • ' : '
      • '; + + if ($first) { + $toc .= html_writer::start_tag('li'); + } else { + $toc .= html_writer::end_tag('ul'); + $toc .= html_writer::end_tag('li'); + $toc .= html_writer::start_tag('li'); + } + } else { - $toc .= $first ? '
        • ' : '
        • '; + + if ($first) { + $toc .= html_writer::start_tag('li'); + $toc .= html_writer::start_tag('ul'); + $toc .= html_writer::start_tag('li'); + } else { + $toc .= html_writer::start_tag('li'); + } + } $titles[$ch->id] = $title; - $toc .= ''.$title.''; - $toc .= (!$ch->subchapter) ? '
            ' : ''; + $toc .= html_writer::link(new moodle_url('#ch'.$ch->id), $title, array('title' => s($title))); + if (!$ch->subchapter) { + $toc .= html_writer::start_tag('ul'); + } else { + $toc .= html_writer::end_tag('li'); + } $first = false; } } - $toc .= '
        '; - $toc .= '
      • '; + + $toc .= html_writer::end_tag('ul'); + $toc .= html_writer::end_tag('li'); + $toc .= html_writer::end_tag('ul'); + $toc .= html_writer::end_tag('div'); + $toc = str_replace('
          ', '', $toc); // Cleanup of invalid structures. return array($toc, $titles); diff --git a/mod/book/tool/print/version.php b/mod/book/tool/print/version.php index b7112b7ca98..2951ef06e35 100644 --- a/mod/book/tool/print/version.php +++ b/mod/book/tool/print/version.php @@ -1,5 +1,5 @@ set_title(format_string($book->name)); -$PAGE->add_body_class('mod_book'); -$PAGE->set_heading(format_string($course->fullname)); +$PAGE->set_title($book->name); +$PAGE->set_heading($course->fullname); book_add_fake_block($chapters, $chapter, $book, $cm, $edit); diff --git a/mod/data/lib.php b/mod/data/lib.php index c23094b11ef..3b3b2a7f5b5 100644 --- a/mod/data/lib.php +++ b/mod/data/lib.php @@ -2833,7 +2833,7 @@ function data_get_file_areas($course, $cm, $context) { * @return file_info_stored file_info_stored instance or null if not found */ function data_get_file_info($browser, $areas, $course, $cm, $context, $filearea, $itemid, $filepath, $filename) { - global $CFG, $DB; + global $CFG, $DB, $USER; if ($context->contextlevel != CONTEXT_MODULE) { return null; @@ -2843,10 +2843,6 @@ function data_get_file_info($browser, $areas, $course, $cm, $context, $filearea, return null; } - if (!has_capability('moodle/course:managefiles', $context)) { - return null; - } - if (is_null($itemid)) { require_once($CFG->dirroot.'/mod/data/locallib.php'); return new data_file_info_container($browser, $course, $cm, $context, $areas, $filearea); @@ -2895,6 +2891,13 @@ function data_get_file_info($browser, $areas, $course, $cm, $context, $filearea, if (!($storedfile = $fs->get_file($context->id, 'mod_data', $filearea, $itemid, $filepath, $filename))) { return null; } + + // Checks to see if the user can manage files or is the owner. + // TODO MDL-33805 - Do not use userid here and move the capability check above. + if (!has_capability('moodle/course:managefiles', $context) && $storedfile->get_userid() != $USER->id) { + return null; + } + $urlbase = $CFG->wwwroot.'/pluginfile.php'; return new file_info_stored($browser, $context, $storedfile, $urlbase, $itemid, true, true, false, false); diff --git a/mod/feedback/complete.php b/mod/feedback/complete.php index 7fee6412d83..e4c202c50d9 100644 --- a/mod/feedback/complete.php +++ b/mod/feedback/complete.php @@ -507,11 +507,8 @@ if ($feedback_can_submit) { //get the value $frmvaluename = $feedbackitem->typ . '_'. $feedbackitem->id; if (isset($savereturn)) { - if (isset($formdata->{$frmvaluename})) { - $value = $formdata->{$frmvaluename}; - } else { - $value = null; - } + $value = isset($formdata->{$frmvaluename}) ? $formdata->{$frmvaluename} : null; + $value = feedback_clean_input_value($feedbackitem, $value); } else { if (isset($feedbackcompletedtmp->id)) { $value = feedback_get_item_value($feedbackcompletedtmp->id, @@ -530,6 +527,7 @@ if ($feedback_can_submit) { feedback_print_item_complete($feedbackitem, $value, $highlightrequired); echo $OUTPUT->box_end(); } + echo $OUTPUT->box_end(); $lastbreakposition = $feedbackitem->position; //last item-pos (item or pagebreak) diff --git a/mod/feedback/complete_guest.php b/mod/feedback/complete_guest.php index 25747a99082..b472c09e023 100644 --- a/mod/feedback/complete_guest.php +++ b/mod/feedback/complete_guest.php @@ -72,7 +72,7 @@ if (isset($formdata->sesskey) AND !isset($formdata->gonextpage) AND !isset($formdata->gopreviouspage)) { - $gopage = $formdata->lastpage; + $gopage = (int) $formdata->lastpage; } if (isset($formdata->savevalues)) { $savevalues = true; @@ -441,13 +441,10 @@ if ($feedback_can_submit) { echo $OUTPUT->box_start('feedback_item_box_'.$align.$dependstyle); $value = ''; //get the value - $frmvaluename = $feedbackitem->typ.'_'.$feedbackitem->id; + $frmvaluename = $feedbackitem->typ . '_'. $feedbackitem->id; if (isset($savereturn)) { - if (isset($formdata->{$frmvaluename})) { - $value = $formdata->{$frmvaluename}; - } else { - $value = null; - } + $value = isset($formdata->{$frmvaluename}) ? $formdata->{$frmvaluename} : null; + $value = feedback_clean_input_value($feedbackitem, $value); } else { if (isset($feedbackcompletedtmp->id)) { $value = feedback_get_item_value($feedbackcompletedtmp->id, @@ -466,6 +463,7 @@ if ($feedback_can_submit) { feedback_print_item_complete($feedbackitem, $value, $highlightrequired); echo $OUTPUT->box_end(); } + echo $OUTPUT->box_end(); $lastbreakposition = $feedbackitem->position; //last item-pos (item or pagebreak) diff --git a/mod/feedback/item/captcha/lib.php b/mod/feedback/item/captcha/lib.php index 126d51e3417..f790a658daa 100644 --- a/mod/feedback/item/captcha/lib.php +++ b/mod/feedback/item/captcha/lib.php @@ -326,4 +326,12 @@ class feedback_item_captcha extends feedback_item_base { public function can_switch_require() { return false; } + + public function value_type() { + return PARAM_RAW; + } + + public function clean_input_value($value) { + return clean_param($value, $this->value_type()); + } } diff --git a/mod/feedback/item/feedback_item_class.php b/mod/feedback/item/feedback_item_class.php index 981aefd58ea..b001b4ec336 100644 --- a/mod/feedback/item/feedback_item_class.php +++ b/mod/feedback/item/feedback_item_class.php @@ -98,7 +98,7 @@ abstract class feedback_item_base { */ abstract public function get_analysed($item, $groupid = false, $courseid = false); - /** + /** * print the item at the edit-page of feedback * * @global object @@ -107,7 +107,7 @@ abstract class feedback_item_base { */ abstract public function print_item_preview($item); - /** + /** * print the item at the complete-page of feedback * * @global object @@ -118,7 +118,7 @@ abstract class feedback_item_base { */ abstract public function print_item_complete($item, $value = '', $highlightrequire = false); - /** + /** * print the item at the complete-page of feedback * * @global object @@ -128,6 +128,14 @@ abstract class feedback_item_base { */ abstract public function print_item_show_value($item, $value = ''); + /** + * cleans the userinput while submitting the form + * + * @param mixed $value + * @return mixed + */ + abstract public function clean_input_value($value); + } //a dummy class to realize pagebreaks @@ -175,7 +183,9 @@ class feedback_item_pagebreak extends feedback_item_base { } public function can_switch_require() { } + public function value_type() { + } + public function clean_input_value($value) { + } } - - diff --git a/mod/feedback/item/info/lib.php b/mod/feedback/item/info/lib.php index 299fef24b04..fbdf2d994c2 100644 --- a/mod/feedback/item/info/lib.php +++ b/mod/feedback/item/info/lib.php @@ -388,4 +388,12 @@ class feedback_item_info extends feedback_item_base { public function can_switch_require() { return false; } + + public function value_type() { + return PARAM_INT; + } + + public function clean_input_value($value) { + return clean_param($value, $this->value_type()); + } } diff --git a/mod/feedback/item/label/lib.php b/mod/feedback/item/label/lib.php index 25c62a9f55d..06db9908851 100644 --- a/mod/feedback/item/label/lib.php +++ b/mod/feedback/item/label/lib.php @@ -270,4 +270,10 @@ class feedback_item_label extends feedback_item_base { } public function get_analysed($item, $groupid = false, $courseid = false) { } + public function value_type() { + return PARAM_BOOL; + } + public function clean_input_value($value) { + return ''; + } } diff --git a/mod/feedback/item/multichoice/lib.php b/mod/feedback/item/multichoice/lib.php index cfba141be16..3e5501fa90d 100644 --- a/mod/feedback/item/multichoice/lib.php +++ b/mod/feedback/item/multichoice/lib.php @@ -826,4 +826,8 @@ class feedback_item_multichoice extends feedback_item_base { public function value_is_array() { return true; } + + public function clean_input_value($value) { + return clean_param_array($value, $this->value_type()); + } } diff --git a/mod/feedback/item/multichoicerated/lib.php b/mod/feedback/item/multichoicerated/lib.php index 031f7b89540..ca43a442eca 100644 --- a/mod/feedback/item/multichoicerated/lib.php +++ b/mod/feedback/item/multichoicerated/lib.php @@ -678,4 +678,11 @@ class feedback_item_multichoicerated extends feedback_item_base { return true; } + public function value_type() { + return PARAM_INT; + } + + public function clean_input_value($value) { + return clean_param($value, $this->value_type()); + } } diff --git a/mod/feedback/item/numeric/lib.php b/mod/feedback/item/numeric/lib.php index 23694137d8f..829dd1b21f7 100644 --- a/mod/feedback/item/numeric/lib.php +++ b/mod/feedback/item/numeric/lib.php @@ -220,7 +220,7 @@ class feedback_item_numeric extends feedback_item_base { return $row_offset; } - /** + /** * print the item at the edit-page of feedback * * @global object @@ -296,7 +296,7 @@ class feedback_item_numeric extends feedback_item_base { echo '
          '; } - /** + /** * print the item at the complete-page of feedback * * @global object @@ -364,13 +364,13 @@ class feedback_item_numeric extends feedback_item_base { 'name="'.$item->typ.'_'.$item->id.'" '. 'size="10" '. 'maxlength="10" '. - 'value="'.($value ? $value : '').'" />'; + 'value="'.$value.'" />'; echo ''; echo '
          '; } - /** + /** * print the item at the complete-page of feedback * * @global object @@ -534,4 +534,15 @@ class feedback_item_numeric extends feedback_item_base { public function can_switch_require() { return true; } + + public function value_type() { + return PARAM_FLOAT; + } + + public function clean_input_value($value) { + if (!is_numeric($value)) { + return null; + } + return clean_param($value, $this->value_type()); + } } diff --git a/mod/feedback/item/textarea/lib.php b/mod/feedback/item/textarea/lib.php index 54df5e6e47e..74605bc87c8 100644 --- a/mod/feedback/item/textarea/lib.php +++ b/mod/feedback/item/textarea/lib.php @@ -262,7 +262,7 @@ class feedback_item_textarea extends feedback_item_base { echo ''; echo ''; echo '
          '; @@ -308,7 +308,7 @@ class feedback_item_textarea extends feedback_item_base { } public function create_value($data) { - $data = clean_text($data); + $data = s($data); return $data; } @@ -333,4 +333,12 @@ class feedback_item_textarea extends feedback_item_base { public function can_switch_require() { return true; } + + public function value_type() { + return PARAM_RAW; + } + + public function clean_input_value($value) { + return s($value); + } } diff --git a/mod/feedback/item/textfield/lib.php b/mod/feedback/item/textfield/lib.php index 4051ffb97c0..0d151ae12a5 100644 --- a/mod/feedback/item/textfield/lib.php +++ b/mod/feedback/item/textfield/lib.php @@ -252,7 +252,7 @@ class feedback_item_textfield extends feedback_item_base { 'name="'.$item->typ.'_'.$item->id.'" '. 'size="'.$presentation[0].'" '. 'maxlength="'.$presentation[1].'" '. - 'value="'.($value ? htmlspecialchars($value) : '').'" />'; + 'value="'.$value.'" />'; echo ''; echo '
          '; } @@ -295,7 +295,7 @@ class feedback_item_textfield extends feedback_item_base { } public function create_value($data) { - $data = clean_text($data); + $data = s($data); return $data; } @@ -320,4 +320,12 @@ class feedback_item_textfield extends feedback_item_base { public function can_switch_require() { return true; } + + public function value_type() { + return PARAM_RAW; + } + + public function clean_input_value($value) { + return s($value); + } } diff --git a/mod/feedback/lib.php b/mod/feedback/lib.php index 3c9809b9f08..8705bbc8d8c 100644 --- a/mod/feedback/lib.php +++ b/mod/feedback/lib.php @@ -2058,6 +2058,17 @@ function feedback_get_page_to_continue($feedbackid, $courseid = false, $guestid //functions to handle the values //////////////////////////////////////////////// +/** + * cleans the userinput while submitting the form. + * + * @param mixed $value + * @return mixed + */ +function feedback_clean_input_value($item, $value) { + $itemobj = feedback_get_item_class($item->typ); + return $itemobj->clean_input_value($value); +} + /** * this saves the values of an completed. * if the param $tmp is set true so the values are saved temporary in table feedback_valuetmp. diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 0bb2bfc6302..1f704993a51 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -4068,7 +4068,7 @@ function forum_get_file_areas($course, $cm, $context) { * @return file_info instance or null if not found */ function forum_get_file_info($browser, $areas, $course, $cm, $context, $filearea, $itemid, $filepath, $filename) { - global $CFG, $DB; + global $CFG, $DB, $USER; if ($context->contextlevel != CONTEXT_MODULE) { return null; @@ -4079,11 +4079,6 @@ function forum_get_file_info($browser, $areas, $course, $cm, $context, $filearea return null; } - // this is enforced by {@link file_info_context_course} currently - if (!has_capability('moodle/course:managefiles', $context)) { - return null; - } - // Note that forum_user_can_see_post() additionally allows access for parent roles // and it explicitly checks qanda forum type, too. One day, when we stop requiring // course:managefiles, we will need to extend this. @@ -4115,6 +4110,11 @@ function forum_get_file_info($browser, $areas, $course, $cm, $context, $filearea return null; } + // Checks to see if the user can manage files or is the owner. + // TODO MDL-33805 - Do not use userid here and move the capability check above. + if (!has_capability('moodle/course:managefiles', $context) && $storedfile->get_userid() != $USER->id) { + return null; + } // Make sure groups allow this user to see this file if ($discussion->groupid > 0) { $groupmode = groups_get_activity_groupmode($cm, $course); diff --git a/mod/forum/post.php b/mod/forum/post.php index 7e864e51845..15a386d689d 100644 --- a/mod/forum/post.php +++ b/mod/forum/post.php @@ -520,7 +520,7 @@ if ($USER->id != $post->userid) { // Not the original author, so add a message if ($post->messageformat == FORMAT_HTML) { $data->name = ''. fullname($USER).''; - $post->message .= '

          ('.get_string('editedby', 'forum', $data).')

          '; + $post->message .= '

          ('.get_string('editedby', 'forum', $data).')

          '; } else { $data->name = fullname($USER); $post->message .= "\n\n(".get_string('editedby', 'forum', $data).')'; diff --git a/mod/glossary/import.php b/mod/glossary/import.php index cc411dd9215..66466dd192b 100644 --- a/mod/glossary/import.php +++ b/mod/glossary/import.php @@ -87,7 +87,7 @@ if ($xml = glossary_read_imported_file($result)) { $xmlglossary = $xml['GLOSSARY']['#']['INFO'][0]['#']; if ( $xmlglossary['NAME'][0]['#'] ) { - unset($glossary); + $glossary = new stdClass(); $glossary->name = ($xmlglossary['NAME'][0]['#']); $glossary->course = $course->id; $glossary->globalglossary = ($xmlglossary['GLOBALGLOSSARY'][0]['#']); @@ -191,7 +191,7 @@ if ($xml = glossary_read_imported_file($result)) { for($i = 0; $i < $sizeofxmlentries; $i++) { // Inserting the entries $xmlentry = $xmlentries[$i]; - unset($newentry); + $newentry = new stdClass(); $newentry->concept = trim($xmlentry['#']['CONCEPT'][0]['#']); $newentry->definition = trusttext_strip($xmlentry['#']['DEFINITION'][0]['#']); if ( isset($xmlentry['#']['CASESENSITIVE'][0]['#']) ) { diff --git a/mod/glossary/lib.php b/mod/glossary/lib.php index 0a05ec70ade..85c96735a83 100644 --- a/mod/glossary/lib.php +++ b/mod/glossary/lib.php @@ -405,9 +405,11 @@ function glossary_get_recent_mod_activity(&$activities, &$index, $timestart, $co $tmpactivity->name = format_string($cm->name, true); $tmpactivity->sectionnum = $cm->sectionnum; $tmpactivity->timestamp = $entry->timemodified; + $tmpactivity->content = new stdClass(); $tmpactivity->content->entryid = $entry->entryid; $tmpactivity->content->concept = $entry->concept; $tmpactivity->content->definition = $entry->definition; + $tmpactivity->user = new stdClass(); $tmpactivity->user->id = $entry->userid; $tmpactivity->user->firstname = $entry->firstname; $tmpactivity->user->lastname = $entry->lastname; @@ -560,7 +562,7 @@ function glossary_print_recent_activity($course, $viewfullnames, $timestart) { echo ''; $entrycount += 1; } else { - $numnewentries = $DB->count_records_sql($countsql.$joins[0].$clausesql.$approvalsql.')', $params); + $numnewentries = $DB->count_records_sql($countsql.$joins[0].$clausesql.$approvalsql, $params); echo '
          '.get_string('andmorenewentries', 'glossary', $numnewentries - GLOSSARY_RECENT_ACTIVITY_LIMIT).'
          '; break; } @@ -1621,7 +1623,7 @@ function glossary_get_file_areas($course, $cm, $context) { * @return file_info_stored file_info_stored instance or null if not found */ function glossary_get_file_info($browser, $areas, $course, $cm, $context, $filearea, $itemid, $filepath, $filename) { - global $CFG, $DB; + global $CFG, $DB, $USER; if ($context->contextlevel != CONTEXT_MODULE) { return null; @@ -1631,10 +1633,6 @@ function glossary_get_file_info($browser, $areas, $course, $cm, $context, $filea return null; } - if (!has_capability('moodle/course:managefiles', $context)) { - return null; - } - if (is_null($itemid)) { require_once($CFG->dirroot.'/mod/glossary/locallib.php'); return new glossary_file_info_container($browser, $course, $cm, $context, $areas, $filearea); @@ -1670,6 +1668,13 @@ function glossary_get_file_info($browser, $areas, $course, $cm, $context, $filea if (!($storedfile = $fs->get_file($filecontext->id, 'mod_glossary', $filearea, $itemid, $filepath, $filename))) { return null; } + + // Checks to see if the user can manage files or is the owner. + // TODO MDL-33805 - Do not use userid here and move the capability check above. + if (!has_capability('moodle/course:managefiles', $context) && $storedfile->get_userid() != $USER->id) { + return null; + } + $urlbase = $CFG->wwwroot.'/pluginfile.php'; return new file_info_stored($browser, $filecontext, $storedfile, $urlbase, s($entry->concept), true, true, false, false); diff --git a/mod/quiz/backup/moodle2/restore_quiz_stepslib.php b/mod/quiz/backup/moodle2/restore_quiz_stepslib.php index 036b4e2d57e..58a38d17b06 100644 --- a/mod/quiz/backup/moodle2/restore_quiz_stepslib.php +++ b/mod/quiz/backup/moodle2/restore_quiz_stepslib.php @@ -307,6 +307,15 @@ class restore_quiz_activity_structure_step extends restore_questions_activity_st $data->timefinish = $this->apply_date_offset($data->timefinish); $data->timemodified = $this->apply_date_offset($data->timemodified); + // Deals with up-grading pre-2.3 back-ups to 2.3+. + if (!isset($data->state)) { + if ($data->timefinish > 0) { + $data->state = 'finished'; + } else { + $data->state = 'inprogress'; + } + } + // The data is actually inserted into the database later in inform_new_usage_id. $this->currentquizattempt = clone($data); } diff --git a/mod/quiz/report/statistics/db/install.xml b/mod/quiz/report/statistics/db/install.xml index 7184605d7f3..9a2186ea48a 100644 --- a/mod/quiz/report/statistics/db/install.xml +++ b/mod/quiz/report/statistics/db/install.xml @@ -55,8 +55,8 @@ - - + + diff --git a/mod/quiz/report/statistics/db/upgrade.php b/mod/quiz/report/statistics/db/upgrade.php index 00f93502db1..f3a78718cd2 100644 --- a/mod/quiz/report/statistics/db/upgrade.php +++ b/mod/quiz/report/statistics/db/upgrade.php @@ -37,6 +37,32 @@ function xmldb_quiz_statistics_upgrade($oldversion) { // Moodle v2.2.0 release upgrade line. // Put any upgrade step following this. + if ($oldversion < 2012061800) { + + // Changing type of field subqid on table quiz_question_response_stats to char. + $table = new xmldb_table('quiz_question_response_stats'); + $field = new xmldb_field('subqid', XMLDB_TYPE_CHAR, '100', null, XMLDB_NOTNULL, null, null, 'questionid'); + + // Launch change of type for field subqid. + $dbman->change_field_type($table, $field); + + // Statistics savepoint reached. + upgrade_plugin_savepoint(true, 2012061800, 'quiz', 'statistics'); + } + + if ($oldversion < 2012061801) { + + // Changing type of field aid on table quiz_question_response_stats to char. + $table = new xmldb_table('quiz_question_response_stats'); + $field = new xmldb_field('aid', XMLDB_TYPE_CHAR, '100', null, null, null, null, 'subqid'); + + // Launch change of type for field aid. + $dbman->change_field_type($table, $field); + + // Statistics savepoint reached. + upgrade_plugin_savepoint(true, 2012061801, 'quiz', 'statistics'); + } + return true; } diff --git a/mod/quiz/report/statistics/version.php b/mod/quiz/report/statistics/version.php index 1db495a6fcf..b9d77cce797 100644 --- a/mod/quiz/report/statistics/version.php +++ b/mod/quiz/report/statistics/version.php @@ -24,7 +24,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; +$plugin->version = 2012061801; $plugin->requires = 2012061700; $plugin->cron = 18000; $plugin->component = 'quiz_statistics'; diff --git a/mod/workshop/lib.php b/mod/workshop/lib.php index 97e91f5d21a..1508b5ba551 100644 --- a/mod/workshop/lib.php +++ b/mod/workshop/lib.php @@ -1310,11 +1310,6 @@ function workshop_get_file_info($browser, $areas, $course, $cm, $context, $filea /** @var array internal cache for author names */ static $submissionauthors = array(); - // this is enforced by {@link file_info_context_course} currently - if (!has_capability('moodle/course:managefiles', $context)) { - return null; - } - $fs = get_file_storage(); if ($filearea === 'submission_content' or $filearea === 'submission_attachment') { @@ -1363,6 +1358,12 @@ function workshop_get_file_info($browser, $areas, $course, $cm, $context, $filea } } + // Checks to see if the user can manage files or is the owner. + // TODO MDL-33805 - Do not use userid here and move the capability check above. + if (!has_capability('moodle/course:managefiles', $context) && $storedfile->get_userid() != $USER->id) { + return null; + } + // let us display the author's name instead of itemid (submission id) if (isset($submissionauthors[$itemid])) { diff --git a/pix/f/archive-128.png b/pix/f/archive-128.png new file mode 100644 index 00000000000..63376209a7b Binary files /dev/null and b/pix/f/archive-128.png differ diff --git a/pix/f/archive-24.png b/pix/f/archive-24.png new file mode 100644 index 00000000000..e69e08f6d6d Binary files /dev/null and b/pix/f/archive-24.png differ diff --git a/pix/f/archive-256.png b/pix/f/archive-256.png new file mode 100644 index 00000000000..bb3d9f6bcde Binary files /dev/null and b/pix/f/archive-256.png differ diff --git a/pix/f/archive-32.png b/pix/f/archive-32.png new file mode 100644 index 00000000000..d8c36207ff2 Binary files /dev/null and b/pix/f/archive-32.png differ diff --git a/pix/f/archive-48.png b/pix/f/archive-48.png new file mode 100644 index 00000000000..98f02b99ab3 Binary files /dev/null and b/pix/f/archive-48.png differ diff --git a/pix/f/archive-64.png b/pix/f/archive-64.png new file mode 100644 index 00000000000..5c0d5ba8545 Binary files /dev/null and b/pix/f/archive-64.png differ diff --git a/pix/f/archive-72.png b/pix/f/archive-72.png new file mode 100644 index 00000000000..20e0ffd3a3b Binary files /dev/null and b/pix/f/archive-72.png differ diff --git a/pix/f/archive-80.png b/pix/f/archive-80.png new file mode 100644 index 00000000000..1b21dd693a6 Binary files /dev/null and b/pix/f/archive-80.png differ diff --git a/pix/f/archive-96.png b/pix/f/archive-96.png new file mode 100644 index 00000000000..7e2bb0a17a0 Binary files /dev/null and b/pix/f/archive-96.png differ diff --git a/pix/f/avi-128.png b/pix/f/avi-128.png index d8fada44214..fc6b5ba7916 100644 Binary files a/pix/f/avi-128.png and b/pix/f/avi-128.png differ diff --git a/pix/f/avi-24.png b/pix/f/avi-24.png index 91539219323..4858701042e 100644 Binary files a/pix/f/avi-24.png and b/pix/f/avi-24.png differ diff --git a/pix/f/avi-256.png b/pix/f/avi-256.png index f0b88834784..1895867fcaa 100644 Binary files a/pix/f/avi-256.png and b/pix/f/avi-256.png differ diff --git a/pix/f/avi-32.png b/pix/f/avi-32.png index 21052731392..b6165472a5e 100644 Binary files a/pix/f/avi-32.png and b/pix/f/avi-32.png differ diff --git a/pix/f/avi-48.png b/pix/f/avi-48.png index f186f7f9aab..5cfda5ec31f 100644 Binary files a/pix/f/avi-48.png and b/pix/f/avi-48.png differ diff --git a/pix/f/avi-64.png b/pix/f/avi-64.png index 77d0a2173d1..741e017e4db 100644 Binary files a/pix/f/avi-64.png and b/pix/f/avi-64.png differ diff --git a/pix/f/avi-72.png b/pix/f/avi-72.png index 6ab2fd61fbc..c21909ba1c3 100644 Binary files a/pix/f/avi-72.png and b/pix/f/avi-72.png differ diff --git a/pix/f/avi-80.png b/pix/f/avi-80.png index 56828013aef..71c8d44a7d9 100644 Binary files a/pix/f/avi-80.png and b/pix/f/avi-80.png differ diff --git a/pix/f/avi-96.png b/pix/f/avi-96.png index aa6ffa0cc33..b089c214690 100644 Binary files a/pix/f/avi-96.png and b/pix/f/avi-96.png differ diff --git a/pix/f/base-128.png b/pix/f/base-128.png new file mode 100644 index 00000000000..b7aac1f0a30 Binary files /dev/null and b/pix/f/base-128.png differ diff --git a/pix/f/base-24.png b/pix/f/base-24.png new file mode 100644 index 00000000000..aa7affad057 Binary files /dev/null and b/pix/f/base-24.png differ diff --git a/pix/f/base-32.png b/pix/f/base-32.png new file mode 100644 index 00000000000..76f2bc029ca Binary files /dev/null and b/pix/f/base-32.png differ diff --git a/pix/f/base-48.png b/pix/f/base-48.png new file mode 100644 index 00000000000..8a45fa72c91 Binary files /dev/null and b/pix/f/base-48.png differ diff --git a/pix/f/base-64.png b/pix/f/base-64.png new file mode 100644 index 00000000000..1bf7277867e Binary files /dev/null and b/pix/f/base-64.png differ diff --git a/pix/f/base-72.png b/pix/f/base-72.png new file mode 100644 index 00000000000..7d1f1857370 Binary files /dev/null and b/pix/f/base-72.png differ diff --git a/pix/f/base-80.png b/pix/f/base-80.png new file mode 100644 index 00000000000..c6d6756e6eb Binary files /dev/null and b/pix/f/base-80.png differ diff --git a/pix/f/base-96.png b/pix/f/base-96.png new file mode 100644 index 00000000000..6af0a8dd730 Binary files /dev/null and b/pix/f/base-96.png differ diff --git a/pix/f/bmp-128.png b/pix/f/bmp-128.png index c47b14b2b6d..f70d02f34aa 100644 Binary files a/pix/f/bmp-128.png and b/pix/f/bmp-128.png differ diff --git a/pix/f/bmp-24.png b/pix/f/bmp-24.png index a37ad66fe9d..779415d7ee9 100644 Binary files a/pix/f/bmp-24.png and b/pix/f/bmp-24.png differ diff --git a/pix/f/bmp-256.png b/pix/f/bmp-256.png index 44e20c98ce7..ad1c5e7673f 100644 Binary files a/pix/f/bmp-256.png and b/pix/f/bmp-256.png differ diff --git a/pix/f/bmp-32.png b/pix/f/bmp-32.png index 2da1505dabc..bfdf341d2c1 100644 Binary files a/pix/f/bmp-32.png and b/pix/f/bmp-32.png differ diff --git a/pix/f/bmp-48.png b/pix/f/bmp-48.png index 915f352a943..4e46413a1af 100644 Binary files a/pix/f/bmp-48.png and b/pix/f/bmp-48.png differ diff --git a/pix/f/bmp-64.png b/pix/f/bmp-64.png index b5ac5ceb358..cbed5fb9658 100644 Binary files a/pix/f/bmp-64.png and b/pix/f/bmp-64.png differ diff --git a/pix/f/bmp-72.png b/pix/f/bmp-72.png index 0080d547491..14b962371ed 100644 Binary files a/pix/f/bmp-72.png and b/pix/f/bmp-72.png differ diff --git a/pix/f/bmp-80.png b/pix/f/bmp-80.png index 2f5cbd4ed64..5e23b6c887f 100644 Binary files a/pix/f/bmp-80.png and b/pix/f/bmp-80.png differ diff --git a/pix/f/bmp-96.png b/pix/f/bmp-96.png index fa288e8402f..270814ba657 100644 Binary files a/pix/f/bmp-96.png and b/pix/f/bmp-96.png differ diff --git a/pix/f/calc-128.png b/pix/f/calc-128.png new file mode 100644 index 00000000000..553ee366673 Binary files /dev/null and b/pix/f/calc-128.png differ diff --git a/pix/f/calc-24.png b/pix/f/calc-24.png new file mode 100644 index 00000000000..ff643f8d559 Binary files /dev/null and b/pix/f/calc-24.png differ diff --git a/pix/f/calc-32.png b/pix/f/calc-32.png new file mode 100644 index 00000000000..69a0cabf1ed Binary files /dev/null and b/pix/f/calc-32.png differ diff --git a/pix/f/calc-48.png b/pix/f/calc-48.png new file mode 100644 index 00000000000..bdacc443c2f Binary files /dev/null and b/pix/f/calc-48.png differ diff --git a/pix/f/calc-64.png b/pix/f/calc-64.png new file mode 100644 index 00000000000..472700fc5d3 Binary files /dev/null and b/pix/f/calc-64.png differ diff --git a/pix/f/calc-72.png b/pix/f/calc-72.png new file mode 100644 index 00000000000..5dc124ab627 Binary files /dev/null and b/pix/f/calc-72.png differ diff --git a/pix/f/calc-80.png b/pix/f/calc-80.png new file mode 100644 index 00000000000..0c49fd35c64 Binary files /dev/null and b/pix/f/calc-80.png differ diff --git a/pix/f/calc-96.png b/pix/f/calc-96.png new file mode 100644 index 00000000000..e3fe54b85f1 Binary files /dev/null and b/pix/f/calc-96.png differ diff --git a/pix/f/chart-128.png b/pix/f/chart-128.png new file mode 100644 index 00000000000..da56c42edf6 Binary files /dev/null and b/pix/f/chart-128.png differ diff --git a/pix/f/chart-24.png b/pix/f/chart-24.png new file mode 100644 index 00000000000..1ee14a6213b Binary files /dev/null and b/pix/f/chart-24.png differ diff --git a/pix/f/chart-32.png b/pix/f/chart-32.png new file mode 100644 index 00000000000..86f0e7d5240 Binary files /dev/null and b/pix/f/chart-32.png differ diff --git a/pix/f/chart-48.png b/pix/f/chart-48.png new file mode 100644 index 00000000000..cc947c9fd0f Binary files /dev/null and b/pix/f/chart-48.png differ diff --git a/pix/f/chart-64.png b/pix/f/chart-64.png new file mode 100644 index 00000000000..ac985203246 Binary files /dev/null and b/pix/f/chart-64.png differ diff --git a/pix/f/chart-72.png b/pix/f/chart-72.png new file mode 100644 index 00000000000..e2c5f13de91 Binary files /dev/null and b/pix/f/chart-72.png differ diff --git a/pix/f/chart-80.png b/pix/f/chart-80.png new file mode 100644 index 00000000000..a5f44eac577 Binary files /dev/null and b/pix/f/chart-80.png differ diff --git a/pix/f/chart-96.png b/pix/f/chart-96.png new file mode 100644 index 00000000000..69fd198cd92 Binary files /dev/null and b/pix/f/chart-96.png differ diff --git a/pix/f/docx-128.png b/pix/f/docx-128.png deleted file mode 100644 index 0a1d175b97e..00000000000 Binary files a/pix/f/docx-128.png and /dev/null differ diff --git a/pix/f/docx-24.png b/pix/f/docx-24.png deleted file mode 100644 index 1176585dd24..00000000000 Binary files a/pix/f/docx-24.png and /dev/null differ diff --git a/pix/f/docx-256.png b/pix/f/docx-256.png deleted file mode 100644 index fddc6674c08..00000000000 Binary files a/pix/f/docx-256.png and /dev/null differ diff --git a/pix/f/docx-32.png b/pix/f/docx-32.png deleted file mode 100644 index f932a123e07..00000000000 Binary files a/pix/f/docx-32.png and /dev/null differ diff --git a/pix/f/docx-48.png b/pix/f/docx-48.png deleted file mode 100644 index de255eb9d82..00000000000 Binary files a/pix/f/docx-48.png and /dev/null differ diff --git a/pix/f/docx-64.png b/pix/f/docx-64.png deleted file mode 100644 index 399a1a20189..00000000000 Binary files a/pix/f/docx-64.png and /dev/null differ diff --git a/pix/f/docx-72.png b/pix/f/docx-72.png deleted file mode 100644 index fec1af15ee2..00000000000 Binary files a/pix/f/docx-72.png and /dev/null differ diff --git a/pix/f/docx-80.png b/pix/f/docx-80.png deleted file mode 100644 index a161a6032fc..00000000000 Binary files a/pix/f/docx-80.png and /dev/null differ diff --git a/pix/f/docx-96.png b/pix/f/docx-96.png deleted file mode 100644 index 6dc0ad7e85f..00000000000 Binary files a/pix/f/docx-96.png and /dev/null differ diff --git a/pix/f/docx.png b/pix/f/docx.png deleted file mode 100644 index c52e6eddc40..00000000000 Binary files a/pix/f/docx.png and /dev/null differ diff --git a/pix/f/draw-128.png b/pix/f/draw-128.png new file mode 100644 index 00000000000..8db70ff9fea Binary files /dev/null and b/pix/f/draw-128.png differ diff --git a/pix/f/draw-24.png b/pix/f/draw-24.png new file mode 100644 index 00000000000..856d80600b3 Binary files /dev/null and b/pix/f/draw-24.png differ diff --git a/pix/f/draw-32.png b/pix/f/draw-32.png new file mode 100644 index 00000000000..64bb882afe6 Binary files /dev/null and b/pix/f/draw-32.png differ diff --git a/pix/f/draw-48.png b/pix/f/draw-48.png new file mode 100644 index 00000000000..f3023279c80 Binary files /dev/null and b/pix/f/draw-48.png differ diff --git a/pix/f/draw-64.png b/pix/f/draw-64.png new file mode 100644 index 00000000000..41286d57466 Binary files /dev/null and b/pix/f/draw-64.png differ diff --git a/pix/f/draw-72.png b/pix/f/draw-72.png new file mode 100644 index 00000000000..881bc998a1a Binary files /dev/null and b/pix/f/draw-72.png differ diff --git a/pix/f/draw-80.png b/pix/f/draw-80.png new file mode 100644 index 00000000000..ccc46b66cea Binary files /dev/null and b/pix/f/draw-80.png differ diff --git a/pix/f/draw-96.png b/pix/f/draw-96.png new file mode 100644 index 00000000000..aac97ceb97d Binary files /dev/null and b/pix/f/draw-96.png differ diff --git a/pix/f/eps-128.png b/pix/f/eps-128.png index aec037247eb..1e17f69e65d 100644 Binary files a/pix/f/eps-128.png and b/pix/f/eps-128.png differ diff --git a/pix/f/eps-24.png b/pix/f/eps-24.png index 78c34774a03..95f01672cd4 100644 Binary files a/pix/f/eps-24.png and b/pix/f/eps-24.png differ diff --git a/pix/f/eps-256.png b/pix/f/eps-256.png index c8a77a83c1d..bb51d321b67 100644 Binary files a/pix/f/eps-256.png and b/pix/f/eps-256.png differ diff --git a/pix/f/eps-32.png b/pix/f/eps-32.png index 89b64c2aa9d..ade3b63025f 100644 Binary files a/pix/f/eps-32.png and b/pix/f/eps-32.png differ diff --git a/pix/f/eps-48.png b/pix/f/eps-48.png index 7b907450135..052945ed25d 100644 Binary files a/pix/f/eps-48.png and b/pix/f/eps-48.png differ diff --git a/pix/f/eps-64.png b/pix/f/eps-64.png index 4a5f0cf63ae..c9dc3c36f7a 100644 Binary files a/pix/f/eps-64.png and b/pix/f/eps-64.png differ diff --git a/pix/f/eps-72.png b/pix/f/eps-72.png index c2c06b80922..48603d8d75e 100644 Binary files a/pix/f/eps-72.png and b/pix/f/eps-72.png differ diff --git a/pix/f/eps-80.png b/pix/f/eps-80.png index 6c306a9a6f0..7d76c6c25ad 100644 Binary files a/pix/f/eps-80.png and b/pix/f/eps-80.png differ diff --git a/pix/f/eps-96.png b/pix/f/eps-96.png index 54c7522fc2c..ce1c193978c 100644 Binary files a/pix/f/eps-96.png and b/pix/f/eps-96.png differ diff --git a/pix/f/flash-128.png b/pix/f/flash-128.png index b42f1cbe37c..977f68c2702 100644 Binary files a/pix/f/flash-128.png and b/pix/f/flash-128.png differ diff --git a/pix/f/flash-24.png b/pix/f/flash-24.png index 13a77eaa0e3..1ff67d4c24a 100644 Binary files a/pix/f/flash-24.png and b/pix/f/flash-24.png differ diff --git a/pix/f/flash-256.png b/pix/f/flash-256.png index b0eacd2f6e8..8c2ff7877c5 100644 Binary files a/pix/f/flash-256.png and b/pix/f/flash-256.png differ diff --git a/pix/f/flash-32.png b/pix/f/flash-32.png index d57ac1d7b8d..9f74f95f647 100644 Binary files a/pix/f/flash-32.png and b/pix/f/flash-32.png differ diff --git a/pix/f/flash-48.png b/pix/f/flash-48.png index 43114626cac..d6da6366c7d 100644 Binary files a/pix/f/flash-48.png and b/pix/f/flash-48.png differ diff --git a/pix/f/flash-64.png b/pix/f/flash-64.png index 515074be2cc..315a4e3239a 100644 Binary files a/pix/f/flash-64.png and b/pix/f/flash-64.png differ diff --git a/pix/f/flash-72.png b/pix/f/flash-72.png index c7444d2fe45..b5faa0332fe 100644 Binary files a/pix/f/flash-72.png and b/pix/f/flash-72.png differ diff --git a/pix/f/flash-80.png b/pix/f/flash-80.png index a52b704bbf8..0f1b12d0f21 100644 Binary files a/pix/f/flash-80.png and b/pix/f/flash-80.png differ diff --git a/pix/f/flash-96.png b/pix/f/flash-96.png index 72e851f6615..61b61eacf21 100644 Binary files a/pix/f/flash-96.png and b/pix/f/flash-96.png differ diff --git a/pix/f/gif-128.png b/pix/f/gif-128.png index 0c1851b6892..c4c003b8d29 100644 Binary files a/pix/f/gif-128.png and b/pix/f/gif-128.png differ diff --git a/pix/f/gif-24.png b/pix/f/gif-24.png index 82017913afd..a7ed92f5b41 100644 Binary files a/pix/f/gif-24.png and b/pix/f/gif-24.png differ diff --git a/pix/f/gif-256.png b/pix/f/gif-256.png index 74c58949532..64fbc702beb 100644 Binary files a/pix/f/gif-256.png and b/pix/f/gif-256.png differ diff --git a/pix/f/gif-32.png b/pix/f/gif-32.png index 1fd742b727d..a9d4b3a0920 100644 Binary files a/pix/f/gif-32.png and b/pix/f/gif-32.png differ diff --git a/pix/f/gif-48.png b/pix/f/gif-48.png index e776417e0e5..56ce6bbc1a8 100644 Binary files a/pix/f/gif-48.png and b/pix/f/gif-48.png differ diff --git a/pix/f/gif-64.png b/pix/f/gif-64.png index 69f52a6643f..fbd398fb56d 100644 Binary files a/pix/f/gif-64.png and b/pix/f/gif-64.png differ diff --git a/pix/f/gif-72.png b/pix/f/gif-72.png index df0d956f723..92908b3f366 100644 Binary files a/pix/f/gif-72.png and b/pix/f/gif-72.png differ diff --git a/pix/f/gif-80.png b/pix/f/gif-80.png index e672d0322b9..4a5f1611a86 100644 Binary files a/pix/f/gif-80.png and b/pix/f/gif-80.png differ diff --git a/pix/f/gif-96.png b/pix/f/gif-96.png index aaae3b2f2e9..1c01d77a399 100644 Binary files a/pix/f/gif-96.png and b/pix/f/gif-96.png differ diff --git a/pix/f/html-128.png b/pix/f/html-128.png index f3768820369..e44549d9e2f 100644 Binary files a/pix/f/html-128.png and b/pix/f/html-128.png differ diff --git a/pix/f/html-24.png b/pix/f/html-24.png index a2e00243e62..cbb1015dd8b 100644 Binary files a/pix/f/html-24.png and b/pix/f/html-24.png differ diff --git a/pix/f/html-256.png b/pix/f/html-256.png index 40b4d619fcf..cc2790412f9 100644 Binary files a/pix/f/html-256.png and b/pix/f/html-256.png differ diff --git a/pix/f/html-32.png b/pix/f/html-32.png index d4a521809b8..4e2728176f7 100644 Binary files a/pix/f/html-32.png and b/pix/f/html-32.png differ diff --git a/pix/f/html-48.png b/pix/f/html-48.png index 1b2ad1074a5..b0d704b62b0 100644 Binary files a/pix/f/html-48.png and b/pix/f/html-48.png differ diff --git a/pix/f/html-64.png b/pix/f/html-64.png index 05e62b689ab..48066a89923 100644 Binary files a/pix/f/html-64.png and b/pix/f/html-64.png differ diff --git a/pix/f/html-72.png b/pix/f/html-72.png index d8b426809e3..80837affbd1 100644 Binary files a/pix/f/html-72.png and b/pix/f/html-72.png differ diff --git a/pix/f/html-80.png b/pix/f/html-80.png index 04506299d1c..69cf8b9994c 100644 Binary files a/pix/f/html-80.png and b/pix/f/html-80.png differ diff --git a/pix/f/html-96.png b/pix/f/html-96.png index 817736bcefa..8cc855d7689 100644 Binary files a/pix/f/html-96.png and b/pix/f/html-96.png differ diff --git a/pix/f/html.gif b/pix/f/html.gif new file mode 100644 index 00000000000..745ef3462c7 Binary files /dev/null and b/pix/f/html.gif differ diff --git a/pix/f/html.png b/pix/f/html.png deleted file mode 100644 index 9cb87e55414..00000000000 Binary files a/pix/f/html.png and /dev/null differ diff --git a/pix/f/impress-128.png b/pix/f/impress-128.png new file mode 100644 index 00000000000..471dd0a443f Binary files /dev/null and b/pix/f/impress-128.png differ diff --git a/pix/f/impress-24.png b/pix/f/impress-24.png new file mode 100644 index 00000000000..dc6532151ca Binary files /dev/null and b/pix/f/impress-24.png differ diff --git a/pix/f/impress-32.png b/pix/f/impress-32.png new file mode 100644 index 00000000000..7e2386403e6 Binary files /dev/null and b/pix/f/impress-32.png differ diff --git a/pix/f/impress-48.png b/pix/f/impress-48.png new file mode 100644 index 00000000000..1944f925b3a Binary files /dev/null and b/pix/f/impress-48.png differ diff --git a/pix/f/impress-64.png b/pix/f/impress-64.png new file mode 100644 index 00000000000..859da1e3c7a Binary files /dev/null and b/pix/f/impress-64.png differ diff --git a/pix/f/impress-72.png b/pix/f/impress-72.png new file mode 100644 index 00000000000..d2bd60667aa Binary files /dev/null and b/pix/f/impress-72.png differ diff --git a/pix/f/impress-80.png b/pix/f/impress-80.png new file mode 100644 index 00000000000..416ed266c26 Binary files /dev/null and b/pix/f/impress-80.png differ diff --git a/pix/f/impress-96.png b/pix/f/impress-96.png new file mode 100644 index 00000000000..1ad3d3e66a8 Binary files /dev/null and b/pix/f/impress-96.png differ diff --git a/pix/f/isf-128.png b/pix/f/isf-128.png new file mode 100644 index 00000000000..252cf67075f Binary files /dev/null and b/pix/f/isf-128.png differ diff --git a/pix/f/isf-24.png b/pix/f/isf-24.png new file mode 100644 index 00000000000..ce7527bffb6 Binary files /dev/null and b/pix/f/isf-24.png differ diff --git a/pix/f/isf-256.png b/pix/f/isf-256.png new file mode 100644 index 00000000000..e0fbfeea159 Binary files /dev/null and b/pix/f/isf-256.png differ diff --git a/pix/f/isf-32.png b/pix/f/isf-32.png new file mode 100644 index 00000000000..df39aedf138 Binary files /dev/null and b/pix/f/isf-32.png differ diff --git a/pix/f/isf-48.png b/pix/f/isf-48.png new file mode 100644 index 00000000000..1cad6de1a38 Binary files /dev/null and b/pix/f/isf-48.png differ diff --git a/pix/f/isf-64.png b/pix/f/isf-64.png new file mode 100644 index 00000000000..23476354bd3 Binary files /dev/null and b/pix/f/isf-64.png differ diff --git a/pix/f/isf-72.png b/pix/f/isf-72.png new file mode 100644 index 00000000000..b13631af2d1 Binary files /dev/null and b/pix/f/isf-72.png differ diff --git a/pix/f/isf-80.png b/pix/f/isf-80.png new file mode 100644 index 00000000000..d9c56ba987d Binary files /dev/null and b/pix/f/isf-80.png differ diff --git a/pix/f/isf-96.png b/pix/f/isf-96.png new file mode 100644 index 00000000000..24bbfb7f8be Binary files /dev/null and b/pix/f/isf-96.png differ diff --git a/pix/f/jpeg-128.png b/pix/f/jpeg-128.png index 6d289472657..e7aa2ef5999 100644 Binary files a/pix/f/jpeg-128.png and b/pix/f/jpeg-128.png differ diff --git a/pix/f/jpeg-24.png b/pix/f/jpeg-24.png index 39336f541ae..0c82e452b8f 100644 Binary files a/pix/f/jpeg-24.png and b/pix/f/jpeg-24.png differ diff --git a/pix/f/jpeg-256.png b/pix/f/jpeg-256.png index 0d403d69c79..affafe620d9 100644 Binary files a/pix/f/jpeg-256.png and b/pix/f/jpeg-256.png differ diff --git a/pix/f/jpeg-32.png b/pix/f/jpeg-32.png index d3a61fb50b1..78ff18f93bf 100644 Binary files a/pix/f/jpeg-32.png and b/pix/f/jpeg-32.png differ diff --git a/pix/f/jpeg-48.png b/pix/f/jpeg-48.png index 96ab11ce57f..13a7ca9f4e0 100644 Binary files a/pix/f/jpeg-48.png and b/pix/f/jpeg-48.png differ diff --git a/pix/f/jpeg-64.png b/pix/f/jpeg-64.png index 6e1f11fafe7..cf341072b40 100644 Binary files a/pix/f/jpeg-64.png and b/pix/f/jpeg-64.png differ diff --git a/pix/f/jpeg-72.png b/pix/f/jpeg-72.png index a1a7e67b321..2bacaca4578 100644 Binary files a/pix/f/jpeg-72.png and b/pix/f/jpeg-72.png differ diff --git a/pix/f/jpeg-80.png b/pix/f/jpeg-80.png index ef2284e710d..ae3f3af5c79 100644 Binary files a/pix/f/jpeg-80.png and b/pix/f/jpeg-80.png differ diff --git a/pix/f/jpeg-96.png b/pix/f/jpeg-96.png index 673f0c58b64..ebe9345257d 100644 Binary files a/pix/f/jpeg-96.png and b/pix/f/jpeg-96.png differ diff --git a/pix/f/markup-128.png b/pix/f/markup-128.png new file mode 100644 index 00000000000..88ba28154dd Binary files /dev/null and b/pix/f/markup-128.png differ diff --git a/pix/f/markup-24.png b/pix/f/markup-24.png new file mode 100644 index 00000000000..47fa7e1514f Binary files /dev/null and b/pix/f/markup-24.png differ diff --git a/pix/f/markup-256.png b/pix/f/markup-256.png new file mode 100644 index 00000000000..531b8530466 Binary files /dev/null and b/pix/f/markup-256.png differ diff --git a/pix/f/markup-32.png b/pix/f/markup-32.png new file mode 100644 index 00000000000..8e8d854ced5 Binary files /dev/null and b/pix/f/markup-32.png differ diff --git a/pix/f/markup-48.png b/pix/f/markup-48.png new file mode 100644 index 00000000000..3cb0c4a8a08 Binary files /dev/null and b/pix/f/markup-48.png differ diff --git a/pix/f/markup-64.png b/pix/f/markup-64.png new file mode 100644 index 00000000000..a251c7c6c07 Binary files /dev/null and b/pix/f/markup-64.png differ diff --git a/pix/f/markup-72.png b/pix/f/markup-72.png new file mode 100644 index 00000000000..1c45bb504e4 Binary files /dev/null and b/pix/f/markup-72.png differ diff --git a/pix/f/markup-80.png b/pix/f/markup-80.png new file mode 100644 index 00000000000..a398dd5dc83 Binary files /dev/null and b/pix/f/markup-80.png differ diff --git a/pix/f/markup-96.png b/pix/f/markup-96.png new file mode 100644 index 00000000000..6ccf69baee8 Binary files /dev/null and b/pix/f/markup-96.png differ diff --git a/pix/f/math-128.png b/pix/f/math-128.png new file mode 100644 index 00000000000..fd62fc55306 Binary files /dev/null and b/pix/f/math-128.png differ diff --git a/pix/f/math-24.png b/pix/f/math-24.png new file mode 100644 index 00000000000..13d98da3f02 Binary files /dev/null and b/pix/f/math-24.png differ diff --git a/pix/f/math-32.png b/pix/f/math-32.png new file mode 100644 index 00000000000..7d8628ad8b9 Binary files /dev/null and b/pix/f/math-32.png differ diff --git a/pix/f/math-48.png b/pix/f/math-48.png new file mode 100644 index 00000000000..61c31a84c33 Binary files /dev/null and b/pix/f/math-48.png differ diff --git a/pix/f/math-64.png b/pix/f/math-64.png new file mode 100644 index 00000000000..085ded411a0 Binary files /dev/null and b/pix/f/math-64.png differ diff --git a/pix/f/math-72.png b/pix/f/math-72.png new file mode 100644 index 00000000000..d993175a926 Binary files /dev/null and b/pix/f/math-72.png differ diff --git a/pix/f/math-80.png b/pix/f/math-80.png new file mode 100644 index 00000000000..4681747ecdb Binary files /dev/null and b/pix/f/math-80.png differ diff --git a/pix/f/math-96.png b/pix/f/math-96.png new file mode 100644 index 00000000000..c32d5f7f29a Binary files /dev/null and b/pix/f/math-96.png differ diff --git a/pix/f/moodle-128.png b/pix/f/moodle-128.png index 6526af25f77..c977bc29b8f 100644 Binary files a/pix/f/moodle-128.png and b/pix/f/moodle-128.png differ diff --git a/pix/f/moodle-24.png b/pix/f/moodle-24.png index 3ae91550744..88663e2342b 100644 Binary files a/pix/f/moodle-24.png and b/pix/f/moodle-24.png differ diff --git a/pix/f/moodle-256.png b/pix/f/moodle-256.png index 2e9c09a0960..a3b3ae7a73b 100644 Binary files a/pix/f/moodle-256.png and b/pix/f/moodle-256.png differ diff --git a/pix/f/moodle-32.png b/pix/f/moodle-32.png index e1f5ce31c75..6129bed88f1 100644 Binary files a/pix/f/moodle-32.png and b/pix/f/moodle-32.png differ diff --git a/pix/f/moodle-48.png b/pix/f/moodle-48.png index 5e268d9bd37..a6d50205ab2 100644 Binary files a/pix/f/moodle-48.png and b/pix/f/moodle-48.png differ diff --git a/pix/f/moodle-64.png b/pix/f/moodle-64.png index ea29a5c2c88..2280a8b8714 100644 Binary files a/pix/f/moodle-64.png and b/pix/f/moodle-64.png differ diff --git a/pix/f/moodle-72.png b/pix/f/moodle-72.png index 00789f0384a..918389425d8 100644 Binary files a/pix/f/moodle-72.png and b/pix/f/moodle-72.png differ diff --git a/pix/f/moodle-80.png b/pix/f/moodle-80.png index 1655c007d32..bab7abffdc8 100644 Binary files a/pix/f/moodle-80.png and b/pix/f/moodle-80.png differ diff --git a/pix/f/moodle-96.png b/pix/f/moodle-96.png index 4b9b7ecae6d..53684942079 100644 Binary files a/pix/f/moodle-96.png and b/pix/f/moodle-96.png differ diff --git a/pix/f/moodle.gif b/pix/f/moodle.gif deleted file mode 100644 index 25c53e49282..00000000000 Binary files a/pix/f/moodle.gif and /dev/null differ diff --git a/pix/f/mov-128.png b/pix/f/mov-128.png deleted file mode 100644 index 1a904a02ff5..00000000000 Binary files a/pix/f/mov-128.png and /dev/null differ diff --git a/pix/f/mov-24.png b/pix/f/mov-24.png deleted file mode 100644 index 690d14e6abc..00000000000 Binary files a/pix/f/mov-24.png and /dev/null differ diff --git a/pix/f/mov-256.png b/pix/f/mov-256.png deleted file mode 100644 index 78c512b0542..00000000000 Binary files a/pix/f/mov-256.png and /dev/null differ diff --git a/pix/f/mov-32.png b/pix/f/mov-32.png deleted file mode 100644 index f40489f13a6..00000000000 Binary files a/pix/f/mov-32.png and /dev/null differ diff --git a/pix/f/mov-48.png b/pix/f/mov-48.png deleted file mode 100644 index 1eeb21dee2c..00000000000 Binary files a/pix/f/mov-48.png and /dev/null differ diff --git a/pix/f/mov-64.png b/pix/f/mov-64.png deleted file mode 100644 index ab35721ff1e..00000000000 Binary files a/pix/f/mov-64.png and /dev/null differ diff --git a/pix/f/mov-72.png b/pix/f/mov-72.png deleted file mode 100644 index 92ca7bbed75..00000000000 Binary files a/pix/f/mov-72.png and /dev/null differ diff --git a/pix/f/mov-80.png b/pix/f/mov-80.png deleted file mode 100644 index dbb7cd74c5c..00000000000 Binary files a/pix/f/mov-80.png and /dev/null differ diff --git a/pix/f/mov-96.png b/pix/f/mov-96.png deleted file mode 100644 index 1282678b3b3..00000000000 Binary files a/pix/f/mov-96.png and /dev/null differ diff --git a/pix/f/mp3-128.png b/pix/f/mp3-128.png index 2a3479de7cd..aa7bb6eaaf0 100644 Binary files a/pix/f/mp3-128.png and b/pix/f/mp3-128.png differ diff --git a/pix/f/mp3-24.png b/pix/f/mp3-24.png index cad99352681..5752cd7eab4 100644 Binary files a/pix/f/mp3-24.png and b/pix/f/mp3-24.png differ diff --git a/pix/f/mp3-256.png b/pix/f/mp3-256.png index 8db10454598..373d298bb63 100644 Binary files a/pix/f/mp3-256.png and b/pix/f/mp3-256.png differ diff --git a/pix/f/mp3-32.png b/pix/f/mp3-32.png index 870119b2e88..0d8a1760fd4 100644 Binary files a/pix/f/mp3-32.png and b/pix/f/mp3-32.png differ diff --git a/pix/f/mp3-48.png b/pix/f/mp3-48.png index d5b33898016..dac86ff0283 100644 Binary files a/pix/f/mp3-48.png and b/pix/f/mp3-48.png differ diff --git a/pix/f/mp3-64.png b/pix/f/mp3-64.png index e9b8029dc91..5209090c54b 100644 Binary files a/pix/f/mp3-64.png and b/pix/f/mp3-64.png differ diff --git a/pix/f/mp3-72.png b/pix/f/mp3-72.png index bf92aaaefa8..b8cf3288f3e 100644 Binary files a/pix/f/mp3-72.png and b/pix/f/mp3-72.png differ diff --git a/pix/f/mp3-80.png b/pix/f/mp3-80.png index 3491a2f4fd9..ef119345c37 100644 Binary files a/pix/f/mp3-80.png and b/pix/f/mp3-80.png differ diff --git a/pix/f/mp3-96.png b/pix/f/mp3-96.png index 7c204b12e7d..36c78cdc473 100644 Binary files a/pix/f/mp3-96.png and b/pix/f/mp3-96.png differ diff --git a/pix/f/mpeg-128.png b/pix/f/mpeg-128.png index b06e26aa109..d0e1cc4ff73 100644 Binary files a/pix/f/mpeg-128.png and b/pix/f/mpeg-128.png differ diff --git a/pix/f/mpeg-24.png b/pix/f/mpeg-24.png index 727a8fee6ea..16de2a18202 100644 Binary files a/pix/f/mpeg-24.png and b/pix/f/mpeg-24.png differ diff --git a/pix/f/mpeg-256.png b/pix/f/mpeg-256.png index 0ef252f1889..6b8db07cf8a 100644 Binary files a/pix/f/mpeg-256.png and b/pix/f/mpeg-256.png differ diff --git a/pix/f/mpeg-32.png b/pix/f/mpeg-32.png index f607ed9a664..fd3ae5fcf62 100644 Binary files a/pix/f/mpeg-32.png and b/pix/f/mpeg-32.png differ diff --git a/pix/f/mpeg-48.png b/pix/f/mpeg-48.png index daa8ef6affc..cc5ea0660eb 100644 Binary files a/pix/f/mpeg-48.png and b/pix/f/mpeg-48.png differ diff --git a/pix/f/mpeg-64.png b/pix/f/mpeg-64.png index 78168f4490f..4d81ac5e374 100644 Binary files a/pix/f/mpeg-64.png and b/pix/f/mpeg-64.png differ diff --git a/pix/f/mpeg-72.png b/pix/f/mpeg-72.png index 66fe4748f20..b5da75f17bf 100644 Binary files a/pix/f/mpeg-72.png and b/pix/f/mpeg-72.png differ diff --git a/pix/f/mpeg-80.png b/pix/f/mpeg-80.png index c6e3d1b5b81..d5205d8437f 100644 Binary files a/pix/f/mpeg-80.png and b/pix/f/mpeg-80.png differ diff --git a/pix/f/mpeg-96.png b/pix/f/mpeg-96.png index ebd641bc661..7b5790f79be 100644 Binary files a/pix/f/mpeg-96.png and b/pix/f/mpeg-96.png differ diff --git a/pix/f/odb-128.png b/pix/f/odb-128.png deleted file mode 100644 index 9d3500084a2..00000000000 Binary files a/pix/f/odb-128.png and /dev/null differ diff --git a/pix/f/odb-24.png b/pix/f/odb-24.png deleted file mode 100644 index dbd4d2fce7e..00000000000 Binary files a/pix/f/odb-24.png and /dev/null differ diff --git a/pix/f/odb-32.png b/pix/f/odb-32.png deleted file mode 100644 index 2e47991b7c6..00000000000 Binary files a/pix/f/odb-32.png and /dev/null differ diff --git a/pix/f/odb-48.png b/pix/f/odb-48.png deleted file mode 100644 index 54be4a60018..00000000000 Binary files a/pix/f/odb-48.png and /dev/null differ diff --git a/pix/f/odb-64.png b/pix/f/odb-64.png deleted file mode 100644 index 95a98146da6..00000000000 Binary files a/pix/f/odb-64.png and /dev/null differ diff --git a/pix/f/odb-72.png b/pix/f/odb-72.png deleted file mode 100644 index 227b8c262c6..00000000000 Binary files a/pix/f/odb-72.png and /dev/null differ diff --git a/pix/f/odb-80.png b/pix/f/odb-80.png deleted file mode 100644 index 6a9dd6a206c..00000000000 Binary files a/pix/f/odb-80.png and /dev/null differ diff --git a/pix/f/odb-96.png b/pix/f/odb-96.png deleted file mode 100644 index 048b7b5b362..00000000000 Binary files a/pix/f/odb-96.png and /dev/null differ diff --git a/pix/f/odb.png b/pix/f/odb.png deleted file mode 100644 index 03b2b9ad0ae..00000000000 Binary files a/pix/f/odb.png and /dev/null differ diff --git a/pix/f/odc-128.png b/pix/f/odc-128.png deleted file mode 100644 index 808c7721061..00000000000 Binary files a/pix/f/odc-128.png and /dev/null differ diff --git a/pix/f/odc-24.png b/pix/f/odc-24.png deleted file mode 100644 index 8283d4c02bc..00000000000 Binary files a/pix/f/odc-24.png and /dev/null differ diff --git a/pix/f/odc-32.png b/pix/f/odc-32.png deleted file mode 100644 index b2c379b7b42..00000000000 Binary files a/pix/f/odc-32.png and /dev/null differ diff --git a/pix/f/odc-48.png b/pix/f/odc-48.png deleted file mode 100644 index bf68eef196e..00000000000 Binary files a/pix/f/odc-48.png and /dev/null differ diff --git a/pix/f/odc-64.png b/pix/f/odc-64.png deleted file mode 100644 index a4d35f99c0c..00000000000 Binary files a/pix/f/odc-64.png and /dev/null differ diff --git a/pix/f/odc-72.png b/pix/f/odc-72.png deleted file mode 100644 index dcc8f1531eb..00000000000 Binary files a/pix/f/odc-72.png and /dev/null differ diff --git a/pix/f/odc-80.png b/pix/f/odc-80.png deleted file mode 100644 index 0d6a4efac86..00000000000 Binary files a/pix/f/odc-80.png and /dev/null differ diff --git a/pix/f/odc-96.png b/pix/f/odc-96.png deleted file mode 100644 index d0a103f6d19..00000000000 Binary files a/pix/f/odc-96.png and /dev/null differ diff --git a/pix/f/odc.png b/pix/f/odc.png deleted file mode 100644 index 9feb9eb9b77..00000000000 Binary files a/pix/f/odc.png and /dev/null differ diff --git a/pix/f/odf-128.png b/pix/f/odf-128.png deleted file mode 100644 index 988afb135b4..00000000000 Binary files a/pix/f/odf-128.png and /dev/null differ diff --git a/pix/f/odf-24.png b/pix/f/odf-24.png deleted file mode 100644 index 9643a91ff08..00000000000 Binary files a/pix/f/odf-24.png and /dev/null differ diff --git a/pix/f/odf-32.png b/pix/f/odf-32.png deleted file mode 100644 index 789c6138ebc..00000000000 Binary files a/pix/f/odf-32.png and /dev/null differ diff --git a/pix/f/odf-48.png b/pix/f/odf-48.png deleted file mode 100644 index 9f92465abb9..00000000000 Binary files a/pix/f/odf-48.png and /dev/null differ diff --git a/pix/f/odf-64.png b/pix/f/odf-64.png deleted file mode 100644 index 29f42c55594..00000000000 Binary files a/pix/f/odf-64.png and /dev/null differ diff --git a/pix/f/odf-72.png b/pix/f/odf-72.png deleted file mode 100644 index b144673ea4d..00000000000 Binary files a/pix/f/odf-72.png and /dev/null differ diff --git a/pix/f/odf-80.png b/pix/f/odf-80.png deleted file mode 100644 index b9a60274403..00000000000 Binary files a/pix/f/odf-80.png and /dev/null differ diff --git a/pix/f/odf-96.png b/pix/f/odf-96.png deleted file mode 100644 index 94a720befca..00000000000 Binary files a/pix/f/odf-96.png and /dev/null differ diff --git a/pix/f/odf.png b/pix/f/odf.png deleted file mode 100644 index f07882bd13d..00000000000 Binary files a/pix/f/odf.png and /dev/null differ diff --git a/pix/f/odg-128.png b/pix/f/odg-128.png deleted file mode 100644 index 13216ee6455..00000000000 Binary files a/pix/f/odg-128.png and /dev/null differ diff --git a/pix/f/odg-24.png b/pix/f/odg-24.png deleted file mode 100644 index fd47ef6dedc..00000000000 Binary files a/pix/f/odg-24.png and /dev/null differ diff --git a/pix/f/odg-32.png b/pix/f/odg-32.png deleted file mode 100644 index 5a8580cd631..00000000000 Binary files a/pix/f/odg-32.png and /dev/null differ diff --git a/pix/f/odg-48.png b/pix/f/odg-48.png deleted file mode 100644 index d9228a8d849..00000000000 Binary files a/pix/f/odg-48.png and /dev/null differ diff --git a/pix/f/odg-64.png b/pix/f/odg-64.png deleted file mode 100644 index 989e87d7e54..00000000000 Binary files a/pix/f/odg-64.png and /dev/null differ diff --git a/pix/f/odg-72.png b/pix/f/odg-72.png deleted file mode 100644 index 56d095e3be9..00000000000 Binary files a/pix/f/odg-72.png and /dev/null differ diff --git a/pix/f/odg-80.png b/pix/f/odg-80.png deleted file mode 100644 index 5dfc9f79922..00000000000 Binary files a/pix/f/odg-80.png and /dev/null differ diff --git a/pix/f/odg-96.png b/pix/f/odg-96.png deleted file mode 100644 index d9bb8a618fb..00000000000 Binary files a/pix/f/odg-96.png and /dev/null differ diff --git a/pix/f/odg.png b/pix/f/odg.png deleted file mode 100644 index f9b7e1b2673..00000000000 Binary files a/pix/f/odg.png and /dev/null differ diff --git a/pix/f/odp-128.png b/pix/f/odp-128.png deleted file mode 100644 index eb9c480d788..00000000000 Binary files a/pix/f/odp-128.png and /dev/null differ diff --git a/pix/f/odp-24.png b/pix/f/odp-24.png deleted file mode 100644 index bf3a6683e90..00000000000 Binary files a/pix/f/odp-24.png and /dev/null differ diff --git a/pix/f/odp-32.png b/pix/f/odp-32.png deleted file mode 100644 index 7f51fc87a03..00000000000 Binary files a/pix/f/odp-32.png and /dev/null differ diff --git a/pix/f/odp-48.png b/pix/f/odp-48.png deleted file mode 100644 index 7ddfef7f927..00000000000 Binary files a/pix/f/odp-48.png and /dev/null differ diff --git a/pix/f/odp-64.png b/pix/f/odp-64.png deleted file mode 100644 index b026dbffab1..00000000000 Binary files a/pix/f/odp-64.png and /dev/null differ diff --git a/pix/f/odp-72.png b/pix/f/odp-72.png deleted file mode 100644 index 7107f64145c..00000000000 Binary files a/pix/f/odp-72.png and /dev/null differ diff --git a/pix/f/odp-80.png b/pix/f/odp-80.png deleted file mode 100644 index 44be7370d18..00000000000 Binary files a/pix/f/odp-80.png and /dev/null differ diff --git a/pix/f/odp-96.png b/pix/f/odp-96.png deleted file mode 100644 index 4f70cd09e13..00000000000 Binary files a/pix/f/odp-96.png and /dev/null differ diff --git a/pix/f/odp.png b/pix/f/odp.png deleted file mode 100644 index 565c060fe5e..00000000000 Binary files a/pix/f/odp.png and /dev/null differ diff --git a/pix/f/ods-128.png b/pix/f/ods-128.png deleted file mode 100644 index e798d2cdcd9..00000000000 Binary files a/pix/f/ods-128.png and /dev/null differ diff --git a/pix/f/ods-24.png b/pix/f/ods-24.png deleted file mode 100644 index ba6258586f0..00000000000 Binary files a/pix/f/ods-24.png and /dev/null differ diff --git a/pix/f/ods-32.png b/pix/f/ods-32.png deleted file mode 100644 index 1f986f55aab..00000000000 Binary files a/pix/f/ods-32.png and /dev/null differ diff --git a/pix/f/ods-48.png b/pix/f/ods-48.png deleted file mode 100644 index 16e24e2c0f2..00000000000 Binary files a/pix/f/ods-48.png and /dev/null differ diff --git a/pix/f/ods-64.png b/pix/f/ods-64.png deleted file mode 100644 index c590a56afa3..00000000000 Binary files a/pix/f/ods-64.png and /dev/null differ diff --git a/pix/f/ods-72.png b/pix/f/ods-72.png deleted file mode 100644 index b03ca6d8a7b..00000000000 Binary files a/pix/f/ods-72.png and /dev/null differ diff --git a/pix/f/ods-80.png b/pix/f/ods-80.png deleted file mode 100644 index a44d8896513..00000000000 Binary files a/pix/f/ods-80.png and /dev/null differ diff --git a/pix/f/ods-96.png b/pix/f/ods-96.png deleted file mode 100644 index 6cf619766db..00000000000 Binary files a/pix/f/ods-96.png and /dev/null differ diff --git a/pix/f/ods.png b/pix/f/ods.png deleted file mode 100644 index 66d7e8a4675..00000000000 Binary files a/pix/f/ods.png and /dev/null differ diff --git a/pix/f/odt-128.png b/pix/f/odt-128.png deleted file mode 100644 index 6dc7a34deb3..00000000000 Binary files a/pix/f/odt-128.png and /dev/null differ diff --git a/pix/f/odt-24.png b/pix/f/odt-24.png deleted file mode 100644 index 8093b9738ac..00000000000 Binary files a/pix/f/odt-24.png and /dev/null differ diff --git a/pix/f/odt-32.png b/pix/f/odt-32.png deleted file mode 100644 index a3faca67453..00000000000 Binary files a/pix/f/odt-32.png and /dev/null differ diff --git a/pix/f/odt-48.png b/pix/f/odt-48.png deleted file mode 100644 index 7c1c49e3ba0..00000000000 Binary files a/pix/f/odt-48.png and /dev/null differ diff --git a/pix/f/odt-64.png b/pix/f/odt-64.png deleted file mode 100644 index 216909dc233..00000000000 Binary files a/pix/f/odt-64.png and /dev/null differ diff --git a/pix/f/odt-72.png b/pix/f/odt-72.png deleted file mode 100644 index bb1cee111f7..00000000000 Binary files a/pix/f/odt-72.png and /dev/null differ diff --git a/pix/f/odt-80.png b/pix/f/odt-80.png deleted file mode 100644 index c8348d13149..00000000000 Binary files a/pix/f/odt-80.png and /dev/null differ diff --git a/pix/f/odt-96.png b/pix/f/odt-96.png deleted file mode 100644 index 0e014075285..00000000000 Binary files a/pix/f/odt-96.png and /dev/null differ diff --git a/pix/f/odt.png b/pix/f/odt.png deleted file mode 100644 index 1eec498a28b..00000000000 Binary files a/pix/f/odt.png and /dev/null differ diff --git a/pix/f/oth-128.png b/pix/f/oth-128.png index 53f21f99376..39b98d29d17 100644 Binary files a/pix/f/oth-128.png and b/pix/f/oth-128.png differ diff --git a/pix/f/oth-24.png b/pix/f/oth-24.png index 415c1c39a97..4c5abac4f3d 100644 Binary files a/pix/f/oth-24.png and b/pix/f/oth-24.png differ diff --git a/pix/f/oth-32.png b/pix/f/oth-32.png index 7bb0f2185f1..398c1b4ce85 100644 Binary files a/pix/f/oth-32.png and b/pix/f/oth-32.png differ diff --git a/pix/f/oth-48.png b/pix/f/oth-48.png index 0827a44ea73..83244604f50 100644 Binary files a/pix/f/oth-48.png and b/pix/f/oth-48.png differ diff --git a/pix/f/oth-64.png b/pix/f/oth-64.png index 986586f2ac8..b58ac463ada 100644 Binary files a/pix/f/oth-64.png and b/pix/f/oth-64.png differ diff --git a/pix/f/oth-72.png b/pix/f/oth-72.png index 2e3c9315aa3..f8e5918410a 100644 Binary files a/pix/f/oth-72.png and b/pix/f/oth-72.png differ diff --git a/pix/f/oth-80.png b/pix/f/oth-80.png index a593edb8a01..6c8bac5c74c 100644 Binary files a/pix/f/oth-80.png and b/pix/f/oth-80.png differ diff --git a/pix/f/oth-96.png b/pix/f/oth-96.png index e8b74ea1cbe..2feab7f34f0 100644 Binary files a/pix/f/oth-96.png and b/pix/f/oth-96.png differ diff --git a/pix/f/pdf-128.png b/pix/f/pdf-128.png index 390bed9792d..b46851f8bed 100644 Binary files a/pix/f/pdf-128.png and b/pix/f/pdf-128.png differ diff --git a/pix/f/pdf-24.png b/pix/f/pdf-24.png index 757f55a8e00..12574a9fb8d 100644 Binary files a/pix/f/pdf-24.png and b/pix/f/pdf-24.png differ diff --git a/pix/f/pdf-256.png b/pix/f/pdf-256.png index 95e2ca29279..5720a25b12b 100644 Binary files a/pix/f/pdf-256.png and b/pix/f/pdf-256.png differ diff --git a/pix/f/pdf-32.png b/pix/f/pdf-32.png index a1f3f4edfc5..0720184d838 100644 Binary files a/pix/f/pdf-32.png and b/pix/f/pdf-32.png differ diff --git a/pix/f/pdf-48.png b/pix/f/pdf-48.png index 32cd7b378e3..c32a4ef8f60 100644 Binary files a/pix/f/pdf-48.png and b/pix/f/pdf-48.png differ diff --git a/pix/f/pdf-64.png b/pix/f/pdf-64.png index 6b0a1fea6da..e3b312332e6 100644 Binary files a/pix/f/pdf-64.png and b/pix/f/pdf-64.png differ diff --git a/pix/f/pdf-72.png b/pix/f/pdf-72.png index 117d27180cc..36c4328d7ea 100644 Binary files a/pix/f/pdf-72.png and b/pix/f/pdf-72.png differ diff --git a/pix/f/pdf-80.png b/pix/f/pdf-80.png index ffdb7d4a3c9..f9824f1a738 100644 Binary files a/pix/f/pdf-80.png and b/pix/f/pdf-80.png differ diff --git a/pix/f/pdf-96.png b/pix/f/pdf-96.png index fbf18d8fd35..19b8ce83946 100644 Binary files a/pix/f/pdf-96.png and b/pix/f/pdf-96.png differ diff --git a/pix/f/png-128.png b/pix/f/png-128.png index 0161b591fdb..63a4f483851 100644 Binary files a/pix/f/png-128.png and b/pix/f/png-128.png differ diff --git a/pix/f/png-24.png b/pix/f/png-24.png index a0664c20985..3de1e48861f 100644 Binary files a/pix/f/png-24.png and b/pix/f/png-24.png differ diff --git a/pix/f/png-256.png b/pix/f/png-256.png index 6293f3c4c5c..3e0d6b4496c 100644 Binary files a/pix/f/png-256.png and b/pix/f/png-256.png differ diff --git a/pix/f/png-32.png b/pix/f/png-32.png index 6bea58f1bd3..e6076dea27c 100644 Binary files a/pix/f/png-32.png and b/pix/f/png-32.png differ diff --git a/pix/f/png-48.png b/pix/f/png-48.png index 90564b06284..73fbc5b4d0b 100644 Binary files a/pix/f/png-48.png and b/pix/f/png-48.png differ diff --git a/pix/f/png-64.png b/pix/f/png-64.png index 6d200b82bd3..aec5a2dbc4a 100644 Binary files a/pix/f/png-64.png and b/pix/f/png-64.png differ diff --git a/pix/f/png-72.png b/pix/f/png-72.png index 150cd52f01e..be885750c31 100644 Binary files a/pix/f/png-72.png and b/pix/f/png-72.png differ diff --git a/pix/f/png-80.png b/pix/f/png-80.png index 3e3d199ad7a..d4fb7bb979e 100644 Binary files a/pix/f/png-80.png and b/pix/f/png-80.png differ diff --git a/pix/f/png-96.png b/pix/f/png-96.png index 63cb82697de..000983d8a2c 100644 Binary files a/pix/f/png-96.png and b/pix/f/png-96.png differ diff --git a/pix/f/pptx-128.png b/pix/f/pptx-128.png deleted file mode 100644 index 58a0dcec2b4..00000000000 Binary files a/pix/f/pptx-128.png and /dev/null differ diff --git a/pix/f/pptx-24.png b/pix/f/pptx-24.png deleted file mode 100644 index 6ea38a8c9d7..00000000000 Binary files a/pix/f/pptx-24.png and /dev/null differ diff --git a/pix/f/pptx-256.png b/pix/f/pptx-256.png deleted file mode 100644 index 1a4609bb972..00000000000 Binary files a/pix/f/pptx-256.png and /dev/null differ diff --git a/pix/f/pptx-32.png b/pix/f/pptx-32.png deleted file mode 100644 index 27d10055a18..00000000000 Binary files a/pix/f/pptx-32.png and /dev/null differ diff --git a/pix/f/pptx-48.png b/pix/f/pptx-48.png deleted file mode 100644 index c4d3af40bbf..00000000000 Binary files a/pix/f/pptx-48.png and /dev/null differ diff --git a/pix/f/pptx-64.png b/pix/f/pptx-64.png deleted file mode 100644 index d3873c1f7a2..00000000000 Binary files a/pix/f/pptx-64.png and /dev/null differ diff --git a/pix/f/pptx-72.png b/pix/f/pptx-72.png deleted file mode 100644 index 1ab1e60d5bf..00000000000 Binary files a/pix/f/pptx-72.png and /dev/null differ diff --git a/pix/f/pptx-80.png b/pix/f/pptx-80.png deleted file mode 100644 index 22759ea6cba..00000000000 Binary files a/pix/f/pptx-80.png and /dev/null differ diff --git a/pix/f/pptx-96.png b/pix/f/pptx-96.png deleted file mode 100644 index e02559595b8..00000000000 Binary files a/pix/f/pptx-96.png and /dev/null differ diff --git a/pix/f/pptx.png b/pix/f/pptx.png deleted file mode 100644 index fb4ecb9509e..00000000000 Binary files a/pix/f/pptx.png and /dev/null differ diff --git a/pix/f/quicktime-128.png b/pix/f/quicktime-128.png new file mode 100644 index 00000000000..07a7fea512b Binary files /dev/null and b/pix/f/quicktime-128.png differ diff --git a/pix/f/quicktime-24.png b/pix/f/quicktime-24.png new file mode 100644 index 00000000000..e6e8c3a8d82 Binary files /dev/null and b/pix/f/quicktime-24.png differ diff --git a/pix/f/quicktime-256.png b/pix/f/quicktime-256.png new file mode 100644 index 00000000000..8b9776694de Binary files /dev/null and b/pix/f/quicktime-256.png differ diff --git a/pix/f/quicktime-32.png b/pix/f/quicktime-32.png new file mode 100644 index 00000000000..4837a814fdf Binary files /dev/null and b/pix/f/quicktime-32.png differ diff --git a/pix/f/quicktime-48.png b/pix/f/quicktime-48.png new file mode 100644 index 00000000000..ea29e23cb8b Binary files /dev/null and b/pix/f/quicktime-48.png differ diff --git a/pix/f/quicktime-64.png b/pix/f/quicktime-64.png new file mode 100644 index 00000000000..6fa08f9e749 Binary files /dev/null and b/pix/f/quicktime-64.png differ diff --git a/pix/f/quicktime-72.png b/pix/f/quicktime-72.png new file mode 100644 index 00000000000..aea4673c38a Binary files /dev/null and b/pix/f/quicktime-72.png differ diff --git a/pix/f/quicktime-80.png b/pix/f/quicktime-80.png new file mode 100644 index 00000000000..02f81ff9035 Binary files /dev/null and b/pix/f/quicktime-80.png differ diff --git a/pix/f/quicktime-96.png b/pix/f/quicktime-96.png new file mode 100644 index 00000000000..3f5204a00ac Binary files /dev/null and b/pix/f/quicktime-96.png differ diff --git a/pix/f/sourcecode-128.png b/pix/f/sourcecode-128.png new file mode 100644 index 00000000000..02d98a9170e Binary files /dev/null and b/pix/f/sourcecode-128.png differ diff --git a/pix/f/sourcecode-24.png b/pix/f/sourcecode-24.png new file mode 100644 index 00000000000..79152d269ce Binary files /dev/null and b/pix/f/sourcecode-24.png differ diff --git a/pix/f/sourcecode-256.png b/pix/f/sourcecode-256.png new file mode 100644 index 00000000000..5407be7e29c Binary files /dev/null and b/pix/f/sourcecode-256.png differ diff --git a/pix/f/sourcecode-32.png b/pix/f/sourcecode-32.png new file mode 100644 index 00000000000..9e5f8a8afd0 Binary files /dev/null and b/pix/f/sourcecode-32.png differ diff --git a/pix/f/sourcecode-48.png b/pix/f/sourcecode-48.png new file mode 100644 index 00000000000..88f2df661ec Binary files /dev/null and b/pix/f/sourcecode-48.png differ diff --git a/pix/f/sourcecode-64.png b/pix/f/sourcecode-64.png new file mode 100644 index 00000000000..f88b24e2e4b Binary files /dev/null and b/pix/f/sourcecode-64.png differ diff --git a/pix/f/sourcecode-72.png b/pix/f/sourcecode-72.png new file mode 100644 index 00000000000..e928eb1c80b Binary files /dev/null and b/pix/f/sourcecode-72.png differ diff --git a/pix/f/sourcecode-80.png b/pix/f/sourcecode-80.png new file mode 100644 index 00000000000..6086c17f80a Binary files /dev/null and b/pix/f/sourcecode-80.png differ diff --git a/pix/f/sourcecode-96.png b/pix/f/sourcecode-96.png new file mode 100644 index 00000000000..9646fe6c208 Binary files /dev/null and b/pix/f/sourcecode-96.png differ diff --git a/pix/f/text-128.png b/pix/f/text-128.png index bfacff32a29..8c70785dec7 100644 Binary files a/pix/f/text-128.png and b/pix/f/text-128.png differ diff --git a/pix/f/text-24.png b/pix/f/text-24.png index 4151eac1936..62c3e20ae11 100644 Binary files a/pix/f/text-24.png and b/pix/f/text-24.png differ diff --git a/pix/f/text-256.png b/pix/f/text-256.png index 5ea447dc8ef..da7f3cb136c 100644 Binary files a/pix/f/text-256.png and b/pix/f/text-256.png differ diff --git a/pix/f/text-32.png b/pix/f/text-32.png index 05e3b04282a..acf37f1f37c 100644 Binary files a/pix/f/text-32.png and b/pix/f/text-32.png differ diff --git a/pix/f/text-48.png b/pix/f/text-48.png index 94cbd69b054..7f0c02c4e4d 100644 Binary files a/pix/f/text-48.png and b/pix/f/text-48.png differ diff --git a/pix/f/text-64.png b/pix/f/text-64.png index 4efa1a5e421..f8ff43d38ca 100644 Binary files a/pix/f/text-64.png and b/pix/f/text-64.png differ diff --git a/pix/f/text-72.png b/pix/f/text-72.png index efe8564a04c..7b33be9e64d 100644 Binary files a/pix/f/text-72.png and b/pix/f/text-72.png differ diff --git a/pix/f/text-80.png b/pix/f/text-80.png index 8c6727da82d..e94abc90c17 100644 Binary files a/pix/f/text-80.png and b/pix/f/text-80.png differ diff --git a/pix/f/text-96.png b/pix/f/text-96.png index a87a0ecf31c..eaf2042203f 100644 Binary files a/pix/f/text-96.png and b/pix/f/text-96.png differ diff --git a/pix/f/tiff-128.png b/pix/f/tiff-128.png index 19a9ccc5adb..412a87f67c0 100644 Binary files a/pix/f/tiff-128.png and b/pix/f/tiff-128.png differ diff --git a/pix/f/tiff-24.png b/pix/f/tiff-24.png index 63828a1754a..028616e156a 100644 Binary files a/pix/f/tiff-24.png and b/pix/f/tiff-24.png differ diff --git a/pix/f/tiff-256.png b/pix/f/tiff-256.png index bdc619e71b5..f036604fd27 100644 Binary files a/pix/f/tiff-256.png and b/pix/f/tiff-256.png differ diff --git a/pix/f/tiff-32.png b/pix/f/tiff-32.png index 43531e9439c..1585d1ac109 100644 Binary files a/pix/f/tiff-32.png and b/pix/f/tiff-32.png differ diff --git a/pix/f/tiff-48.png b/pix/f/tiff-48.png index 2231e67d6b9..093d9876f6e 100644 Binary files a/pix/f/tiff-48.png and b/pix/f/tiff-48.png differ diff --git a/pix/f/tiff-64.png b/pix/f/tiff-64.png index 13e1f8eab0d..3df7bed2150 100644 Binary files a/pix/f/tiff-64.png and b/pix/f/tiff-64.png differ diff --git a/pix/f/tiff-72.png b/pix/f/tiff-72.png index bf06ac60638..e9482f089d0 100644 Binary files a/pix/f/tiff-72.png and b/pix/f/tiff-72.png differ diff --git a/pix/f/tiff-80.png b/pix/f/tiff-80.png index 3c75e90a203..8175938537d 100644 Binary files a/pix/f/tiff-80.png and b/pix/f/tiff-80.png differ diff --git a/pix/f/tiff-96.png b/pix/f/tiff-96.png index 92ecbe5cdbc..b0506480c00 100644 Binary files a/pix/f/tiff-96.png and b/pix/f/tiff-96.png differ diff --git a/pix/f/video-128.png b/pix/f/video-128.png index fc6b5ba7916..158dde8bddd 100644 Binary files a/pix/f/video-128.png and b/pix/f/video-128.png differ diff --git a/pix/f/video-24.png b/pix/f/video-24.png index 4858701042e..5bc3f606dd1 100644 Binary files a/pix/f/video-24.png and b/pix/f/video-24.png differ diff --git a/pix/f/video-256.png b/pix/f/video-256.png index 1895867fcaa..7843ecefd9c 100644 Binary files a/pix/f/video-256.png and b/pix/f/video-256.png differ diff --git a/pix/f/video-32.png b/pix/f/video-32.png index b6165472a5e..3a3ca23c4f2 100644 Binary files a/pix/f/video-32.png and b/pix/f/video-32.png differ diff --git a/pix/f/video-48.png b/pix/f/video-48.png index 5cfda5ec31f..38dfed32527 100644 Binary files a/pix/f/video-48.png and b/pix/f/video-48.png differ diff --git a/pix/f/video-64.png b/pix/f/video-64.png index 741e017e4db..f03af8c10b8 100644 Binary files a/pix/f/video-64.png and b/pix/f/video-64.png differ diff --git a/pix/f/video-72.png b/pix/f/video-72.png index c21909ba1c3..a43442670e3 100644 Binary files a/pix/f/video-72.png and b/pix/f/video-72.png differ diff --git a/pix/f/video-80.png b/pix/f/video-80.png index 71c8d44a7d9..ceedf818b18 100644 Binary files a/pix/f/video-80.png and b/pix/f/video-80.png differ diff --git a/pix/f/video-96.png b/pix/f/video-96.png index b089c214690..6d92ec8bf72 100644 Binary files a/pix/f/video-96.png and b/pix/f/video-96.png differ diff --git a/pix/f/wav-128.png b/pix/f/wav-128.png index 2d524001dd6..ae4829b247b 100644 Binary files a/pix/f/wav-128.png and b/pix/f/wav-128.png differ diff --git a/pix/f/wav-24.png b/pix/f/wav-24.png index 0ce5448e571..a9901516f22 100644 Binary files a/pix/f/wav-24.png and b/pix/f/wav-24.png differ diff --git a/pix/f/wav-256.png b/pix/f/wav-256.png index d8b945774b1..62670ab6b3b 100644 Binary files a/pix/f/wav-256.png and b/pix/f/wav-256.png differ diff --git a/pix/f/wav-32.png b/pix/f/wav-32.png index 3e6e6d0c0bc..e1d3f5f503b 100644 Binary files a/pix/f/wav-32.png and b/pix/f/wav-32.png differ diff --git a/pix/f/wav-48.png b/pix/f/wav-48.png index a256b70850f..f92262c8862 100644 Binary files a/pix/f/wav-48.png and b/pix/f/wav-48.png differ diff --git a/pix/f/wav-64.png b/pix/f/wav-64.png index 9f3792b9005..57754ba3cc2 100644 Binary files a/pix/f/wav-64.png and b/pix/f/wav-64.png differ diff --git a/pix/f/wav-72.png b/pix/f/wav-72.png index e82d36b2873..7f4f836cef9 100644 Binary files a/pix/f/wav-72.png and b/pix/f/wav-72.png differ diff --git a/pix/f/wav-80.png b/pix/f/wav-80.png index 86966b33108..c3996591a01 100644 Binary files a/pix/f/wav-80.png and b/pix/f/wav-80.png differ diff --git a/pix/f/wav-96.png b/pix/f/wav-96.png index 961592bab34..6baacdfb148 100644 Binary files a/pix/f/wav-96.png and b/pix/f/wav-96.png differ diff --git a/pix/f/wma-128.png b/pix/f/wma-128.png deleted file mode 100644 index 183bf78a5ed..00000000000 Binary files a/pix/f/wma-128.png and /dev/null differ diff --git a/pix/f/wma-24.png b/pix/f/wma-24.png deleted file mode 100644 index ee91713d8f9..00000000000 Binary files a/pix/f/wma-24.png and /dev/null differ diff --git a/pix/f/wma-256.png b/pix/f/wma-256.png deleted file mode 100644 index 4e00fadf71b..00000000000 Binary files a/pix/f/wma-256.png and /dev/null differ diff --git a/pix/f/wma-32.png b/pix/f/wma-32.png deleted file mode 100644 index 1a1cfb1b413..00000000000 Binary files a/pix/f/wma-32.png and /dev/null differ diff --git a/pix/f/wma-48.png b/pix/f/wma-48.png deleted file mode 100644 index 4e0359e534a..00000000000 Binary files a/pix/f/wma-48.png and /dev/null differ diff --git a/pix/f/wma-64.png b/pix/f/wma-64.png deleted file mode 100644 index a38a25975e1..00000000000 Binary files a/pix/f/wma-64.png and /dev/null differ diff --git a/pix/f/wma-72.png b/pix/f/wma-72.png deleted file mode 100644 index 3e92126674d..00000000000 Binary files a/pix/f/wma-72.png and /dev/null differ diff --git a/pix/f/wma-80.png b/pix/f/wma-80.png deleted file mode 100644 index 831b99df5f1..00000000000 Binary files a/pix/f/wma-80.png and /dev/null differ diff --git a/pix/f/wma-96.png b/pix/f/wma-96.png deleted file mode 100644 index 9ede12c446b..00000000000 Binary files a/pix/f/wma-96.png and /dev/null differ diff --git a/pix/f/wma.png b/pix/f/wma.png deleted file mode 100644 index 2643dd9e89a..00000000000 Binary files a/pix/f/wma.png and /dev/null differ diff --git a/pix/f/wmv-128.png b/pix/f/wmv-128.png index 1c2014fc71d..158dde8bddd 100644 Binary files a/pix/f/wmv-128.png and b/pix/f/wmv-128.png differ diff --git a/pix/f/wmv-24.png b/pix/f/wmv-24.png index 38b172c9bd1..5bc3f606dd1 100644 Binary files a/pix/f/wmv-24.png and b/pix/f/wmv-24.png differ diff --git a/pix/f/wmv-256.png b/pix/f/wmv-256.png index 9e5d3af00cc..7843ecefd9c 100644 Binary files a/pix/f/wmv-256.png and b/pix/f/wmv-256.png differ diff --git a/pix/f/wmv-32.png b/pix/f/wmv-32.png index 13f8e8c3b32..3a3ca23c4f2 100644 Binary files a/pix/f/wmv-32.png and b/pix/f/wmv-32.png differ diff --git a/pix/f/wmv-48.png b/pix/f/wmv-48.png index 774c4ed5688..38dfed32527 100644 Binary files a/pix/f/wmv-48.png and b/pix/f/wmv-48.png differ diff --git a/pix/f/wmv-64.png b/pix/f/wmv-64.png index 979ea3054cb..f03af8c10b8 100644 Binary files a/pix/f/wmv-64.png and b/pix/f/wmv-64.png differ diff --git a/pix/f/wmv-72.png b/pix/f/wmv-72.png index 6f6930bf022..a43442670e3 100644 Binary files a/pix/f/wmv-72.png and b/pix/f/wmv-72.png differ diff --git a/pix/f/wmv-80.png b/pix/f/wmv-80.png index a91cad43f87..ceedf818b18 100644 Binary files a/pix/f/wmv-80.png and b/pix/f/wmv-80.png differ diff --git a/pix/f/wmv-96.png b/pix/f/wmv-96.png index 73e796a4e27..6d92ec8bf72 100644 Binary files a/pix/f/wmv-96.png and b/pix/f/wmv-96.png differ diff --git a/pix/f/writer-128.png b/pix/f/writer-128.png new file mode 100644 index 00000000000..ba4c6ee533d Binary files /dev/null and b/pix/f/writer-128.png differ diff --git a/pix/f/writer-24.png b/pix/f/writer-24.png new file mode 100644 index 00000000000..1f1dd47d311 Binary files /dev/null and b/pix/f/writer-24.png differ diff --git a/pix/f/writer-32.png b/pix/f/writer-32.png new file mode 100644 index 00000000000..873eebac8cb Binary files /dev/null and b/pix/f/writer-32.png differ diff --git a/pix/f/writer-48.png b/pix/f/writer-48.png new file mode 100644 index 00000000000..bab44917aca Binary files /dev/null and b/pix/f/writer-48.png differ diff --git a/pix/f/writer-64.png b/pix/f/writer-64.png new file mode 100644 index 00000000000..248d5cb122b Binary files /dev/null and b/pix/f/writer-64.png differ diff --git a/pix/f/writer-72.png b/pix/f/writer-72.png new file mode 100644 index 00000000000..3fd1a09d0c8 Binary files /dev/null and b/pix/f/writer-72.png differ diff --git a/pix/f/writer-80.png b/pix/f/writer-80.png new file mode 100644 index 00000000000..a0e823ad646 Binary files /dev/null and b/pix/f/writer-80.png differ diff --git a/pix/f/writer-96.png b/pix/f/writer-96.png new file mode 100644 index 00000000000..e61ad984092 Binary files /dev/null and b/pix/f/writer-96.png differ diff --git a/pix/f/xlsx-128.png b/pix/f/xlsx-128.png deleted file mode 100644 index 15c9fe5daf8..00000000000 Binary files a/pix/f/xlsx-128.png and /dev/null differ diff --git a/pix/f/xlsx-24.png b/pix/f/xlsx-24.png deleted file mode 100644 index 66717cee403..00000000000 Binary files a/pix/f/xlsx-24.png and /dev/null differ diff --git a/pix/f/xlsx-256.png b/pix/f/xlsx-256.png deleted file mode 100644 index afe3480ceff..00000000000 Binary files a/pix/f/xlsx-256.png and /dev/null differ diff --git a/pix/f/xlsx-32.png b/pix/f/xlsx-32.png deleted file mode 100644 index c695c823de0..00000000000 Binary files a/pix/f/xlsx-32.png and /dev/null differ diff --git a/pix/f/xlsx-48.png b/pix/f/xlsx-48.png deleted file mode 100644 index c635b14342b..00000000000 Binary files a/pix/f/xlsx-48.png and /dev/null differ diff --git a/pix/f/xlsx-64.png b/pix/f/xlsx-64.png deleted file mode 100644 index 5a2c86b1bfc..00000000000 Binary files a/pix/f/xlsx-64.png and /dev/null differ diff --git a/pix/f/xlsx-72.png b/pix/f/xlsx-72.png deleted file mode 100644 index 93c4b491677..00000000000 Binary files a/pix/f/xlsx-72.png and /dev/null differ diff --git a/pix/f/xlsx-80.png b/pix/f/xlsx-80.png deleted file mode 100644 index 03992ca957c..00000000000 Binary files a/pix/f/xlsx-80.png and /dev/null differ diff --git a/pix/f/xlsx-96.png b/pix/f/xlsx-96.png deleted file mode 100644 index ec2250f07bf..00000000000 Binary files a/pix/f/xlsx-96.png and /dev/null differ diff --git a/pix/f/xlsx.png b/pix/f/xlsx.png deleted file mode 100644 index aad1651335e..00000000000 Binary files a/pix/f/xlsx.png and /dev/null differ diff --git a/pix/f/xml-128.png b/pix/f/xml-128.png deleted file mode 100644 index 22a5b89cf3a..00000000000 Binary files a/pix/f/xml-128.png and /dev/null differ diff --git a/pix/f/xml-24.png b/pix/f/xml-24.png deleted file mode 100644 index 6aec93bd755..00000000000 Binary files a/pix/f/xml-24.png and /dev/null differ diff --git a/pix/f/xml-256.png b/pix/f/xml-256.png deleted file mode 100644 index 256e2807adb..00000000000 Binary files a/pix/f/xml-256.png and /dev/null differ diff --git a/pix/f/xml-32.png b/pix/f/xml-32.png deleted file mode 100644 index db4fc05d268..00000000000 Binary files a/pix/f/xml-32.png and /dev/null differ diff --git a/pix/f/xml-48.png b/pix/f/xml-48.png deleted file mode 100644 index addb15e1ccd..00000000000 Binary files a/pix/f/xml-48.png and /dev/null differ diff --git a/pix/f/xml-64.png b/pix/f/xml-64.png deleted file mode 100644 index 7e0d1ceb158..00000000000 Binary files a/pix/f/xml-64.png and /dev/null differ diff --git a/pix/f/xml-72.png b/pix/f/xml-72.png deleted file mode 100644 index 581586eb9a1..00000000000 Binary files a/pix/f/xml-72.png and /dev/null differ diff --git a/pix/f/xml-80.png b/pix/f/xml-80.png deleted file mode 100644 index 41cde23eab4..00000000000 Binary files a/pix/f/xml-80.png and /dev/null differ diff --git a/pix/f/xml-96.png b/pix/f/xml-96.png deleted file mode 100644 index 13e0c7994ab..00000000000 Binary files a/pix/f/xml-96.png and /dev/null differ diff --git a/pix/f/xml.png b/pix/f/xml.png deleted file mode 100644 index 6b6035a28a8..00000000000 Binary files a/pix/f/xml.png and /dev/null differ diff --git a/pix/f/zip-128.png b/pix/f/zip-128.png deleted file mode 100644 index f20f96b75de..00000000000 Binary files a/pix/f/zip-128.png and /dev/null differ diff --git a/pix/f/zip-24.png b/pix/f/zip-24.png deleted file mode 100644 index 8f2f281ab0b..00000000000 Binary files a/pix/f/zip-24.png and /dev/null differ diff --git a/pix/f/zip-256.png b/pix/f/zip-256.png deleted file mode 100644 index 3cbcd767d34..00000000000 Binary files a/pix/f/zip-256.png and /dev/null differ diff --git a/pix/f/zip-32.png b/pix/f/zip-32.png deleted file mode 100644 index c1cd406b6b0..00000000000 Binary files a/pix/f/zip-32.png and /dev/null differ diff --git a/pix/f/zip-48.png b/pix/f/zip-48.png deleted file mode 100644 index 8f1edbbf867..00000000000 Binary files a/pix/f/zip-48.png and /dev/null differ diff --git a/pix/f/zip-64.png b/pix/f/zip-64.png deleted file mode 100644 index 5f539e04140..00000000000 Binary files a/pix/f/zip-64.png and /dev/null differ diff --git a/pix/f/zip-72.png b/pix/f/zip-72.png deleted file mode 100644 index 229d7ca9a9b..00000000000 Binary files a/pix/f/zip-72.png and /dev/null differ diff --git a/pix/f/zip-80.png b/pix/f/zip-80.png deleted file mode 100644 index 012919aa5a2..00000000000 Binary files a/pix/f/zip-80.png and /dev/null differ diff --git a/pix/f/zip-96.png b/pix/f/zip-96.png deleted file mode 100644 index f72ac98b6fd..00000000000 Binary files a/pix/f/zip-96.png and /dev/null differ diff --git a/pix/f/zip.png b/pix/f/zip.png deleted file mode 100644 index 9ef40b00341..00000000000 Binary files a/pix/f/zip.png and /dev/null differ diff --git a/portfolio/boxnet/lib.php b/portfolio/boxnet/lib.php index 99c42ba940a..120f61e8030 100644 --- a/portfolio/boxnet/lib.php +++ b/portfolio/boxnet/lib.php @@ -106,7 +106,7 @@ class portfolio_plugin_boxnet extends portfolio_plugin_push_base { } } - public function admin_config_form(&$mform) { + public static function admin_config_form(&$mform) { global $CFG; $mform->addElement('text', 'apikey', get_string('apikey', 'portfolio_boxnet')); diff --git a/portfolio/flickr/lib.php b/portfolio/flickr/lib.php index fe63d9dbb17..2815a0f55c1 100644 --- a/portfolio/flickr/lib.php +++ b/portfolio/flickr/lib.php @@ -96,7 +96,7 @@ class portfolio_plugin_flickr extends portfolio_plugin_push_base { return true; } - public function admin_config_form(&$mform) { + public static function admin_config_form(&$mform) { global $CFG; $strrequired = get_string('required'); diff --git a/portfolio/googledocs/db/upgrade.php b/portfolio/googledocs/db/upgrade.php index dfdc1dca43a..01420b524ca 100644 --- a/portfolio/googledocs/db/upgrade.php +++ b/portfolio/googledocs/db/upgrade.php @@ -49,6 +49,8 @@ function portfolio_googledocs_admin_upgrade_notification() { return; } $mainadmin = reset($admins); + $a = new stdClass; + $a->docsurl = get_docs_url('Google_OAuth_2.0_setup'); foreach ($admins as $admin) { $message = new stdClass(); @@ -58,8 +60,8 @@ function portfolio_googledocs_admin_upgrade_notification() { $message->userto = $admin; $message->smallmessage = get_string('oauth2upgrade_message_small', 'portfolio_googledocs'); $message->subject = get_string('oauth2upgrade_message_subject', 'portfolio_googledocs'); - $message->fullmessage = get_string('oauth2upgrade_message_content', 'portfolio_googledocs'); - $message->fullmessagehtml = get_string('oauth2upgrade_message_content', 'portfolio_googledocs'); + $message->fullmessage = get_string('oauth2upgrade_message_content', 'portfolio_googledocs', $a); + $message->fullmessagehtml = get_string('oauth2upgrade_message_content', 'portfolio_googledocs', $a); $message->fullmessageformat = FORMAT_PLAIN; $message->notification = 1; message_send($message); diff --git a/portfolio/googledocs/lang/en/portfolio_googledocs.php b/portfolio/googledocs/lang/en/portfolio_googledocs.php index c52bba14df5..504e3cc81e9 100644 --- a/portfolio/googledocs/lang/en/portfolio_googledocs.php +++ b/portfolio/googledocs/lang/en/portfolio_googledocs.php @@ -27,10 +27,10 @@ $string['noauthtoken'] = 'An authentication token has not been recieved from goo $string['nooauthcredentials'] = 'OAuth credentials required.'; $string['nooauthcredentials_help'] = 'To use the Google Docs portfolio plugin you must configure OAuth credentials in the portfolio settings.'; $string['nosessiontoken'] = 'A session token does not exist preventing export to google.'; -$string['oauthinfo'] = '

          To use the google docs portfolio you must be registered with Google. Instructions for registing your installation with Google are described in Moodle Docs. The redirect url should be set to:

          {$a->callbackurl}

          '; +$string['oauthinfo'] = '

          To use this plugin, you must register your site with Google, as described in the documentation Google OAuth 2.0 setup.

          As part of the registration process, you will need to enter the following URL as \'Authorized Redirect URIs\':

          {$a->callbackurl}

          Once registered, you will be provided with a client ID and secret which can be used to configure all Google Docs and Picasa plugins.

          '; $string['oauth2upgrade_message_subject'] = 'Important information regarding Google Docs portfolio plugin'; -$string['oauth2upgrade_message_content'] = 'As part of the upgrade to Moodle 2.3, the Google Docs portfolio plugin has been disabled due to changes in Googles API. To re-enable your plugin, you must configure oauth credentials in this plugin.'; -$string['oauth2upgrade_message_small'] = 'The Google Docs portfolio plugin has been disabled until configured with OAuth2'; +$string['oauth2upgrade_message_content'] = 'As part of the upgrade to Moodle 2.3, the Google Docs portfolio plugin has been disabled. To re-enable it, your Moodle site needs to be registered with Google, as described in the documentation {$a->docsurl}, in order to obtain a client ID and secret. The client ID and secret can then be used to configure all Google Docs and Picasa plugins.'; +$string['oauth2upgrade_message_small'] = 'This plugin has been disabled, as it requires configuration as described in the documentation Google OAuth 2.0 setup.'; $string['pluginname'] = 'Google Docs'; $string['sendfailed'] = 'The file {$a} failed to transfer to google'; $string['secret'] = 'Secret'; diff --git a/portfolio/googledocs/lib.php b/portfolio/googledocs/lib.php index 02ce15910ef..0405ba5b79f 100644 --- a/portfolio/googledocs/lib.php +++ b/portfolio/googledocs/lib.php @@ -100,9 +100,9 @@ class portfolio_plugin_googledocs extends portfolio_plugin_push_base { return array('clientid', 'secret'); } - public function admin_config_form(&$mform) { + public static function admin_config_form(&$mform) { $a = new stdClass; - $a->docsurl = get_docs_url('Google_OAuth2_Setup'); + $a->docsurl = get_docs_url('Google_OAuth_2.0_setup'); $a->callbackurl = google_oauth::callback_url()->out(false); $mform->addElement('static', null, '', get_string('oauthinfo', 'portfolio_googledocs', $a)); diff --git a/portfolio/mahara/lib.php b/portfolio/mahara/lib.php index beb43b1a37a..77c40d6f31a 100644 --- a/portfolio/mahara/lib.php +++ b/portfolio/mahara/lib.php @@ -84,7 +84,7 @@ class portfolio_plugin_mahara extends portfolio_plugin_pull_base { return true; } - public function admin_config_form(&$mform) { + public static function admin_config_form(&$mform) { $strrequired = get_string('required'); $hosts = self::get_mnet_hosts(); // this is called by sanity check but it's ok because it's cached foreach ($hosts as $host) { diff --git a/portfolio/picasa/db/upgrade.php b/portfolio/picasa/db/upgrade.php index e5d1cca6d1d..38df9d5b498 100644 --- a/portfolio/picasa/db/upgrade.php +++ b/portfolio/picasa/db/upgrade.php @@ -49,6 +49,8 @@ function portfolio_picasa_admin_upgrade_notification() { return; } $mainadmin = reset($admins); + $a = new stdClass; + $a->docsurl = get_docs_url('Google_OAuth_2.0_setup'); foreach ($admins as $admin) { $message = new stdClass(); @@ -58,8 +60,8 @@ function portfolio_picasa_admin_upgrade_notification() { $message->userto = $admin; $message->smallmessage = get_string('oauth2upgrade_message_small', 'portfolio_picasa'); $message->subject = get_string('oauth2upgrade_message_subject', 'portfolio_picasa'); - $message->fullmessage = get_string('oauth2upgrade_message_content', 'portfolio_picasa'); - $message->fullmessagehtml = get_string('oauth2upgrade_message_content', 'portfolio_picasa'); + $message->fullmessage = get_string('oauth2upgrade_message_content', 'portfolio_picasa', $a); + $message->fullmessagehtml = get_string('oauth2upgrade_message_content', 'portfolio_picasa', $a); $message->fullmessageformat = FORMAT_PLAIN; $message->notification = 1; message_send($message); diff --git a/portfolio/picasa/lang/en/portfolio_picasa.php b/portfolio/picasa/lang/en/portfolio_picasa.php index 93781b6df96..b0f2252ef5e 100644 --- a/portfolio/picasa/lang/en/portfolio_picasa.php +++ b/portfolio/picasa/lang/en/portfolio_picasa.php @@ -26,10 +26,10 @@ $string['clientid'] = 'Client ID'; $string['noauthtoken'] = 'An authentication token has not been recieved from google. Please ensure you are allowing moodle to access your google account'; $string['nooauthcredentials'] = 'OAuth credentials required.'; $string['nooauthcredentials_help'] = 'To use the Picasa portfolio plugin you must configure OAuth credentials in the portfolio settings.'; -$string['oauthinfo'] = '

          To use the Picasa portfolio you must be registered with Google. Instructions for registing your installation with Google are described in Moodle Docs. The redirect url should be set to:

          {$a->callbackurl}

          '; +$string['oauthinfo'] = '

          To use this plugin, you must register your site with Google, as described in the documentation Google OAuth 2.0 setup.

          As part of the registration process, you will need to enter the following URL as \'Authorized Redirect URIs\':

          {$a->callbackurl}

          Once registered, you will be provided with a client ID and secret which can be used to configure all Google Docs and Picasa plugins.

          '; $string['oauth2upgrade_message_subject'] = 'Important information regarding Picasa portfolio plugin'; -$string['oauth2upgrade_message_content'] = 'As part of the upgrade to Moodle 2.3, the Picasa portfolio plugin has been disabled due to changes in Googles API. To re-enable your plugin, you must configure oauth credentials in this plugin.'; -$string['oauth2upgrade_message_small'] = 'The Picasa portfolio plugin has been disabled until configured with OAuth2'; +$string['oauth2upgrade_message_content'] = 'As part of the upgrade to Moodle 2.3, the Picasa portfolio plugin has been disabled. To re-enable it, your Moodle site needs to be registered with Google, as described in the documentation {$a->docsurl}, in order to obtain a client ID and secret. The client ID and secret can then be used to configure all Google Docs and Picasa plugins.'; +$string['oauth2upgrade_message_small'] = 'This plugin has been disabled, as it requires configuration as described in the documentation Google OAuth 2.0 setup.'; $string['pluginname'] = 'Picasa'; $string['sendfailed'] = 'The file {$a} failed to transfer to picasa'; $string['secret'] = 'Secret'; diff --git a/portfolio/picasa/lib.php b/portfolio/picasa/lib.php index 70200c13af8..cbef42c2a8f 100644 --- a/portfolio/picasa/lib.php +++ b/portfolio/picasa/lib.php @@ -100,9 +100,9 @@ class portfolio_plugin_picasa extends portfolio_plugin_push_base { return array('clientid', 'secret'); } - public function admin_config_form(&$mform) { + public static function admin_config_form(&$mform) { $a = new stdClass; - $a->docsurl = get_docs_url('Google_OAuth2_Setup'); + $a->docsurl = get_docs_url('Google_OAuth_2.0_setup'); $a->callbackurl = google_oauth::callback_url()->out(false); $mform->addElement('static', null, '', get_string('oauthinfo', 'portfolio_picasa', $a)); diff --git a/portfolio/upgrade.txt b/portfolio/upgrade.txt new file mode 100644 index 00000000000..efc88ea345e --- /dev/null +++ b/portfolio/upgrade.txt @@ -0,0 +1,9 @@ +This files describes API changes in /portfolio/ portfolio system, +information provided here is intended especially for developers. + +=== 2.3 === + +required changes: +* The following methods must now be declared static for php5 compatibility: + - admin_config_form + - admin_config_validation diff --git a/repository/boxnet/lib.php b/repository/boxnet/lib.php index 6578afe4c41..a60b1f4b5f9 100644 --- a/repository/boxnet/lib.php +++ b/repository/boxnet/lib.php @@ -136,7 +136,7 @@ class repository_boxnet extends repository { $list[] = array('title'=>$v, 'size'=>$filesizes[$n], 'date'=>$filedates[$n], - 'source'=>'http://box.net/api/1.0/download/' + 'source'=>'https://www.box.com/api/1.0/download/' .$this->auth_token.'/'.$fileids[$n], 'thumbnail' => $OUTPUT->pix_url(file_extension_icon($v, 90))->out(false)); } @@ -158,7 +158,7 @@ class repository_boxnet extends repository { $ret = array(); $ret['list'] = array(); $tree = $this->boxclient->getfiletree($path); - $ret['manage'] = 'http://www.box.net/files'; + $ret['manage'] = 'http://www.box.com/files'; $ret['path'] = array(array('name'=>'Root', 'path'=>0)); if(!empty($tree)) { $ret['list'] = array_filter($tree, array($this, 'filter')); @@ -176,7 +176,7 @@ class repository_boxnet extends repository { if ($this->options['ajax']) { $popup_btn = new stdClass(); $popup_btn->type = 'popup'; - $popup_btn->url = ' https://www.box.net/api/1.0/auth/' . $t['ticket']; + $popup_btn->url = ' https://www.box.com/api/1.0/auth/' . $t['ticket']; $ret = array(); $ret['login'] = array($popup_btn); @@ -319,7 +319,7 @@ class repository_boxnet extends repository { $fileid = array_pop($array); $fileinfo = $this->boxclient->get_file_info($fileid); if (!empty($fileinfo)) { - return 'Box:' . (string)$fileinfo->file_name; + return 'Box: ' . (string)$fileinfo->file_name; } else { return $url; } diff --git a/repository/coursefiles/lib.php b/repository/coursefiles/lib.php index ea62bf7f40f..3f2787d1b8e 100644 --- a/repository/coursefiles/lib.php +++ b/repository/coursefiles/lib.php @@ -122,8 +122,12 @@ class repository_coursefiles extends repository { 'datemodified' => $child->get_timemodified(), 'datecreated' => $child->get_timecreated(), 'source'=> $encodedpath, + 'isref' => $child->is_external_file(), 'thumbnail' => $OUTPUT->pix_url(file_file_icon($child, 90))->out(false) ); + if ($child->get_status() == 666) { + $node['originalmissing'] = true; + } if ($imageinfo = $child->get_imageinfo()) { $fileurl = new moodle_url($child->get_url()); $node['realthumbnail'] = $fileurl->out(false, array('preview' => 'thumb', 'oid' => $child->get_timemodified())); diff --git a/repository/dropbox/lib.php b/repository/dropbox/lib.php index 7a12bb9e25e..186e63b59c1 100644 --- a/repository/dropbox/lib.php +++ b/repository/dropbox/lib.php @@ -432,7 +432,7 @@ class repository_dropbox extends repository { * @return string|null */ public function get_file_source_info($filepath) { - return 'Dropbox:' . $filepath; + return 'Dropbox: ' . $filepath; } /** diff --git a/repository/equella/callback.php b/repository/equella/callback.php index 0a5b08346dd..01fc27dc7f3 100644 --- a/repository/equella/callback.php +++ b/repository/equella/callback.php @@ -55,6 +55,8 @@ if (isset($info->license)) { $license = s(clean_param($info->license, PARAM_ALPHAEXT)); } +$source = base64_encode(serialize((object)array('url'=>$url,'filename'=>$filename))); + $js =<< @@ -63,7 +65,7 @@ $js =<<reference); - $url = $this->appendtoken($ref); + $ref = unserialize(base64_decode($reference->reference)); + $url = $this->appendtoken($ref->url); if (!$url) { // Occurs when the user isn't known.. @@ -188,8 +188,8 @@ class repository_equella extends repository { * @param array $options additional options affecting the file serving */ public function send_file($stored_file, $lifetime=86400 , $filter=0, $forcedownload=false, array $options = null) { - $reference = base64_decode($stored_file->get_reference()); - $url = $this->appendtoken($reference); + $reference = unserialize(base64_decode($stored_file->get_reference())); + $url = $this->appendtoken($reference->url); if ($url) { header('Location: ' . $url); } else { @@ -337,4 +337,32 @@ class repository_equella extends repository { private static function to_mime_type($value) { return mimeinfo('type', $value); } + + /** + * Return the source information + * + * @param stdClass $url + * @return string|null + */ + public function get_file_source_info($url) { + $ref = unserialize(base64_decode($url)); + return 'EQUELLA: ' . $ref->filename; + } + + /** + * Return human readable reference information + * {@link stored_file::get_reference()} + * + * @param string $reference + * @param int $filestatus status of the file, 0 - ok, 666 - source missing + * @return string + */ + public function get_reference_details($reference, $filestatus = 0) { + if (!$filestatus) { + $ref = unserialize(base64_decode($reference)); + return $this->get_name(). ': '. $ref->filename; + } else { + return get_string('lostsource', 'repository', ''); + } + } } diff --git a/repository/filepicker.js b/repository/filepicker.js index f5ec4a6501f..93e44904346 100644 --- a/repository/filepicker.js +++ b/repository/filepicker.js @@ -518,7 +518,7 @@ M.core_filepicker.init = function(Y, options) { Y.extend(FilePickerHelper, Y.Base, { api: M.cfg.wwwroot+'/repository/repository_ajax.php', cached_responses: {}, - + waitinterval : null, // When the loading template is being displayed and its animation is running this will be an interval instance. initializer: function(options) { this.options = options; if (!this.options.savepath) { @@ -885,6 +885,22 @@ M.core_filepicker.init = function(Y, options) { } }, false); }, + classnamecallback : function(node) { + var classname = ''; + if (node.children) { + classname = classname + ' fp-folder'; + } + if (node.isref) { + classname = classname + ' fp-isreference'; + } + if (node.refcount) { + classname = classname + ' fp-hasreferences'; + } + if (node.originalmissing) { + classname = classname + ' fp-originalmissing'; + } + return Y.Lang.trim(classname); + }, /** displays list of files in tree (list) view mode. If param appenditems is specified, * appends those items to the end of the list. Otherwise (default behaviour) * clears the contents and displays the items from this.filelist */ @@ -920,9 +936,7 @@ M.core_filepicker.init = function(Y, options) { this.content_scrolled(); } }, - classnamecallback : function(node) { - return node.children ? 'fp-folder' : ''; - }, + classnamecallback : this.classnamecallback, dynload : this.active_repo.dynload, filepath : this.filepath, treeview_dynload : this.treeview_dynload @@ -961,9 +975,7 @@ M.core_filepicker.init = function(Y, options) { this.select_file(node); } }, - classnamecallback : function(node) { - return node.children ? 'fp-folder' : ''; - } + classnamecallback : this.classnamecallback }; this.fpnode.one('.fp-content').fp_display_filelist(options, list, this.lazyloading); }, @@ -998,9 +1010,7 @@ M.core_filepicker.init = function(Y, options) { this.select_file(node); } }, - classnamecallback : function(node) { - return node.children ? 'fp-folder' : ''; - } + classnamecallback : this.classnamecallback }; this.fpnode.one('.fp-content').fp_display_filelist(options, list, this.lazyloading); }, @@ -1188,7 +1198,37 @@ M.core_filepicker.init = function(Y, options) { }, this); }, wait: function() { - this.fpnode.one('.fp-content').setContent(M.core_filepicker.templates.loading); + // First check there isn't already an interval in play, and if there is kill it now. + if (this.waitinterval != null) { + clearInterval(this.waitinterval); + } + // Prepare the root node we will set content for and the loading template we want to display as a YUI node. + var root = this.fpnode.one('.fp-content'); + var content = Y.Node.create(M.core_filepicker.templates.loading).addClass('fp-content-hidden').setStyle('opacity', 0); + var count = 0; + // Initiate an interval, we will have a count which will increment every 100 milliseconds. + // Count 0 - the loading icon will have visibility set to hidden (invisible) and have an opacity of 0 (invisible also) + // Count 5 - the visiblity will be switched to visible but opacity will still be at 0 (inivisible) + // Counts 6 - 15 opacity will be increased by 0.1 making the loading icon visible over the period of a second + // Count 16 - The interval will be cancelled. + var interval = setInterval(function(){ + if (!content || !root.contains(content) || count >= 15) { + clearInterval(interval); + return true; + } + if (count == 5) { + content.removeClass('fp-content-hidden'); + } else if (count > 5) { + var opacity = parseFloat(content.getStyle('opacity')); + content.setStyle('opacity', opacity + 0.1); + } + count++; + return false; + }, 100); + // Store the wait interval so that we can check it in the future. + this.waitinterval = interval; + // Set the content to the loading template. + root.setContent(content); }, viewbar_set_enabled: function(mode) { var viewbar = this.fpnode.one('.fp-viewbar') @@ -1741,6 +1781,14 @@ M.core_filepicker.init = function(Y, options) { if (obj.repo_id == scope.active_repo.id && obj.form) { // if we did not jump to another repository meanwhile searchform.setContent(obj.form); + // Highlight search text when user click for search. + var searchnode = searchform.one('input[name="s"]'); + if (searchnode) { + searchnode.once('click', function(e) { + e.preventDefault(); + this.select(); + }); + } } } }, false); diff --git a/repository/filepicker.php b/repository/filepicker.php index ebd9c9f93d5..20b67ca72c5 100644 --- a/repository/filepicker.php +++ b/repository/filepicker.php @@ -306,7 +306,8 @@ case 'download': $record->userid = $USER->id; $record->contextid = $user_context->id; - $record->source = serialize((object)array('source' => $thefile['url'])); + $sourcefield = $repo->get_file_source_info($thefile['url']); + $record->source = repository::build_source_field($sourcefield); try { $info = repository::move_to_filepool($thefile['path'], $record); redirect($home_url, get_string('downloadsucc', 'repository')); diff --git a/repository/googledocs/db/upgrade.php b/repository/googledocs/db/upgrade.php index 893ed39dced..80a77a6b04b 100644 --- a/repository/googledocs/db/upgrade.php +++ b/repository/googledocs/db/upgrade.php @@ -53,6 +53,8 @@ function repository_googledocs_admin_upgrade_notification() { } $mainadmin = reset($admins); + $a = new stdClass; + $a->docsurl = get_docs_url('Google_OAuth_2.0_setup'); foreach ($admins as $admin) { $message = new stdClass(); $message->component = 'moodle'; @@ -61,8 +63,8 @@ function repository_googledocs_admin_upgrade_notification() { $message->userto = $admin; $message->smallmessage = get_string('oauth2upgrade_message_small', 'repository_googledocs'); $message->subject = get_string('oauth2upgrade_message_subject', 'repository_googledocs'); - $message->fullmessage = get_string('oauth2upgrade_message_content', 'repository_googledocs'); - $message->fullmessagehtml = get_string('oauth2upgrade_message_content', 'repository_googledocs'); + $message->fullmessage = get_string('oauth2upgrade_message_content', 'repository_googledocs', $a); + $message->fullmessagehtml = get_string('oauth2upgrade_message_content', 'repository_googledocs', $a); $message->fullmessageformat = FORMAT_PLAIN; $message->notification = 1; message_send($message); diff --git a/repository/googledocs/lang/en/repository_googledocs.php b/repository/googledocs/lang/en/repository_googledocs.php index 4f7faa7b324..82fbc71dade 100644 --- a/repository/googledocs/lang/en/repository_googledocs.php +++ b/repository/googledocs/lang/en/repository_googledocs.php @@ -25,10 +25,10 @@ $string['clientid'] = 'Client ID'; $string['configplugin'] = 'Configure Google Docs plugin'; $string['googledocs:view'] = 'View google docs repository'; -$string['oauthinfo'] = '

          To use the Google Docs repository you must be registered with Google. Instructions for registing your installation with Google are described in Moodle Docs. The redirect url should be set to:

          {$a->callbackurl}

          '; +$string['oauthinfo'] = '

          To use this plugin, you must register your site with Google, as described in the documentation Google OAuth 2.0 setup.

          As part of the registration process, you will need to enter the following URL as \'Authorized Redirect URIs\':

          {$a->callbackurl}

          Once registered, you will be provided with a client ID and secret which can be used to configure all Google Docs and Picasa plugins.

          '; $string['oauth2upgrade_message_subject'] = 'Important information regarding Google Docs repository plugin'; -$string['oauth2upgrade_message_content'] = 'As part of the upgrade to Moodle 2.3, the Google Docs repository plugin has been disabled due to changes in Googles API. To re-enable your plugin, you must add and reconfigure configure oauth credentials of this plugin.'; -$string['oauth2upgrade_message_small'] = 'The Google Docs repository plugin has been disabled until configured with OAuth2'; +$string['oauth2upgrade_message_content'] = 'As part of the upgrade to Moodle 2.3, the Google Docs portfolio plugin has been disabled. To re-enable it, your Moodle site needs to be registered with Google, as described in the documentation {$a->docsurl}, in order to obtain a client ID and secret. The client ID and secret can then be used to configure all Google Docs and Picasa plugins.'; +$string['oauth2upgrade_message_small'] = 'This plugin has been disabled, as it requires configuration as described in the documentation Google OAuth 2.0 setup.'; $string['pluginname'] = 'Google Docs'; $string['secret'] = 'Secret'; diff --git a/repository/googledocs/lib.php b/repository/googledocs/lib.php index df0f23eb0ff..ee56c02871a 100644 --- a/repository/googledocs/lib.php +++ b/repository/googledocs/lib.php @@ -112,7 +112,7 @@ class repository_googledocs extends repository { public static function type_config_form($mform, $classname = 'repository') { $a = new stdClass; - $a->docsurl = get_docs_url('Google_OAuth2_Setup'); + $a->docsurl = get_docs_url('Google_OAuth_2.0_setup'); $a->callbackurl = google_oauth::callback_url()->out(false); $mform->addElement('static', null, '', get_string('oauthinfo', 'repository_googledocs', $a)); diff --git a/repository/lib.php b/repository/lib.php index db4e45b72b5..62312099d58 100644 --- a/repository/lib.php +++ b/repository/lib.php @@ -1233,6 +1233,9 @@ abstract class repository { * @return string|null */ public function get_file_source_info($url) { + if ($this->has_moodle_files()) { + return $this->get_reference_details($url, 0); + } return $url; } @@ -1446,7 +1449,7 @@ abstract class repository { } $type = repository::get_type_by_id($i->options['typeid']); - $table->data[] = array($i->name, $type->get_readablename(), $settings, $delete); + $table->data[] = array(format_string($i->name), $type->get_readablename(), $settings, $delete); //display a grey row if the type is defined as not visible if (isset($type) && !$type->get_visible()) { @@ -1659,12 +1662,14 @@ abstract class repository { } /** - * Does it return a file url or a item_id + * Tells how the file can be picked from this repository * - * @return string + * Maximum value is FILE_INTERNAL | FILE_EXTERNAL | FILE_REFERENCE + * + * @return int */ public function supported_returntypes() { - return (FILE_INTERNAL | FILE_EXTERNAL | FILE_REFERENCE); + return (FILE_INTERNAL | FILE_EXTERNAL); } /** @@ -1676,7 +1681,7 @@ abstract class repository { global $CFG, $OUTPUT; $meta = new stdClass(); $meta->id = $this->id; - $meta->name = $this->get_name(); + $meta->name = format_string($this->get_name()); $meta->type = $this->options['type']; $meta->icon = $OUTPUT->pix_url('icon', 'repository_'.$meta->type)->out(false); $meta->supported_types = file_get_typegroup('extension', $this->supported_filetypes()); @@ -2096,6 +2101,7 @@ abstract class repository { // it can be empty, then moodle will look for instance name from language string $mform->addElement('text', 'pluginname', get_string('pluginname', 'repository'), array('size' => '40')); $mform->addElement('static', 'pluginnamehelp', '', get_string('pluginnamehelp', 'repository')); + $mform->setType('pluginname', PARAM_TEXT); } } @@ -2386,6 +2392,7 @@ final class repository_instance_form extends moodleform { $mform->addElement('text', 'name', get_string('name'), 'maxlength="100" size="30"'); $mform->addRule('name', $strrequired, 'required', null, 'client'); + $mform->setType('name', PARAM_TEXT); } /** diff --git a/repository/local/lib.php b/repository/local/lib.php index 6b3e0285f29..d8898bfbab2 100644 --- a/repository/local/lib.php +++ b/repository/local/lib.php @@ -230,6 +230,10 @@ class repository_local_file { $node['size'] = $this->fileinfo->get_filesize(); $node['author'] = $this->fileinfo->get_author(); $node['license'] = $this->fileinfo->get_license(); + $node['isref'] = $this->fileinfo->is_external_file(); + if ($this->fileinfo->get_status() == 666) { + $node['originalmissing'] = true; + } $node['source'] = $encodedpath; $node['thumbnail'] = $OUTPUT->pix_url(file_file_icon($this->fileinfo, 90))->out(false); $node['icon'] = $OUTPUT->pix_url(file_file_icon($this->fileinfo, 24))->out(false); diff --git a/repository/picasa/db/upgrade.php b/repository/picasa/db/upgrade.php index 082e5e3433f..1cd2f2a3a92 100644 --- a/repository/picasa/db/upgrade.php +++ b/repository/picasa/db/upgrade.php @@ -52,6 +52,8 @@ function repository_picasa_admin_upgrade_notification() { return; } $mainadmin = reset($admins); + $a = new stdClass; + $a->docsurl = get_docs_url('Google_OAuth_2.0_setup'); foreach ($admins as $admin) { $message = new stdClass(); @@ -61,8 +63,8 @@ function repository_picasa_admin_upgrade_notification() { $message->userto = $admin; $message->smallmessage = get_string('oauth2upgrade_message_small', 'repository_picasa'); $message->subject = get_string('oauth2upgrade_message_subject', 'repository_picasa'); - $message->fullmessage = get_string('oauth2upgrade_message_content', 'repository_picasa'); - $message->fullmessagehtml = get_string('oauth2upgrade_message_content', 'repository_picasa'); + $message->fullmessage = get_string('oauth2upgrade_message_content', 'repository_picasa', $a); + $message->fullmessagehtml = get_string('oauth2upgrade_message_content', 'repository_picasa', $a); $message->fullmessageformat = FORMAT_PLAIN; $message->notification = 1; message_send($message); diff --git a/repository/picasa/lang/en/repository_picasa.php b/repository/picasa/lang/en/repository_picasa.php index 89d75a68079..13a9bc6b63c 100644 --- a/repository/picasa/lang/en/repository_picasa.php +++ b/repository/picasa/lang/en/repository_picasa.php @@ -24,10 +24,10 @@ $string['clientid'] = 'Client ID'; $string['configplugin'] = 'Picasa repository configuration'; -$string['oauthinfo'] = '

          To use the Picasa repository you must be registered with Google. Instructions for registing your installation with Google are described in Moodle Docs. The redirect url should be set to:

          {$a->callbackurl}

          '; +$string['oauthinfo'] = '

          To use this plugin, you must register your site with Google, as described in the documentation Google OAuth 2.0 setup.

          As part of the registration process, you will need to enter the following URL as \'Authorized Redirect URIs\':

          {$a->callbackurl}

          Once registered, you will be provided with a client ID and secret which can be used to configure all Google Docs and Picasa plugins.

          '; $string['oauth2upgrade_message_subject'] = 'Important information regarding Picasa repository plugin'; -$string['oauth2upgrade_message_content'] = 'As part of the upgrade to Moodle 2.3, the Picasa repository plugin has been disabled due to changes in Googles API. To re-enable your plugin, you must add and reconfigure configure oauth credentials of this plugin.'; -$string['oauth2upgrade_message_small'] = 'The Picasa repository plugin has been disabled until configured with OAuth2'; +$string['oauth2upgrade_message_content'] = 'As part of the upgrade to Moodle 2.3, the Picasa portfolio plugin has been disabled. To re-enable it, your Moodle site needs to be registered with Google, as described in the documentation {$a->docsurl}, in order to obtain a client ID and secret. The client ID and secret can then be used to configure all Google Docs and Picasa plugins.'; +$string['oauth2upgrade_message_small'] = 'This plugin has been disabled, as it requires configuration as described in the documentation Google OAuth 2.0 setup.'; $string['picasa:view'] = 'View picasa repository'; $string['pluginname'] = 'Picasa web album'; $string['secret'] = 'Secret'; diff --git a/repository/picasa/lib.php b/repository/picasa/lib.php index 0d0b63c0cfa..7dbdf7b7136 100644 --- a/repository/picasa/lib.php +++ b/repository/picasa/lib.php @@ -114,7 +114,7 @@ class repository_picasa extends repository { public static function type_config_form($mform, $classname = 'repository') { $a = new stdClass; - $a->docsurl = get_docs_url('Google_OAuth2_Setup'); + $a->docsurl = get_docs_url('Google_OAuth_2.0_setup'); $a->callbackurl = google_oauth::callback_url()->out(false); $mform->addElement('static', null, '', get_string('oauthinfo', 'repository_picasa', $a)); diff --git a/repository/repository_ajax.php b/repository/repository_ajax.php index 45f0662c3c7..6919b3e11b2 100644 --- a/repository/repository_ajax.php +++ b/repository/repository_ajax.php @@ -241,6 +241,10 @@ switch ($action) { } } + // {@link repository::build_source_field()} + $sourcefield = $repo->get_file_source_info($source); + $record->source = $repo::build_source_field($sourcefield); + if ($usefilereference) { $reference = $repo->get_file_reference($source); // get reference life time from repo @@ -266,10 +270,6 @@ switch ($action) { $event['existingfile']->url = moodle_url::make_draftfile_url($itemid, $saveas_path, $saveas_filename)->out();; } else { - // {@link repository::build_source_field()} - $sourcefield = $repo->get_file_source_info($source); - $record->source = $repo::build_source_field($sourcefield); - $storedfile = $fs->create_file_from_reference($record, $repo_id, $reference); $event = array( 'url'=>moodle_url::make_draftfile_url($storedfile->get_itemid(), $storedfile->get_filepath(), $storedfile->get_filename())->out(), @@ -307,10 +307,6 @@ switch ($action) { throw new file_exception('maxbytes'); } - // {@link repository::build_source_field()} - $sourcefield = $repo->get_file_source_info($source); - $record->source = $repo::build_source_field($sourcefield); - $info = repository::move_to_filepool($downloadedfile['path'], $record); if (empty($info)) { $info['e'] = get_string('error', 'moodle'); diff --git a/repository/s3/lib.php b/repository/s3/lib.php index 55586200c08..c25dfc6b555 100644 --- a/repository/s3/lib.php +++ b/repository/s3/lib.php @@ -126,7 +126,7 @@ class repository_s3 extends repository { * @return string */ public function get_file_source_info($filepath) { - return 'Amazon S3:' . $filepath; + return 'Amazon S3: ' . $filepath; } /** diff --git a/repository/upgrade.txt b/repository/upgrade.txt new file mode 100644 index 00000000000..ac82eee8e97 --- /dev/null +++ b/repository/upgrade.txt @@ -0,0 +1,20 @@ +This files describes API changes in /repository/ repository system, +information provided here is intended especially for developers. Full +details of the repository API are available on Moodle docs: +http://docs.moodle.org/dev/Repository_API + +=== 2.3 === + +* instance_config_form() must now be declared static for php5.4 compatibility. + +* get_listing() and search() file metadata details are now now more prominently + displayed in the interface. Dates and timestamos are now able to be sorted on in + the filepicker interface so plugin authors are asked to ensure: + - Dates are defined as UNIX timestamps + - Filesize is an integer in bytes + +* It is recomended to define function get_file_source_info() to provide more rich + infromation about the source of a file. + +* The API was extended to allow repositories can now support external references, please + see http://docs.moodle.org/dev/Repository_API for further details. diff --git a/repository/upload/lib.php b/repository/upload/lib.php index cf023dd10b4..7420230474c 100644 --- a/repository/upload/lib.php +++ b/repository/upload/lib.php @@ -57,8 +57,9 @@ class repository_upload extends repository { $itemid = optional_param('itemid', 0, PARAM_INT); $license = optional_param('license', $CFG->sitedefaultlicense, PARAM_TEXT); $author = optional_param('author', '', PARAM_TEXT); + $overwriteexisting = optional_param('overwrite', false, PARAM_BOOL); - return $this->process_upload($saveas_filename, $maxbytes, $types, $savepath, $itemid, $license, $author); + return $this->process_upload($saveas_filename, $maxbytes, $types, $savepath, $itemid, $license, $author, $overwriteexisting); } /** @@ -70,9 +71,10 @@ class repository_upload extends repository { * @param int $itemid optional the ID for this item within the file area * @param string $license optional the license to use for this file * @param string $author optional the name of the author of this file + * @param bool $overwriteexisting optional user has asked to overwrite the existing file * @return object containing details of the file uploaded */ - public function process_upload($saveas_filename, $maxbytes, $types = '*', $savepath = '/', $itemid = 0, $license = null, $author = '') { + public function process_upload($saveas_filename, $maxbytes, $types = '*', $savepath = '/', $itemid = 0, $license = null, $author = '', $overwriteexisting = false) { global $USER, $CFG; if ((is_array($types) and in_array('*', $types)) or $types == '*') { @@ -144,7 +146,8 @@ class repository_upload extends repository { @chmod($_FILES[$elname]['tmp_name'], $permissions); // {@link repository::build_source_field()} - $record->source = self::build_source_field($_FILES[$elname]['name']); + $sourcefield = $this->get_file_source_info($_FILES[$elname]['name']); + $record->source = self::build_source_field($sourcefield); if (empty($saveas_filename)) { $record->filename = clean_param($_FILES[$elname]['name'], PARAM_FILE); @@ -191,32 +194,37 @@ class repository_upload extends repository { $record->userid = $USER->id; if (repository::draftfile_exists($record->itemid, $record->filepath, $record->filename)) { - $existingfilename = $record->filename; - $unused_filename = repository::get_unused_filename($record->itemid, $record->filepath, $record->filename); - $record->filename = $unused_filename; - $stored_file = $fs->create_file_from_pathname($record, $_FILES[$elname]['tmp_name']); - $event = array(); - $event['event'] = 'fileexists'; - $event['newfile'] = new stdClass; - $event['newfile']->filepath = $record->filepath; - $event['newfile']->filename = $unused_filename; - $event['newfile']->url = moodle_url::make_draftfile_url($record->itemid, $record->filepath, $unused_filename)->out(false); + if ($overwriteexisting) { + repository::delete_tempfile_from_draft($record->itemid, $record->filepath, $record->filename); + } else { + $existingfilename = $record->filename; + $unused_filename = repository::get_unused_filename($record->itemid, $record->filepath, $record->filename); + $record->filename = $unused_filename; + $stored_file = $fs->create_file_from_pathname($record, $_FILES[$elname]['tmp_name']); + $event = array(); + $event['event'] = 'fileexists'; + $event['newfile'] = new stdClass; + $event['newfile']->filepath = $record->filepath; + $event['newfile']->filename = $unused_filename; + $event['newfile']->url = moodle_url::make_draftfile_url($record->itemid, $record->filepath, $unused_filename)->out(false); - $event['existingfile'] = new stdClass; - $event['existingfile']->filepath = $record->filepath; - $event['existingfile']->filename = $existingfilename; - $event['existingfile']->url = moodle_url::make_draftfile_url($record->itemid, $record->filepath, $existingfilename)->out(false); - return $event; - } else { - $stored_file = $fs->create_file_from_pathname($record, $_FILES[$elname]['tmp_name']); - - return array( - 'url'=>moodle_url::make_draftfile_url($record->itemid, $record->filepath, $record->filename)->out(false), - 'id'=>$record->itemid, - 'file'=>$record->filename); + $event['existingfile'] = new stdClass; + $event['existingfile']->filepath = $record->filepath; + $event['existingfile']->filename = $existingfilename; + $event['existingfile']->url = moodle_url::make_draftfile_url($record->itemid, $record->filepath, $existingfilename)->out(false); + return $event; + } } + + $stored_file = $fs->create_file_from_pathname($record, $_FILES[$elname]['tmp_name']); + + return array( + 'url'=>moodle_url::make_draftfile_url($record->itemid, $record->filepath, $record->filename)->out(false), + 'id'=>$record->itemid, + 'file'=>$record->filename); } + /** * Checks the contents of the given file is not completely NULL - this can happen if a * user drags & drops a folder onto a filemanager / filepicker element diff --git a/repository/user/lib.php b/repository/user/lib.php index 241d49dc0cd..98c73845740 100644 --- a/repository/user/lib.php +++ b/repository/user/lib.php @@ -112,10 +112,14 @@ class repository_user extends repository { 'datecreated' => $child->get_timecreated(), 'author' => $child->get_author(), 'license' => $child->get_license(), + 'isref' => $child->is_external_file(), 'source'=> $encodedpath, 'icon' => $OUTPUT->pix_url(file_file_icon($child, 24))->out(false), 'thumbnail' => $OUTPUT->pix_url(file_file_icon($child, 90))->out(false) ); + if ($child->get_status() == 666) { + $node['originalmissing'] = true; + } if ($imageinfo = $child->get_imageinfo()) { $fileurl = new moodle_url($child->get_url()); $node['realthumbnail'] = $fileurl->out(false, array('preview' => 'thumb', 'oid' => $child->get_timemodified())); diff --git a/theme/anomaly/style/dock.css b/theme/anomaly/style/dock.css index 8c7086dac1b..497cf7c81d8 100644 --- a/theme/anomaly/style/dock.css +++ b/theme/anomaly/style/dock.css @@ -60,7 +60,6 @@ body.has_dock { } #dock .dockedtitle.activeitem { background-color: #697F55; - width: 35px; -webkit-border-top-left-radius: 10px; -moz-border-radius-topleft: 10px; border-top-left-radius: 10px; @@ -101,7 +100,7 @@ Docked Item Panel } #dockeditempanel .dockeditempanel_hd { - border-width: 0; + border-color: #eee; background-color: #eee; padding: 2px; } diff --git a/theme/base/pix/fp/alias_sm.png b/theme/base/pix/fp/alias_sm.png new file mode 100644 index 00000000000..80fbfafc50e Binary files /dev/null and b/theme/base/pix/fp/alias_sm.png differ diff --git a/theme/base/pix/fp/link_sm.png b/theme/base/pix/fp/link_sm.png new file mode 100644 index 00000000000..f7160b4f14b Binary files /dev/null and b/theme/base/pix/fp/link_sm.png differ diff --git a/theme/base/style/blocks.css b/theme/base/style/blocks.css index 512f2c06cf8..9fca8f98c9c 100644 --- a/theme/base/style/blocks.css +++ b/theme/base/style/blocks.css @@ -1,6 +1,6 @@ .block {border:1px solid;margin-bottom:1em;} .block .header h2 {margin:4px;} -.block .header .block_action {float:right;margin:0 4px;vertical-align:top;} +.block .header .block_action {float:right;margin:2px 4px 0;vertical-align:top;} .block .header .block_action input {margin-right:2px;} .block .header .commands {margin-left:4px;} .block .header .commands .icon img {width:11px;height:11px;margin-right:1px;} diff --git a/theme/base/style/core.css b/theme/base/style/core.css index 28153ca9439..e1f5f4f9f40 100644 --- a/theme/base/style/core.css +++ b/theme/base/style/core.css @@ -461,6 +461,8 @@ body.tag .managelink {padding: 5px;} .path-backup .backup_progress .backup_stage.backup_stage_current {font-weight:bold;color:inherit;} .path-backup .backup_progress .backup_stage.backup_stage_next {} .path-backup .backup_progress span.backup_stage.backup_stage_complete {color:inherit;} +#page-backup-restore .filealiasesfailures {background-color:#ffd3d9} +#page-backup-restore .filealiasesfailures .aliaseslist {width:90%;margin:0.8em auto;background-color:white;border:1px dotted #666;} /** * Web Service @@ -723,8 +725,8 @@ sup {vertical-align: super;} .dir-rtl .ygtvcancel {background-position: 0 -8822px;} .dir-rtl .ygtvcancel:hover {background-position: 0 -8866px;} -.dir-rtl #yui-gen4.yui-layout-unit-left {left:500px !important;} -.dir-rtl #yui-gen6.yui-layout-unit-center {left:0px !important;} +.dir-rtl .file-picker .yui-layout-unit-left {left:500px !important;} +.dir-rtl .file-picker .yui-layout-unit-center {left:0px !important;} .dir-rtl.yui-skin-sam .yui-panel .hd {text-align:left;} .dir-rtl .yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd {text-align:right;} @@ -805,6 +807,7 @@ sup {vertical-align: super;} #page-admin-setting-enrolsettingsflatfile.dir-rtl .informationbox {direction: ltr;text-align: left;} #page-admin-grade-edit-scale-edit.dir-rtl .error input#id_name {margin-right: 170px;} +.initialbar a {padding-right: 2px;} /** * Chooser Dialogue @@ -819,8 +822,8 @@ sup {vertical-align: super;} } .moodle-dialogue-base .moodle-dialogue { - background-color: transparent!important; - border: 0px solid transparent!important; + background: none!important; + border: 0 none!important; } .chooserdialogue .moodle-dialogue-wrap { @@ -882,7 +885,7 @@ sup {vertical-align: super;} max-height: 550px; overflow-x: hidden; overflow-y: auto; - max-width: 18.5em; + max-width: 20.3em; box-shadow: inset 0px 0px 30px 0px #CCCCCC; -webkit-box-shadow: inset 0px 0px 30px 0px #CCCCCC; -moz-box-shadow: inset 0px 0px 30px 0px #CCCCCC; @@ -902,13 +905,10 @@ sup {vertical-align: super;} padding-bottom: 0.4em; } -.choosercontainer #chooseform .subtype { - margin-bottom: 0; - padding: 0 0 0 1em; -} - .choosercontainer #chooseform .option .typename, -.choosercontainer #chooseform .option span.modicon img.icon { +.choosercontainer #chooseform .option span.modicon img.icon, +.choosercontainer #chooseform .nonoption .typename, +.choosercontainer #chooseform .nonoption span.modicon img.icon { padding: 0 0 0 0.5em; } @@ -924,17 +924,32 @@ sup {vertical-align: super;} border-bottom: 1px solid #FFFFFF; } +.choosercontainer #chooseform .nonoption { + padding-left: 2.7em; + padding-top: 0.3em; + padding-bottom: 0.1em; +} + +.choosercontainer #chooseform .subtype { + margin-bottom: 0; + padding: 0 1.6em 0 3.2em; +} + +.choosercontainer #chooseform .subtype .typename { + margin: 0 0 0 0.2em; +} + /* The instruction/help area */ -.choosercontainer #chooseform .instruction, +.jsenabled .choosercontainer #chooseform .instruction, .jsenabled .choosercontainer #chooseform .typesummary { display: none; position: absolute; top: 0px; right: 0px; bottom: 0px; - left: 18.5em; + left: 20.3em; margin: 0; - padding: 2em 2em 2em 2.4em; + padding: 1.6em; background-color: #FFFFFF; overflow-x: hidden; overflow-y: auto; @@ -942,7 +957,8 @@ sup {vertical-align: super;} line-height: 2em; } -.dir-rtl #choosercontainer #chooseform .instruction, .jsenabled #choosercontainer #chooseform .typesummary { +.dir-rtl.jsenabled .choosercontainer #chooseform .instruction, +.dir-rtl.jsenabled .choosercontainer #chooseform .typesummary { left: 0px; right: 18.5em; border-right: 1px solid grey; @@ -960,5 +976,3 @@ sup {vertical-align: super;} -webkit-box-shadow: 0px 0px 10px 0px #CCCCCC; -moz-box-shadow: 0px 0px 10px 0px #CCCCCC; } - -.initialbar a {padding-right: 2px;} diff --git a/theme/base/style/course.css b/theme/base/style/course.css index 884c402e483..4d3039ed5fb 100644 --- a/theme/base/style/course.css +++ b/theme/base/style/course.css @@ -107,6 +107,9 @@ .course_category_tree .category .courses .course_link {display:block;background-image:url([[pix:moodle|i/course]]);background-repeat: no-repeat;padding-left:18px;} .course_category_tree .category .course {position:relative;} .course_category_tree .category .course_info {position:absolute;right:0;top:0;} +.dir-rtl .course_category_tree .category .course_info { position: static; } +.dir-rtl .course_category_tree .category .course_info a, .dir-rtl .course_category_tree .category .course_info div {float: right;} +.dir-rtl .course_category_tree .controls div {padding: 7px;} .course_category_tree .category .course_info a, .course_category_tree .category .course_info div {float:left;width:16px;height:16px;} .jsenabled .course_category_tree .controls {visibility: visible;} @@ -163,10 +166,8 @@ input.titleeditor { } /* Course drag and drop upload styles */ -#dndupload-status {width:40%;margin:0 30%;padding:6px;border:1px solid #ddd;text-align:center;background:#ffc;position:absolute;z-index:9999;box-shadow:2px 2px 5px 1px #ccc;border-radius:0px 0px 8px 8px;} +#dndupload-status {width:40%;margin:0 30%;padding:6px;border:1px solid #ddd;text-align:center;background:#ffc;position:absolute;z-index:9999;box-shadow:2px 2px 5px 1px #ccc;border-radius:0px 0px 8px 8px;z-index: 0;} .dndupload-preview {color:#909090;border:1px dashed #909090;} .dndupload-progress-outer {width:70px;border:solid black 1px;height:10px;display:inline-block;margin:0;padding:0;overflow:hidden;position:relative;} .dndupload-progress-inner {width:0%;height:100%;background-color:green;display:inline-block;margin:0;padding:0;float:left;} .dndupload-hidden {display:none;} - -.dir-rtl.path-course-view li.activity form.togglecompletion, .dir-rtl.path-course-view li.activity span.autocompletion diff --git a/theme/base/style/filemanager.css b/theme/base/style/filemanager.css index 060485c7593..86d0446a2e8 100644 --- a/theme/base/style/filemanager.css +++ b/theme/base/style/filemanager.css @@ -5,11 +5,12 @@ .filemanager, .file-picker {font-size:11px;color: #555555;letter-spacing: .2px;} .filemanager a, .file-picker a {color:#555555;} .filemanager a:hover, .file-picker a:hover {color:#555555;text-decoration: none;} -.filemanager select, .filemanager input, .filemanagerbutton, .filemanager textarea, +.filemanager select, .filemanager input, .filemanager button, .filemanager textarea, .file-picker select, .file-picker input, .file-picker button, .file-picker textarea {color:#555555; letter-spacing: .2px;} .filemanager input[type="text"], .file-picker input[type="text"] {border: 1px solid #BBBBBB;width: 265px;height: 18px;padding: 1px 6px;} .filemanager select, .file-picker select {height: 22px;padding: 2px 1px;} .fp-content-center {height: 100%;width: 100%;display:table-cell;vertical-align: middle;} +.fp-content-hidden {visibility: hidden;} /* * Dialogue (File Picker and File Manager) @@ -62,7 +63,7 @@ background: #CCCCCC;filter: progid:DXImageTransform.Microsoft.gradient(startColo /* * Tools, Path & View on fp-navbar (File Picker and File Manager) */ -.fp-toolbar {display: table-row;line-height: 22px;float:left;/*display: inline-block;*/} +.fp-toolbar {display: table-row;line-height: 22px;float:left;} .dir-rtl .fp-toolbar {float: right;} @@ -75,7 +76,7 @@ background: #CCCCCC;filter: progid:DXImageTransform.Microsoft.gradient(startColo .fp-toolbar .fp-tb-search {width: 228px;height: 14px;} .fp-toolbar .fp-tb-search input {background:#FFFFFF url('[[pix:a/search]]') no-repeat 3px 3px;padding: 2px 6px 1px 20px;width: 200px;height: 16px;border: 1px solid #BBBBBB;} -.fp-viewbar {float:right;width:69px;height:22px;margin-right:8px;/*display: inline-block;*/} +.fp-viewbar {float:right;width:69px;height:22px;margin-right:8px;} .dir-rtl .fp-toolbar img {vertical-align: -35%;} .dir-rtl .fp-viewbar {float: left;width: 100px;} @@ -104,7 +105,7 @@ background: #CCCCCC;filter: progid:DXImageTransform.Microsoft.gradient(startColo .dir-rtl .fp-vb-tree a:hover {background:none; border:30px solid black} .dir-rtl .fp-vb-tree.checked a:hover {background:none; border:50px solid black} -.file-picker .fp-pathbar {display: table-row;/*display: inline-block;*/} +.file-picker .fp-pathbar {display: table-row;} .fp-pathbar.empty {display: none;} .fp-pathbar .fp-path-folder {background:url('[[pix:theme|fp/path_folder]]') no-repeat 0 0;width:27px;height:12px;margin-left: 4px;} .dir-rtl .fp-pathbar .fp-path-folder {background:url('[[pix:theme|fp/path_folder_rtl]]') no-repeat right top;width:auto;height:12px;margin-left: 4px;} @@ -139,30 +140,30 @@ background: #CCCCCC;filter: progid:DXImageTransform.Microsoft.gradient(startColo /*.file-picker .fp-treeview .fp-folder .fp-icon, .filemanager .fp-treeview .fp-folder .fp-icon {}*/ /* first or middle sibling, no children */ .file-picker .ygtvtn, .filemanager .ygtvtn {background: url('[[pix:moodle|y/tn]]') 0px 0px no-repeat;width:17px;height:22px;} -.dir-rtl .file-picker .ygtvtn, .filemanager .ygtvtn {background: url('[[pix:moodle|y/tn_rtl]]') 0px 0px no-repeat;width:17px;height:22px;} +.dir-rtl .file-picker .ygtvtn {background: url('[[pix:moodle|y/tn_rtl]]') 0px 0px no-repeat;width:17px;height:22px;} /* first or middle sibling, collapsable */ .file-picker .ygtvtm, .filemanager .ygtvtm {background: url('[[pix:moodle|y/tm]]') 0px 10px no-repeat;width:13px;height:12px;cursor:pointer;} /* first or middle sibling, collapsable, hover */ .file-picker .ygtvtmh, .filemanager .ygtvtmh {background: url('[[pix:moodle|y/tm]]') 0px 10px no-repeat;width:13px;height:12px;cursor:pointer;} /* first or middle sibling, expandable */ .file-picker .ygtvtp, .filemanager .ygtvtp {background: url('[[pix:moodle|y/tp]]') 0px 10px no-repeat;width:13px;height:12px;cursor:pointer;} -.dir-rtl .file-picker .ygtvtp, .filemanager .ygtvtp {background: url('[[pix:moodle|y/tp_rtl]]') 0px 10px no-repeat;width:13px;height:12px;cursor:pointer;} +.dir-rtl .file-picker .ygtvtp {background: url('[[pix:moodle|y/tp_rtl]]') 0px 10px no-repeat;width:13px;height:12px;cursor:pointer;} /* first or middle sibling, expandable, hover */ .file-picker .ygtvtph, .filemanager .ygtvtph {background: url('[[pix:moodle|y/tp]]') 0px 10px no-repeat;width:13px;height:22px;cursor:pointer;} -.dir-rtl .file-picker .ygtvtph, .filemanager .ygtvtph {background: url('[[pix:moodle|y/tp_rtl]]') 0px 10px no-repeat;width:13px;height:22px;cursor:pointer;} +.dir-rtl .file-picker .ygtvtph {background: url('[[pix:moodle|y/tp_rtl]]') 0px 10px no-repeat;width:13px;height:22px;cursor:pointer;} /* last sibling, no children */ .file-picker .ygtvln, .filemanager .ygtvln {background: url('[[pix:moodle|y/ln]]') 0px 0px no-repeat;width:17px;height:22px;} -.dir-rtl .file-picker .ygtvln, .filemanager .ygtvln {background: url('[[pix:moodle|y/ln_rtl]]') 0px 0px no-repeat;width:17px;height:22px;} +.dir-rtl .file-picker .ygtvln {background: url('[[pix:moodle|y/ln_rtl]]') 0px 0px no-repeat;width:17px;height:22px;} /* Last sibling, collapsable */ .file-picker .ygtvlm, .filemanager .ygtvlm {background: url('[[pix:moodle|y/lm]]') 0px 10px no-repeat;width:13px;height:12px;cursor:pointer;} /* Last sibling, collapsable, hover */ .file-picker .ygtvlmh, .filemanager .ygtvlmh {background: url('[[pix:moodle|y/lm]]') 0px 10px no-repeat;width:13px;height:12px;cursor:pointer;} /* Last sibling, expandable */ .file-picker .ygtvlp, .filemanager .ygtvlp {background: url('[[pix:moodle|y/lp]]') 0px 10px no-repeat;width:13px;height:12px;cursor:pointer;} -.dir-rtl .file-picker .ygtvlp, .filemanager .ygtvlp {background: url('[[pix:moodle|y/lp_rtl]]') 0px 10px no-repeat;width:13px;height:12px;cursor:pointer;} +.dir-rtl .file-picker .ygtvlp {background: url('[[pix:moodle|y/lp_rtl]]') 0px 10px no-repeat;width:13px;height:12px;cursor:pointer;} /* Last sibling, expandable, hover */ .file-picker .ygtvlph, .filemanager .ygtvlph {background: url('[[pix:moodle|y/lp]]') 0px 10px no-repeat;width:13px;height:12px;cursor:pointer;} -.dir-rtl .file-picker .ygtvlph, .filemanager .ygtvlph {background: url('[[pix:moodle|y/lp_rtl]]') 0px 10px no-repeat;width:13px;height:12px;cursor:pointer;} +.dir-rtl .file-picker .ygtvlph {background: url('[[pix:moodle|y/lp_rtl]]') 0px 10px no-repeat;width:13px;height:12px;cursor:pointer;} /* Loading icon */ .file-picker .ygtvloading, .filemanager .ygtvloading {background: transparent url('[[pix:moodle|y/loading]]') 0 0 no-repeat;width:16px;height:22px;} /* the style for the empty cells that are used for rendering the depth* of the node */ @@ -208,7 +209,8 @@ a.ygtvspacer:hover {color: transparent;text-decoration: none;} * File exists dialogue on Upload (File Picker only) */ .file-picker.fp-dlg {text-align: center;} -.file-picker.fp-dlg .fp-dlg-text {padding: 40px 20px 10px 20px;font-size: 12px;} +.file-picker.fp-dlg .fp-dlg-text {padding: 30px 20px 10px;font-size: 12px;} +.file-picker.fp-dlg .fp-dlg-buttons {margin: 0 20px;} /* * Error dialogue on Upload (File Picker only) @@ -236,18 +238,17 @@ a.ygtvspacer:hover {color: transparent;text-decoration: none;} * Select Dialogue (File Picker and File Manager) */ .file-picker.fp-select {width:420px;} +.fp-select form {padding: 20px 20px 0;} .fp-select .fp-select-loading {text-align: center;margin-top: 20px;} -.fp-select .fp-hr {clear: both;height: 1px; background-color: #FFFFFF;border-bottom: 1px solid #BBBBBB;width: auto; margin: 5px 20px;} -.fp-select table {margin: 10px 20px;} -.fp-select-update {float:right;margin-right: 20px;} -.fp-select .fp-file-update {background:url('[[pix:theme|fp/check]]') no-repeat left center;width:17px;height:17px;} -.fp-select .fp-file-cancel {background:url('[[pix:theme|fp/cross]]') no-repeat left center;width:17px;height:17px;margin-left: 25px;} -.fp-select .fp-select-update span {margin-left: 17px;} -.fp-select .fp-thumbnail {float:left;min-width:110px;min-height:110px;line-height: 110px;text-align: center;margin: 10px 20px 0px 20px;background: #FFFFFF;border: 1px solid #DDDDDD;-webkit-box-shadow: inset 0px 0px 10px 0px #CCCCCC;-moz-box-shadow: inset 0px 0px 10px 0px #CCCCCC;box-shadow: inset 0px 0px 10px 0px #CCCCCC;} +.fp-select .fp-hr {clear: both;height: 1px; background-color: #FFFFFF;border-bottom: 1px solid #BBBBBB;width: auto; margin: 10px 0;} +.fp-select table {padding: 0 0 10px;} +.fp-select .fp-select-buttons {float: right;} +.fp-select .fp-info {display: block;clear: both;padding: 1px 20px 0;} +.fp-select .fp-thumbnail {float:left;min-width:110px;min-height:110px;line-height: 110px;text-align: center;margin: 10px 20px 0 0;background: #FFFFFF;border: 1px solid #DDDDDD;-webkit-box-shadow: inset 0 0 10px 0 #CCCCCC;-moz-box-shadow: inset 0 0 10px 0 #CCCCCC;box-shadow: inset 0 0 10px 0 #CCCCCC;} .fp-select .fp-thumbnail img {border: 1px solid #DDDDDD;padding:3px;vertical-align: middle;margin: 10px;} -.fp-select .fp-fileinfo {display: inline-block;margin-top: 4px;margin-right: 20px;} +.fp-select .fp-fileinfo {display: inline-block;margin-top: 10px;} .file-picker.fp-select .fp-fileinfo {max-width:240px;} -.fp-select .fp-fileinfo div {padding: 4px 0px;} +.fp-select .fp-fileinfo div {padding-bottom: 5px;} .file-picker.fp-select .uneditable {display:none;} .file-picker.fp-select .fp-select-loading {display:none;} @@ -293,10 +294,10 @@ a.ygtvspacer:hover {color: transparent;text-decoration: none;} /* * Icon view (File Manager only) */ -.filemanager .fp-iconview .fp-reficons1 {position:absolute;height:100%;width:100%;top:0;left:0;z-index:1000;} -.filemanager .fp-iconview .fp-reficons2 {position:absolute;height:100%;width:100%;top:0;left:0;z-index:1001;} -.filemanager .fp-iconview .fp-file.fp-hasreferences .fp-reficons1 {background: url('[[pix:theme|fp/link]]') no-repeat;background-position:bottom right;} -.filemanager .fp-iconview .fp-file.fp-isreference .fp-reficons2 {background: url('[[pix:theme|fp/alias]]') no-repeat;background-position:bottom left;} +.fp-iconview .fp-reficons1 {position:absolute;height:100%;width:100%;top:0;left:0;z-index:1000;} +.fp-iconview .fp-reficons2 {position:absolute;height:100%;width:100%;top:0;left:0;z-index:1001;} +.fp-iconview .fp-file.fp-hasreferences .fp-reficons1 {background: url('[[pix:theme|fp/link]]') no-repeat;background-position:bottom right;} +.fp-iconview .fp-file.fp-isreference .fp-reficons2 {background: url('[[pix:theme|fp/alias]]') no-repeat;background-position:bottom left;} .filemanager .fp-iconview .fp-file.fp-originalmissing .fp-thumbnail img {display:none;} .filemanager .fp-iconview .fp-file.fp-originalmissing .fp-thumbnail {background: url([[pix:s/dead]]) no-repeat;background-position:center center;} @@ -309,6 +310,9 @@ a.ygtvspacer:hover {color: transparent;text-decoration: none;} .filemanager .yui3-datatable-odd .yui3-datatable-cell {background-color: #F6F6F6!important;border-left: 0px solid #F6F6F6;} .filemanager .yui3-datatable-even .yui3-datatable-cell {background-color: #FFFFFF!important;border-left: 0px solid #FFFFFF;} +.filemanager .fp-filename-icon.fp-hasreferences .fp-reficons1{background: url('[[pix:theme|fp/link_sm]]') no-repeat 0 0;height:100%;width:100%;position:absolute;top: 8px;left: 17px;z-index:1000;} +.filemanager .fp-filename-icon.fp-isreference .fp-reficons2 {background: url('[[pix:theme|fp/alias_sm]]') no-repeat 0 0;height:100%;width:100%;position:absolute;top: 9px;left: -6px;z-index:1001;} + /* * Folder Context Menu (File Manager only) */ @@ -370,7 +374,7 @@ a.ygtvspacer:hover {color: transparent;text-decoration: none;} * Create folder dialogue (File Manager only) */ .filemanager.fp-mkdir-dlg {text-align: center;} -.filemanager.fp-mkdir-dlg .fp-mkdir-dlg-text {text-align: left;margin: 40px 20px 20px;} +.filemanager.fp-mkdir-dlg .fp-mkdir-dlg-text {text-align: left;margin: 20px;} .dir-rtl .filemanager .fp-mkdir-dlg p {text-align: right;} @@ -384,6 +388,13 @@ a.ygtvspacer:hover {color: transparent;text-decoration: none;} *file picker search dialog */ .file-picker div.bd {text-align:left;} -.dir-rtl .file-picker div.bd {text-align:right;} +/* RTL Overrides +-------------------------*/ +.dir-rtl .file-picker div.bd {text-align: right;} +.dir-rtl .file-picker .fp-pathbar {text-align: right;} +.dir-rtl .file-picker .fp-list {text-align: right;} +.dir-rtl .filepicker .yui-layout-unit-left {left: 500px;} +.dir-rtl .filepicker .yui-layout-unit-center {left: 0;} +.dir-rtl #filemenu .yuimenuitemlabel {text-align: right;} .dir-rtl .filemanager-container .yui3-skin-sam .yui3-datatable-header {text-align: right;} diff --git a/theme/base/style/question.css b/theme/base/style/question.css index d974e50196f..33cedb4dcee 100644 --- a/theme/base/style/question.css +++ b/theme/base/style/question.css @@ -15,14 +15,18 @@ #qtypechoicecontainer {display: none;} body.jsenabled #qtypechoicecontainer {display: block;} -#qtypechoicecontainer {background: white;} -#qtypechoicecontainer #chooseqtype {width: 30em;} -#qtypechoicecontainer #chooseqtypehead h3 {margin: 0;} -#qtypechoicecontainer #chooseqtype .qtypes {position: relative;border-bottom: 1px solid grey;padding: 0.24em 0;} -#qtypechoicecontainer #chooseqtype .qtypeoption {margin-bottom: 0; padding: 0.2em 0 0.2em 0.3em;} -#qtypechoicecontainer #chooseqtype .qtypeoption img {vertical-align: middle;} +#qtypechoicecontainer_c.yui-panel-container.shadow .underlay {background: none;} +#qtypechoicecontainer.yui-panel .hd {color:#333333;letter-spacing: 1px;text-shadow: 1px 1px 1px #FFFFFF;border-radius: 10px 10px 0 0;border: 1px solid #CCCCCC;border-bottom: 1px solid #BBBBBB;background: -webkit-gradient(linear, left top, left bottom, from(#FFFFFF), to(#CCCCCC));background: -moz-linear-gradient(top, #FFFFFF, #CCCCCC);} + +#qtypechoicecontainer {font-size: 12px;color: #333333;background: #F2F2F2;border-radius: 10px;border:1px solid #CCCCCC;border-top:0 none;-webkit-box-shadow: 5px 5px 20px 0px #666666;-moz-box-shadow: 5px 5px 20px 0px #666666;box-shadow: 5px 5px 20px 0px #666666;} +#qtypechoicecontainer #chooseqtype {width: 35em;} +#qtypechoicecontainer #chooseqtypehead h3 {margin: 0;font-weight: normal;} +#qtypechoicecontainer #chooseqtype .qtypes {position: relative;border-bottom: 1px solid #BBBBBB;padding: 0.24em 0;} +#qtypechoicecontainer #chooseqtype .qtypeoption {margin-bottom: 0; padding: 0.3em 0 0.3em 1.6em;} +#qtypechoicecontainer #chooseqtype .qtypeoption img {vertical-align: middle;padding-left: 1em;padding-right: 0.5em;} +#qtypechoicecontainer #chooseqtype .selected {background-color: #FFFFFF;box-shadow: 0px 0px 10px 0px #CCCCCC;-webkit-box-shadow: 0px 0px 10px 0px #CCCCCC;-moz-box-shadow: 0px 0px 10px 0px #CCCCCC;} #qtypechoicecontainer #chooseqtype .instruction, -#qtypechoicecontainer #chooseqtype .qtypesummary {display: none;position: absolute;top: 0px;right: 0px;bottom: 0px;left: 60%;margin: 0;border-left: 1px solid grey;padding: 0.3em 0.5em;background-color: white;} +#qtypechoicecontainer #chooseqtype .qtypesummary {display: none;position: absolute;top: 0px;right: 0px;bottom: 0px;left: 60%;margin: 0;padding: 1.5em 1.6em;background-color: #FFFFFF;} #qtypechoicecontainer #chooseqtype .instruction, #qtypechoicecontainer #chooseqtype .selected .qtypesummary {display: block;} diff --git a/theme/base/style/user.css b/theme/base/style/user.css index 8276b71ffe6..b23d73417b3 100644 --- a/theme/base/style/user.css +++ b/theme/base/style/user.css @@ -54,3 +54,5 @@ .dir-rtl .userlist table#participants td, .dir-rtl .userlist table#participants th {text-align: right;} .dir-rtl .userlist table#participants {margin: 0 auto;} + +#page-my-index.dir-rtl .block h3.main { text-align: right;} diff --git a/theme/canvas/style/mods.css b/theme/canvas/style/mods.css index 1d003a6022c..ed08067d562 100644 --- a/theme/canvas/style/mods.css +++ b/theme/canvas/style/mods.css @@ -62,7 +62,7 @@ text-align:right; } -/* Database +/* Folder ------------------------*/ .path-mod-folder #pageintro { @@ -72,11 +72,15 @@ } .path-mod-folder .foldertree { - width: 60%; + width: 90%; margin: 1.5em auto; padding: 10px; } +#page-mod-folder-edit .foldertree { + width: 100%; +} + /* Assignment ------------------------*/ @@ -454,12 +458,9 @@ margin-top: 1em; } -#page-mod-folder-edit .foldertree { - width: 65%; -} /* Quiz --------------------------------*/ .que { border-color: #eee; -} \ No newline at end of file +} diff --git a/theme/mymobile/config.php b/theme/mymobile/config.php index c92dc93eb7a..2e05c995ebc 100644 --- a/theme/mymobile/config.php +++ b/theme/mymobile/config.php @@ -34,7 +34,7 @@ $THEME->parents = array( // Set the stylesheets that we want to include for this theme $THEME->sheets = array( - 'jmobile1', + 'jmobile11', 'core', 'media' ); @@ -155,17 +155,11 @@ if ($thisdevice == "default" || $thisdevice == "tablet" || optional_param('mymob // Add the required JavaScript to the page $THEME->javascripts = array( - 'jquery-1.6.4.min', - 'jquery-noconflict', + 'jquery-1.7.1.min', 'custom', - 'jquery.mobile-1.0', - 'scrollview', - 'easing' + 'jquery.mobile-1.1.0' ); // Sets a custom render factory to use with the theme, used when working with custom renderers. $THEME->rendererfactory = 'theme_overridden_renderer_factory'; - -// This theme doesn't support CSS optimisation. The JQuery CSS has already been optimised in a way that -// is not compatible with the CSS optimiser in Moodle. -$THEME->supportscssoptimisation = false; +$THEME->csspostprocess = 'mymobile_user_settings'; \ No newline at end of file diff --git a/theme/mymobile/javascript/custom.js b/theme/mymobile/javascript/custom.js index a497ffc20b3..135e99cadab 100644 --- a/theme/mymobile/javascript/custom.js +++ b/theme/mymobile/javascript/custom.js @@ -1,8 +1,7 @@ $(document).bind("mobileinit", function(){ //mobile init stuff 11/12/10 //turn off ajax forms... -//$.mobile.defaultPageTransition = "fade"; -//$.mobile.touchOverflowEnabled = true; +$.mobile.defaultPageTransition = "slide"; }); $(document).ready(function() { @@ -49,7 +48,7 @@ $(document).ready(function() { //scroll to top $('a#uptotop').live('tap', function() { - var position = $(".ui-page-active .ui-header").position(); + var position = $(".ui-page-active").position(); $.mobile.silentScroll(position.top); $(this).removeClass("ui-btn-active"); return false; @@ -62,7 +61,7 @@ $(document).ready(function() { }); //calendar and other links that need to be external - $('.maincalendar .filters a, li.activity.scorm a, div.files a, #page-user-filesPAGE li div a, .maincalendar .bottom a, .section li.url.modtype_url a, .resourcecontent .resourcemediaplugin a, #underfooter .noajax a, .block_mnet_hosts .content a, .block_private_files .content a, a.portfolio-add-link').attr("data-ajax", "false"); + $('.maincalendar .filters a, li.activity.scorm a, div.files a, #page-user-filesPAGE li div a, .maincalendar .bottom a, .section li.url.modtype_url a, .resourcecontent .resourcemediaplugin a, #underfooter .noajax a, .block_mnet_hosts .content a, .block_private_files .content a, a.portfolio-add-link, #attempts td a').attr("data-ajax", "false"); //add blank to open in window for some $('#page-mod-url-viewPAGE div.urlworkaround a, #page-mod-resource-viewPAGE div.resourceworkaround a, .mediaplugin a.mediafallbacklink, #page-mod-resource-viewPAGE .resourcemp3 a, .foldertree li a').attr("target", "_blank").attr("data-role", "button").attr("data-icon", "plus"); @@ -226,7 +225,7 @@ $(document).ready(function() { }); //quiz page only js - $('div#page-mod-quiz-viewPAGE, div#page-mod-quiz-attemptPAGE, div#page-mod-quiz-summaryPAGE, div#page-mod-quiz-reviewPAGE').live('pagebeforecreate',function(event, ui){ + $('div#page-mod-quiz-viewPAGE, div#page-mod-quiz-attemptPAGE, div#page-mod-quiz-summaryPAGE, div#page-mod-quiz-reviewPAGE, #page-mod-quiz-attempt #content2').live('pagebeforecreate',function(event, ui){ //add quiz timer into quiz page $('#quiz-timer').remove(); $('.mymobilecontent').prepend('
          '); @@ -251,20 +250,13 @@ $(document).ready(function() { $('div#page-course-view-topcollPAGE').live('pagebeforecreate',function(event, ui){ $('#page-course-view-topcollPAGE ul.section').attr("data-role", "none"); $('.section li img').removeClass("ui-li-icon"); - $.getScript('../course/format/topcoll/lib.js'); + $.getScript('../course/format/topcoll/module.js'); $('#page-course-view-topcollPAGE tr.cps a').attr("data-role", "button").attr("data-icon", "arrow-r"); $('#page-course-view-topcollPAGE #thetopics').attr("data-role", "controlgroup"); $('#page-course-view-topcollPAGE td.cps_centre').each(function(index) { var cpsc = $(this).text().replace('
          ','').replace(')',''); $(this).prev('td').find('a').append('' + cpsc + ''); }); - $('tr.cps').click(function() { - if ($(this).hasClass('opencps')) { - $(this).removeClass("opencps"); - } else { - $(this).addClass("opencps"); - } - }); }); ///// functions below does stuff after creating page for some cleaning... @@ -272,8 +264,6 @@ $(document).ready(function() { $('.path-calendar div.ui-radio label:first-child, .path-mod-lesson div.ui-radio label:first-child, #page-mod-wiki-createPAGE div.ui-radio label:first-child').addClass("afirst"); $('.forumpost div.author a').removeAttr('data-role'); //$('.questionflagimage2').removeClass("ui-btn-hidden");a#notificationyes - //scrollview 2/7/11 testing remove if remove scrollview - $('.gradeparent, .pagelayout-report .no-overflow, .path-mod-choice .response, .resourcecontent.resourceimg, .usersubmissions .no-overflow, .path-course-report-log .generaltable, table.results.anonymous, table.surveytable, div.resultgraph, div.reportsummary a, #completion-progress').scrollview(); //image replacement $(this).find(".ithumb .course-content .summary img, .ithumb .course-content .activity.label img, .ithumb .sitetopic .no-overflow img").click(function() { var turl = $(this).attr("src"); diff --git a/theme/mymobile/javascript/easing.js b/theme/mymobile/javascript/easing.js deleted file mode 100644 index ef743210795..00000000000 --- a/theme/mymobile/javascript/easing.js +++ /dev/null @@ -1,205 +0,0 @@ -/* - * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ - * - * Uses the built in easing capabilities added In jQuery 1.1 - * to offer multiple easing options - * - * TERMS OF USE - jQuery Easing - * - * Open source under the BSD License. - * - * Copyright © 2008 George McGinley Smith - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * Neither the name of the author nor the names of contributors may be used to endorse - * or promote products derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * -*/ - -// t: current time, b: begInnIng value, c: change In value, d: duration -jQuery.easing['jswing'] = jQuery.easing['swing']; - -jQuery.extend( jQuery.easing, -{ - def: 'easeOutQuad', - swing: function (x, t, b, c, d) { - //alert(jQuery.easing.default); - return jQuery.easing[jQuery.easing.def](x, t, b, c, d); - }, - easeInQuad: function (x, t, b, c, d) { - return c*(t/=d)*t + b; - }, - easeOutQuad: function (x, t, b, c, d) { - return -c *(t/=d)*(t-2) + b; - }, - easeInOutQuad: function (x, t, b, c, d) { - if ((t/=d/2) < 1) return c/2*t*t + b; - return -c/2 * ((--t)*(t-2) - 1) + b; - }, - easeInCubic: function (x, t, b, c, d) { - return c*(t/=d)*t*t + b; - }, - easeOutCubic: function (x, t, b, c, d) { - return c*((t=t/d-1)*t*t + 1) + b; - }, - easeInOutCubic: function (x, t, b, c, d) { - if ((t/=d/2) < 1) return c/2*t*t*t + b; - return c/2*((t-=2)*t*t + 2) + b; - }, - easeInQuart: function (x, t, b, c, d) { - return c*(t/=d)*t*t*t + b; - }, - easeOutQuart: function (x, t, b, c, d) { - return -c * ((t=t/d-1)*t*t*t - 1) + b; - }, - easeInOutQuart: function (x, t, b, c, d) { - if ((t/=d/2) < 1) return c/2*t*t*t*t + b; - return -c/2 * ((t-=2)*t*t*t - 2) + b; - }, - easeInQuint: function (x, t, b, c, d) { - return c*(t/=d)*t*t*t*t + b; - }, - easeOutQuint: function (x, t, b, c, d) { - return c*((t=t/d-1)*t*t*t*t + 1) + b; - }, - easeInOutQuint: function (x, t, b, c, d) { - if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; - return c/2*((t-=2)*t*t*t*t + 2) + b; - }, - easeInSine: function (x, t, b, c, d) { - return -c * Math.cos(t/d * (Math.PI/2)) + c + b; - }, - easeOutSine: function (x, t, b, c, d) { - return c * Math.sin(t/d * (Math.PI/2)) + b; - }, - easeInOutSine: function (x, t, b, c, d) { - return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; - }, - easeInExpo: function (x, t, b, c, d) { - return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; - }, - easeOutExpo: function (x, t, b, c, d) { - return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; - }, - easeInOutExpo: function (x, t, b, c, d) { - if (t==0) return b; - if (t==d) return b+c; - if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; - return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; - }, - easeInCirc: function (x, t, b, c, d) { - return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; - }, - easeOutCirc: function (x, t, b, c, d) { - return c * Math.sqrt(1 - (t=t/d-1)*t) + b; - }, - easeInOutCirc: function (x, t, b, c, d) { - if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; - return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; - }, - easeInElastic: function (x, t, b, c, d) { - var s=1.70158;var p=0;var a=c; - if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; - if (a < Math.abs(c)) { a=c; var s=p/4; } - else var s = p/(2*Math.PI) * Math.asin (c/a); - return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; - }, - easeOutElastic: function (x, t, b, c, d) { - var s=1.70158;var p=0;var a=c; - if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; - if (a < Math.abs(c)) { a=c; var s=p/4; } - else var s = p/(2*Math.PI) * Math.asin (c/a); - return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; - }, - easeInOutElastic: function (x, t, b, c, d) { - var s=1.70158;var p=0;var a=c; - if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); - if (a < Math.abs(c)) { a=c; var s=p/4; } - else var s = p/(2*Math.PI) * Math.asin (c/a); - if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; - return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; - }, - easeInBack: function (x, t, b, c, d, s) { - if (s == undefined) s = 1.70158; - return c*(t/=d)*t*((s+1)*t - s) + b; - }, - easeOutBack: function (x, t, b, c, d, s) { - if (s == undefined) s = 1.70158; - return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; - }, - easeInOutBack: function (x, t, b, c, d, s) { - if (s == undefined) s = 1.70158; - if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; - return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; - }, - easeInBounce: function (x, t, b, c, d) { - return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; - }, - easeOutBounce: function (x, t, b, c, d) { - if ((t/=d) < (1/2.75)) { - return c*(7.5625*t*t) + b; - } else if (t < (2/2.75)) { - return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; - } else if (t < (2.5/2.75)) { - return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; - } else { - return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; - } - }, - easeInOutBounce: function (x, t, b, c, d) { - if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; - return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; - } -}); - -/* - * - * TERMS OF USE - EASING EQUATIONS - * - * Open source under the BSD License. - * - * Copyright © 2001 Robert Penner - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * Neither the name of the author nor the names of contributors may be used to endorse - * or promote products derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ \ No newline at end of file diff --git a/theme/mymobile/javascript/jquery-1.6.4.min.js b/theme/mymobile/javascript/jquery-1.6.4.min.js deleted file mode 100644 index 628ed9b3160..00000000000 --- a/theme/mymobile/javascript/jquery-1.6.4.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v1.6.4 http://jquery.com/ | http://jquery.org/license */ -(function(a,b){function cu(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cr(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"":"")+""),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cq(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cp(){cn=b}function co(){setTimeout(cp,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bv(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bl(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bd,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bk(a){f.nodeName(a,"input")?bj(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bj)}function bj(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bi(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bh(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bg(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i=0===c})}function U(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function M(a,b){return(a&&a!=="*"?a+".":"")+b.replace(y,"`").replace(z,"&")}function L(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;ic)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function J(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function D(){return!0}function C(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function K(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(K,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z]|[0-9])/ig,x=/^-ms-/,y=function(a,b){return(b+"").toUpperCase()},z=d.userAgent,A,B,C,D=Object.prototype.toString,E=Object.prototype.hasOwnProperty,F=Array.prototype.push,G=Array.prototype.slice,H=String.prototype.trim,I=Array.prototype.indexOf,J={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.4",length:0,size:function(){return this.length},toArray:function(){return G.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?F.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),B.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(G.apply(this,arguments),"slice",G.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:F,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;B.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!B){B=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",C,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",C),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&K()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):J[D.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!E.call(a,"constructor")&&!E.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||E.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(x,"ms-").replace(w,y)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c
          '.$str1.''.$str2.'
          '.$str1.''.$str2.'
          '.$str1.''.$str2.'
          a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},m&&f.extend(p,{position:"absolute",left:"-1000px",top:"-1000px"});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
          ",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
          t
          ",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i=f.expando,j=typeof c=="string",k=a.nodeType,l=k?f.cache:a,m=k?a[f.expando]:a[f.expando]&&f.expando;if((!m||e&&m&&l[m]&&!l[m][i])&&j&&d===b)return;m||(k?a[f.expando]=m=++f.uuid:m=f.expando),l[m]||(l[m]={},k||(l[m].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?l[m][i]=f.extend(l[m][i],c):l[m]=f.extend(l[m],c);g=l[m],e&&(g[i]||(g[i]={}),g=g[i]),d!==b&&(g[f.camelCase(c)]=d);if(c==="events"&&!g[c])return g[i]&&g[i].events;j?(h=g[c],h==null&&(h=g[f.camelCase(c)])):h=g;return h}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e=f.expando,g=a.nodeType,h=g?f.cache:a,i=g?a[f.expando]:f.expando;if(!h[i])return;if(b){d=c?h[i][e]:h[i];if(d){d[b]||(b=f.camelCase(b)),delete d[b];if(!l(d))return}}if(c){delete h[i][e];if(!l(h[i]))return}var j=h[i][e];f.support.deleteExpando||!h.setInterval?delete h[i]:h[i]=null,j?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=j):g&&(f.support.deleteExpando?delete a[f.expando]:a.removeAttribute?a.removeAttribute(f.expando):a[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=v:u&&(i=u)));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j&&(h=i.get(a,c))!==null)return h;h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.attr(a,b,""),a.removeAttribute(b),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(u&&f.nodeName(a,"button"))return u.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(u&&f.nodeName(a,"button"))return u.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==null?g:a[c]},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabIndex=f.propHooks.tabIndex,v={get:function(a,c){var d;return f.prop(a,c)===!0||(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},f.support.getSetAttribute||(u=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var w=/\.(.*)$/,x=/^(?:textarea|input|select)$/i,y=/\./g,z=/ /g,A=/[^\w\s.|`]/g,B=function(a){return a.replace(A,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=C;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=C);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),B).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},I=function(c){var d=c.target,e,g;if(!!x.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=H(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:I,beforedeactivate:I,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&I.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&I.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",H(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in G)f.event.add(this,c+".specialChange",G[c]);return x.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return x.test(this.nodeName)}},G=f.event.special.change.filters,G.focus=G.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

          ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
          ";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0)for(h=g;h0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=S.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(U(c[0])||U(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=R.call(arguments);N.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!T[a]?f.unique(e):e,(this.length>1||P.test(d))&&O.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
          ","
          "],thead:[1,"","
          "],tr:[2,"","
          "],td:[3,"","
          "],col:[2,"","
          "],area:[1,"",""],_default:[0,"",""]};be.optgroup=be.option,be.tbody=be.tfoot=be.colgroup=be.caption=be.thead,be.th=be.td,f.support.htmlSerialize||(be._default=[1,"div
          ","
          "]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!be[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bh(a,d),e=bi(a),g=bi(d);for(h=0;e[h];++h)g[h]&&bh(e[h],g[h])}if(b){bg(a,d);if(c){e=bi(a),g=bi(d);for(h=0;e[h];++h)bg(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=be[l]||be._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bn.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bm,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bm.test(g)?g.replace(bm,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bv(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bw=function(a,c){var d,e,g;c=c.replace(bo,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bx=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bp.test(d)&&bq.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bv=bw||bx,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bz=/%20/g,bA=/\[\]$/,bB=/\r?\n/g,bC=/#.*$/,bD=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bE=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bF=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bG=/^(?:GET|HEAD)$/,bH=/^\/\//,bI=/\?/,bJ=/)<[^<]*)*<\/script>/gi,bK=/^(?:select|textarea)/i,bL=/\s+/,bM=/([?&])_=[^&]*/,bN=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bO=f.fn.load,bP={},bQ={},bR,bS,bT=["*/"]+["*"];try{bR=e.href}catch(bU){bR=c.createElement("a"),bR.href="",bR=bR.href}bS=bN.exec(bR.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bO)return bO.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
          ").append(c.replace(bJ,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bK.test(this.nodeName)||bE.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bB,"\r\n")}}):{name:b.name,value:c.replace(bB,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?bX(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),bX(a,b);return a},ajaxSettings:{url:bR,isLocal:bF.test(bS[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bT},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bV(bP),ajaxTransport:bV(bQ),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?bZ(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=b$(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bD.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bC,"").replace(bH,bS[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bL),d.crossDomain==null&&(r=bN.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bS[1]&&r[2]==bS[2]&&(r[3]||(r[1]==="http:"?80:443))==(bS[3]||(bS[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bW(bP,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bG.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bI.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bM,"$1_="+x);d.url=y+(y===d.url?(bI.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bT+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bW(bQ,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){s<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)bY(g,a[g],c,e);return d.join("&").replace(bz,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cq("show",3),a,b,c);for(var g=0,h=this.length;g=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b
          ";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=ct.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!ct.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cu(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cu(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNaN(j)?i:j}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window); \ No newline at end of file diff --git a/theme/mymobile/javascript/jquery-1.7.1.min.js b/theme/mymobile/javascript/jquery-1.7.1.min.js new file mode 100644 index 00000000000..ee0233703da --- /dev/null +++ b/theme/mymobile/javascript/jquery-1.7.1.min.js @@ -0,0 +1,4 @@ +/*! jQuery v1.7.1 jquery.com | jquery.org/license */ +(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
          a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
          "+""+"
          ",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
          t
          ",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
          ",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; +f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

          ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
          ";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
          ","
          "],thead:[1,"","
          "],tr:[2,"","
          "],td:[3,"","
          "],col:[2,"","
          "],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
          ","
          "]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() +{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
          ").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/theme/mymobile/javascript/jquery-noconflict.js b/theme/mymobile/javascript/jquery-noconflict.js deleted file mode 100644 index aa32286f6a3..00000000000 --- a/theme/mymobile/javascript/jquery-noconflict.js +++ /dev/null @@ -1 +0,0 @@ -jQuery.noConflict(); \ No newline at end of file diff --git a/theme/mymobile/javascript/jquery.mobile-1.0.js b/theme/mymobile/javascript/jquery.mobile-1.1.0.js similarity index 74% rename from theme/mymobile/javascript/jquery.mobile-1.0.js rename to theme/mymobile/javascript/jquery.mobile-1.1.0.js index 44f645ca1e3..63b19b521aa 100644 --- a/theme/mymobile/javascript/jquery.mobile-1.0.js +++ b/theme/mymobile/javascript/jquery.mobile-1.1.0.js @@ -1,5 +1,5 @@ /* -* jQuery Mobile Framework 1.0 +* jQuery Mobile Framework 1.1.0 db342b1f315c282692791aa870455901fdb46a55 * http://jquerymobile.com * * Copyright 2011 (c) jQuery Project @@ -7,484 +7,19 @@ * http://jquery.org/license * */ -/*! - * jQuery UI Widget @VERSION - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Widget - */ - -(function( $, undefined ) { - -// jQuery 1.4+ -if ( $.cleanData ) { - var _cleanData = $.cleanData; - $.cleanData = function( elems ) { - for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { - $( elem ).triggerHandler( "remove" ); - } - _cleanData( elems ); - }; -} else { - var _remove = $.fn.remove; - $.fn.remove = function( selector, keepData ) { - return this.each(function() { - if ( !keepData ) { - if ( !selector || $.filter( selector, [ this ] ).length ) { - $( "*", this ).add( [ this ] ).each(function() { - $( this ).triggerHandler( "remove" ); - }); - } - } - return _remove.call( $(this), selector, keepData ); +(function ( root, doc, factory ) { + if ( typeof define === "function" && define.amd ) { + // AMD. Register as an anonymous module. + define( [ "jquery" ], function ( $ ) { + factory( $, root, doc ); + return $.mobile; }); - }; -} - -$.widget = function( name, base, prototype ) { - var namespace = name.split( "." )[ 0 ], - fullName; - name = name.split( "." )[ 1 ]; - fullName = namespace + "-" + name; - - if ( !prototype ) { - prototype = base; - base = $.Widget; - } - - // create selector for plugin - $.expr[ ":" ][ fullName ] = function( elem ) { - return !!$.data( elem, name ); - }; - - $[ namespace ] = $[ namespace ] || {}; - $[ namespace ][ name ] = function( options, element ) { - // allow instantiation without initializing for simple inheritance - if ( arguments.length ) { - this._createWidget( options, element ); - } - }; - - var basePrototype = new base(); - // we need to make the options hash a property directly on the new instance - // otherwise we'll modify the options hash on the prototype that we're - // inheriting from -// $.each( basePrototype, function( key, val ) { -// if ( $.isPlainObject(val) ) { -// basePrototype[ key ] = $.extend( {}, val ); -// } -// }); - basePrototype.options = $.extend( true, {}, basePrototype.options ); - $[ namespace ][ name ].prototype = $.extend( true, basePrototype, { - namespace: namespace, - widgetName: name, - widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name, - widgetBaseClass: fullName - }, prototype ); - - $.widget.bridge( name, $[ namespace ][ name ] ); -}; - -$.widget.bridge = function( name, object ) { - $.fn[ name ] = function( options ) { - var isMethodCall = typeof options === "string", - args = Array.prototype.slice.call( arguments, 1 ), - returnValue = this; - - // allow multiple hashes to be passed on init - options = !isMethodCall && args.length ? - $.extend.apply( null, [ true, options ].concat(args) ) : - options; - - // prevent calls to internal methods - if ( isMethodCall && options.charAt( 0 ) === "_" ) { - return returnValue; - } - - if ( isMethodCall ) { - this.each(function() { - var instance = $.data( this, name ); - if ( !instance ) { - throw "cannot call methods on " + name + " prior to initialization; " + - "attempted to call method '" + options + "'"; - } - if ( !$.isFunction( instance[options] ) ) { - throw "no such method '" + options + "' for " + name + " widget instance"; - } - var methodValue = instance[ options ].apply( instance, args ); - if ( methodValue !== instance && methodValue !== undefined ) { - returnValue = methodValue; - return false; - } - }); - } else { - this.each(function() { - var instance = $.data( this, name ); - if ( instance ) { - instance.option( options || {} )._init(); - } else { - $.data( this, name, new object( options, this ) ); - } - }); - } - - return returnValue; - }; -}; - -$.Widget = function( options, element ) { - // allow instantiation without initializing for simple inheritance - if ( arguments.length ) { - this._createWidget( options, element ); - } -}; - -$.Widget.prototype = { - widgetName: "widget", - widgetEventPrefix: "", - options: { - disabled: false - }, - _createWidget: function( options, element ) { - // $.widget.bridge stores the plugin instance, but we do it anyway - // so that it's stored even before the _create function runs - $.data( element, this.widgetName, this ); - this.element = $( element ); - this.options = $.extend( true, {}, - this.options, - this._getCreateOptions(), - options ); - - var self = this; - this.element.bind( "remove." + this.widgetName, function() { - self.destroy(); - }); - - this._create(); - this._trigger( "create" ); - this._init(); - }, - _getCreateOptions: function() { - var options = {}; - if ( $.metadata ) { - options = $.metadata.get( element )[ this.widgetName ]; - } - return options; - }, - _create: function() {}, - _init: function() {}, - - destroy: function() { - this.element - .unbind( "." + this.widgetName ) - .removeData( this.widgetName ); - this.widget() - .unbind( "." + this.widgetName ) - .removeAttr( "aria-disabled" ) - .removeClass( - this.widgetBaseClass + "-disabled " + - "ui-state-disabled" ); - }, - - widget: function() { - return this.element; - }, - - option: function( key, value ) { - var options = key; - - if ( arguments.length === 0 ) { - // don't return a reference to the internal hash - return $.extend( {}, this.options ); - } - - if (typeof key === "string" ) { - if ( value === undefined ) { - return this.options[ key ]; - } - options = {}; - options[ key ] = value; - } - - this._setOptions( options ); - - return this; - }, - _setOptions: function( options ) { - var self = this; - $.each( options, function( key, value ) { - self._setOption( key, value ); - }); - - return this; - }, - _setOption: function( key, value ) { - this.options[ key ] = value; - - if ( key === "disabled" ) { - this.widget() - [ value ? "addClass" : "removeClass"]( - this.widgetBaseClass + "-disabled" + " " + - "ui-state-disabled" ) - .attr( "aria-disabled", value ); - } - - return this; - }, - - enable: function() { - return this._setOption( "disabled", false ); - }, - disable: function() { - return this._setOption( "disabled", true ); - }, - - _trigger: function( type, event, data ) { - var callback = this.options[ type ]; - - event = $.Event( event ); - event.type = ( type === this.widgetEventPrefix ? - type : - this.widgetEventPrefix + type ).toLowerCase(); - data = data || {}; - - // copy original event properties over to the new event - // this would happen if we could call $.event.fix instead of $.Event - // but we don't have a way to force an event to be fixed multiple times - if ( event.originalEvent ) { - for ( var i = $.event.props.length, prop; i; ) { - prop = $.event.props[ --i ]; - event[ prop ] = event.originalEvent[ prop ]; - } - } - - this.element.trigger( event, data ); - - return !( $.isFunction(callback) && - callback.call( this.element[0], event, data ) === false || - event.isDefaultPrevented() ); - } -}; - -})( jQuery ); -/* -* widget factory extentions for mobile -*/ - -(function( $, undefined ) { - -$.widget( "mobile.widget", { - // decorate the parent _createWidget to trigger `widgetinit` for users - // who wish to do post post `widgetcreate` alterations/additions - // - // TODO create a pull request for jquery ui to trigger this event - // in the original _createWidget - _createWidget: function() { - $.Widget.prototype._createWidget.apply( this, arguments ); - this._trigger( 'init' ); - }, - - _getCreateOptions: function() { - - var elem = this.element, - options = {}; - - $.each( this.options, function( option ) { - - var value = elem.jqmData( option.replace( /[A-Z]/g, function( c ) { - return "-" + c.toLowerCase(); - }) - ); - - if ( value !== undefined ) { - options[ option ] = value; - } - }); - - return options; - }, - - enhanceWithin: function( target ) { - // TODO remove dependency on the page widget for the keepNative. - // Currently the keepNative value is defined on the page prototype so - // the method is as well - var page = $(target).closest(":jqmData(role='page')").data( "page" ), - keepNative = (page && page.keepNativeSelector()) || ""; - - $( this.options.initSelector, target ).not( keepNative )[ this.widgetName ](); - } -}); - -})( jQuery ); -/* -* a workaround for window.matchMedia -*/ - -(function( $, undefined ) { - -var $window = $( window ), - $html = $( "html" ); - -/* $.mobile.media method: pass a CSS media type or query and get a bool return - note: this feature relies on actual media query support for media queries, though types will work most anywhere - examples: - $.mobile.media('screen') //>> tests for screen media type - $.mobile.media('screen and (min-width: 480px)') //>> tests for screen media type with window width > 480px - $.mobile.media('@media screen and (-webkit-min-device-pixel-ratio: 2)') //>> tests for webkit 2x pixel ratio (iPhone 4) -*/ -$.mobile.media = (function() { - // TODO: use window.matchMedia once at least one UA implements it - var cache = {}, - testDiv = $( "
          " ), - fakeBody = $( "" ).append( testDiv ); - - return function( query ) { - if ( !( query in cache ) ) { - var styleBlock = document.createElement( "style" ), - cssrule = "@media " + query + " { #jquery-mediatest { position:absolute; } }"; - - //must set type for IE! - styleBlock.type = "text/css"; - - if ( styleBlock.styleSheet ){ - styleBlock.styleSheet.cssText = cssrule; - } else { - styleBlock.appendChild( document.createTextNode(cssrule) ); - } - - $html.prepend( fakeBody ).prepend( styleBlock ); - cache[ query ] = testDiv.css( "position" ) === "absolute"; - fakeBody.add( styleBlock ).remove(); - } - return cache[ query ]; - }; -})(); - -})(jQuery); -/* -* support tests -*/ - -(function( $, undefined ) { - -var fakeBody = $( "" ).prependTo( "html" ), - fbCSS = fakeBody[ 0 ].style, - vendors = [ "Webkit", "Moz", "O" ], - webos = "palmGetResource" in window, //only used to rule out scrollTop - operamini = window.operamini && ({}).toString.call( window.operamini ) === "[object OperaMini]", - bb = window.blackberry; //only used to rule out box shadow, as it's filled opaque on BB - -// thx Modernizr -function propExists( prop ) { - var uc_prop = prop.charAt( 0 ).toUpperCase() + prop.substr( 1 ), - props = ( prop + " " + vendors.join( uc_prop + " " ) + uc_prop ).split( " " ); - - for ( var v in props ){ - if ( fbCSS[ props[ v ] ] !== undefined ) { - return true; - } - } -} - -// Test for dynamic-updating base tag support ( allows us to avoid href,src attr rewriting ) -function baseTagTest() { - var fauxBase = location.protocol + "//" + location.host + location.pathname + "ui-dir/", - base = $( "head base" ), - fauxEle = null, - href = "", - link, rebase; - - if ( !base.length ) { - base = fauxEle = $( "", { "href": fauxBase }).appendTo( "head" ); } else { - href = base.attr( "href" ); + // Browser globals + factory( root.jQuery, root, doc ); } +}( this, document, function ( $, window, document, undefined ) { - link = $( "" ).prependTo( fakeBody ); - rebase = link[ 0 ].href; - base[ 0 ].href = href || location.pathname; - - if ( fauxEle ) { - fauxEle.remove(); - } - return rebase.indexOf( fauxBase ) === 0; -} - - -// non-UA-based IE version check by James Padolsey, modified by jdalton - from http://gist.github.com/527683 -// allows for inclusion of IE 6+, including Windows Mobile 7 -$.mobile.browser = {}; -$.mobile.browser.ie = (function() { - var v = 3, - div = document.createElement( "div" ), - a = div.all || []; - - while ( div.innerHTML = "", a[ 0 ] ); - - return v > 4 ? v : !v; -})(); - - -$.extend( $.support, { - orientation: "orientation" in window && "onorientationchange" in window, - touch: "ontouchend" in document, - cssTransitions: "WebKitTransitionEvent" in window, - pushState: "pushState" in history && "replaceState" in history, - mediaquery: $.mobile.media( "only all" ), - cssPseudoElement: !!propExists( "content" ), - touchOverflow: !!propExists( "overflowScrolling" ), - boxShadow: !!propExists( "boxShadow" ) && !bb, - scrollTop: ( "pageXOffset" in window || "scrollTop" in document.documentElement || "scrollTop" in fakeBody[ 0 ] ) && !webos && !operamini, - dynamicBaseTag: baseTagTest() -}); - -fakeBody.remove(); - - -// $.mobile.ajaxBlacklist is used to override ajaxEnabled on platforms that have known conflicts with hash history updates (BB5, Symbian) -// or that generally work better browsing in regular http for full page refreshes (Opera Mini) -// Note: This detection below is used as a last resort. -// We recommend only using these detection methods when all other more reliable/forward-looking approaches are not possible -var nokiaLTE7_3 = (function(){ - - var ua = window.navigator.userAgent; - - //The following is an attempt to match Nokia browsers that are running Symbian/s60, with webkit, version 7.3 or older - return ua.indexOf( "Nokia" ) > -1 && - ( ua.indexOf( "Symbian/3" ) > -1 || ua.indexOf( "Series60/5" ) > -1 ) && - ua.indexOf( "AppleWebKit" ) > -1 && - ua.match( /(BrowserNG|NokiaBrowser)\/7\.[0-3]/ ); -})(); - -$.mobile.ajaxBlacklist = - // BlackBerry browsers, pre-webkit - window.blackberry && !window.WebKitPoint || - // Opera Mini - operamini || - // Symbian webkits pre 7.3 - nokiaLTE7_3; - -// Lastly, this workaround is the only way we've found so far to get pre 7.3 Symbian webkit devices -// to render the stylesheets when they're referenced before this script, as we'd recommend doing. -// This simply reappends the CSS in place, which for some reason makes it apply -if ( nokiaLTE7_3 ) { - $(function() { - $( "head link[rel='stylesheet']" ).attr( "rel", "alternate stylesheet" ).attr( "rel", "stylesheet" ); - }); -} - -// For ruling out shadows via css -if ( !$.support.boxShadow ) { - $( "html" ).addClass( "ui-mobile-nosupport-boxshadow" ); -} - -})( jQuery ); -/* -* "mouse" plugin -*/ // This plugin is an experiment for abstracting away the touch and mouse // events so that developers don't have to worry about which method of input @@ -507,6 +42,8 @@ var dataPropertyName = "virtualMouseBindings", touchTargetPropertyName = "virtualTouchID", virtualEventNames = "vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split( " " ), touchEventProps = "clientX clientY pageX pageY screenX screenY".split( " " ), + mouseHookProps = $.event.mouseHooks ? $.event.mouseHooks.props : [], + mouseEventProps = $.event.props.concat( mouseHookProps ), activeDocHandlers = {}, resetTimerID = 0, startX = 0, @@ -545,6 +82,12 @@ function createVirtualEvent( event, eventType ) { oe = event.originalEvent; props = $.event.props; + // addresses separation of $.event.props in to $.event.mouseHook.props and Issue 3280 + // https://github.com/jquery/jquery-mobile/issues/3280 + if ( t.search( /^(mouse|click)/ ) > -1 ) { + props = mouseEventProps; + } + // copy original event properties over to the new event // this would happen if we could call $.event.fix instead of $.Event // but we don't have a way to force an event to be fixed multiple times @@ -977,326 +520,11 @@ if ( eventCaptureSupported ) { }, true); } })( jQuery, window, document ); -/* -* "events" plugin - Handles events -*/ -(function( $, window, undefined ) { -// add new event shortcuts -$.each( ( "touchstart touchmove touchend orientationchange throttledresize " + - "tap taphold swipe swipeleft swiperight scrollstart scrollstop" ).split( " " ), function( i, name ) { - $.fn[ name ] = function( fn ) { - return fn ? this.bind( name, fn ) : this.trigger( name ); - }; - - $.attrFn[ name ] = true; -}); - -var supportTouch = $.support.touch, - scrollEvent = "touchmove scroll", - touchStartEvent = supportTouch ? "touchstart" : "mousedown", - touchStopEvent = supportTouch ? "touchend" : "mouseup", - touchMoveEvent = supportTouch ? "touchmove" : "mousemove"; - -function triggerCustomEvent( obj, eventType, event ) { - var originalType = event.type; - event.type = eventType; - $.event.handle.call( obj, event ); - event.type = originalType; -} - -// also handles scrollstop -$.event.special.scrollstart = { - - enabled: true, - - setup: function() { - - var thisObject = this, - $this = $( thisObject ), - scrolling, - timer; - - function trigger( event, state ) { - scrolling = state; - triggerCustomEvent( thisObject, scrolling ? "scrollstart" : "scrollstop", event ); - } - - // iPhone triggers scroll after a small delay; use touchmove instead - $this.bind( scrollEvent, function( event ) { - - if ( !$.event.special.scrollstart.enabled ) { - return; - } - - if ( !scrolling ) { - trigger( event, true ); - } - - clearTimeout( timer ); - timer = setTimeout(function() { - trigger( event, false ); - }, 50 ); - }); - } -}; - -// also handles taphold -$.event.special.tap = { - setup: function() { - var thisObject = this, - $this = $( thisObject ); - - $this.bind( "vmousedown", function( event ) { - - if ( event.which && event.which !== 1 ) { - return false; - } - - var origTarget = event.target, - origEvent = event.originalEvent, - timer; - - function clearTapTimer() { - clearTimeout( timer ); - } - - function clearTapHandlers() { - clearTapTimer(); - - $this.unbind( "vclick", clickHandler ) - .unbind( "vmouseup", clearTapTimer ) - .unbind( "vmousecancel", clearTapHandlers ); - } - - function clickHandler(event) { - clearTapHandlers(); - - // ONLY trigger a 'tap' event if the start target is - // the same as the stop target. - if ( origTarget == event.target ) { - triggerCustomEvent( thisObject, "tap", event ); - } - } - - $this.bind( "vmousecancel", clearTapHandlers ) - .bind( "vmouseup", clearTapTimer ) - .bind( "vclick", clickHandler ); - - timer = setTimeout(function() { - triggerCustomEvent( thisObject, "taphold", $.Event( "taphold" ) ); - }, 750 ); - }); - } -}; - -// also handles swipeleft, swiperight -$.event.special.swipe = { - scrollSupressionThreshold: 10, // More than this horizontal displacement, and we will suppress scrolling. - - durationThreshold: 1000, // More time than this, and it isn't a swipe. - - horizontalDistanceThreshold: 30, // Swipe horizontal displacement must be more than this. - - verticalDistanceThreshold: 75, // Swipe vertical displacement must be less than this. - - setup: function() { - var thisObject = this, - $this = $( thisObject ); - - $this.bind( touchStartEvent, function( event ) { - var data = event.originalEvent.touches ? - event.originalEvent.touches[ 0 ] : event, - start = { - time: ( new Date() ).getTime(), - coords: [ data.pageX, data.pageY ], - origin: $( event.target ) - }, - stop; - - function moveHandler( event ) { - - if ( !start ) { - return; - } - - var data = event.originalEvent.touches ? - event.originalEvent.touches[ 0 ] : event; - - stop = { - time: ( new Date() ).getTime(), - coords: [ data.pageX, data.pageY ] - }; - - // prevent scrolling - if ( Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ) > $.event.special.swipe.scrollSupressionThreshold ) { - event.preventDefault(); - } - } - - $this.bind( touchMoveEvent, moveHandler ) - .one( touchStopEvent, function( event ) { - $this.unbind( touchMoveEvent, moveHandler ); - - if ( start && stop ) { - if ( stop.time - start.time < $.event.special.swipe.durationThreshold && - Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ) > $.event.special.swipe.horizontalDistanceThreshold && - Math.abs( start.coords[ 1 ] - stop.coords[ 1 ] ) < $.event.special.swipe.verticalDistanceThreshold ) { - - start.origin.trigger( "swipe" ) - .trigger( start.coords[0] > stop.coords[ 0 ] ? "swipeleft" : "swiperight" ); - } - } - start = stop = undefined; - }); - }); - } -}; - -(function( $, window ) { - // "Cowboy" Ben Alman - - var win = $( window ), - special_event, - get_orientation, - last_orientation; - - $.event.special.orientationchange = special_event = { - setup: function() { - // If the event is supported natively, return false so that jQuery - // will bind to the event using DOM methods. - if ( $.support.orientation && $.mobile.orientationChangeEnabled ) { - return false; - } - - // Get the current orientation to avoid initial double-triggering. - last_orientation = get_orientation(); - - // Because the orientationchange event doesn't exist, simulate the - // event by testing window dimensions on resize. - win.bind( "throttledresize", handler ); - }, - teardown: function(){ - // If the event is not supported natively, return false so that - // jQuery will unbind the event using DOM methods. - if ( $.support.orientation && $.mobile.orientationChangeEnabled ) { - return false; - } - - // Because the orientationchange event doesn't exist, unbind the - // resize event handler. - win.unbind( "throttledresize", handler ); - }, - add: function( handleObj ) { - // Save a reference to the bound event handler. - var old_handler = handleObj.handler; - - - handleObj.handler = function( event ) { - // Modify event object, adding the .orientation property. - event.orientation = get_orientation(); - - // Call the originally-bound event handler and return its result. - return old_handler.apply( this, arguments ); - }; - } - }; - - // If the event is not supported natively, this handler will be bound to - // the window resize event to simulate the orientationchange event. - function handler() { - // Get the current orientation. - var orientation = get_orientation(); - - if ( orientation !== last_orientation ) { - // The orientation has changed, so trigger the orientationchange event. - last_orientation = orientation; - win.trigger( "orientationchange" ); - } - } - - // Get the current page orientation. This method is exposed publicly, should it - // be needed, as jQuery.event.special.orientationchange.orientation() - $.event.special.orientationchange.orientation = get_orientation = function() { - var isPortrait = true, elem = document.documentElement; - - // prefer window orientation to the calculation based on screensize as - // the actual screen resize takes place before or after the orientation change event - // has been fired depending on implementation (eg android 2.3 is before, iphone after). - // More testing is required to determine if a more reliable method of determining the new screensize - // is possible when orientationchange is fired. (eg, use media queries + element + opacity) - if ( $.support.orientation ) { - // if the window orientation registers as 0 or 180 degrees report - // portrait, otherwise landscape - isPortrait = window.orientation % 180 == 0; - } else { - isPortrait = elem && elem.clientWidth / elem.clientHeight < 1.1; - } - - return isPortrait ? "portrait" : "landscape"; - }; - -})( jQuery, window ); - - -// throttled resize event -(function() { - - $.event.special.throttledresize = { - setup: function() { - $( this ).bind( "resize", handler ); - }, - teardown: function(){ - $( this ).unbind( "resize", handler ); - } - }; - - var throttle = 250, - handler = function() { - curr = ( new Date() ).getTime(); - diff = curr - lastCall; - - if ( diff >= throttle ) { - - lastCall = curr; - $( this ).trigger( "throttledresize" ); - - } else { - - if ( heldCall ) { - clearTimeout( heldCall ); - } - - // Promise a held call will still execute - heldCall = setTimeout( handler, throttle - diff ); - } - }, - lastCall = 0, - heldCall, - curr, - diff; -})(); - - -$.each({ - scrollstop: "scrollstart", - taphold: "tap", - swipeleft: "swipe", - swiperight: "swipe" -}, function( event, sourceEvent ) { - - $.event.special[ event ] = { - setup: function() { - $( this ).bind( sourceEvent, $.noop ); - } - }; -}); - -})( jQuery, this ); // Script: jQuery hashchange event -// +// // *Version: 1.3, Last updated: 7/21/2010* // // Project Home - http://benalman.com/projects/jquery-hashchange-plugin/ @@ -1374,8 +602,6 @@ $.each({ // part of jQuery BBQ, but also be available separately. (function($,window,undefined){ - '$:nomunge'; // Used by YUI compressor. - // Reused string. var str_hashchange = 'hashchange', @@ -1676,50 +902,345 @@ $.each({ })(); })(jQuery,this); -/* -* "page" plugin -*/ + +/*! + * jQuery UI Widget @VERSION + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Widget + */ (function( $, undefined ) { -$.widget( "mobile.page", $.mobile.widget, { - options: { - theme: "c", - domCache: false, - keepNativeDefault: ":jqmData(role='none'), :jqmData(role='nojs')" - }, +// jQuery 1.4+ +if ( $.cleanData ) { + var _cleanData = $.cleanData; + $.cleanData = function( elems ) { + for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { + $( elem ).triggerHandler( "remove" ); + } + _cleanData( elems ); + }; +} else { + var _remove = $.fn.remove; + $.fn.remove = function( selector, keepData ) { + return this.each(function() { + if ( !keepData ) { + if ( !selector || $.filter( selector, [ this ] ).length ) { + $( "*", this ).add( [ this ] ).each(function() { + $( this ).triggerHandler( "remove" ); + }); + } + } + return _remove.call( $(this), selector, keepData ); + }); + }; +} - _create: function() { +$.widget = function( name, base, prototype ) { + var namespace = name.split( "." )[ 0 ], + fullName; + name = name.split( "." )[ 1 ]; + fullName = namespace + "-" + name; - this._trigger( "beforecreate" ); + if ( !prototype ) { + prototype = base; + base = $.Widget; + } - this.element - .attr( "tabindex", "0" ) - .addClass( "ui-page ui-body-" + this.options.theme ); - }, + // create selector for plugin + $.expr[ ":" ][ fullName ] = function( elem ) { + return !!$.data( elem, name ); + }; - keepNativeSelector: function() { - var options = this.options, - keepNativeDefined = options.keepNative && $.trim(options.keepNative); + $[ namespace ] = $[ namespace ] || {}; + $[ namespace ][ name ] = function( options, element ) { + // allow instantiation without initializing for simple inheritance + if ( arguments.length ) { + this._createWidget( options, element ); + } + }; - if( keepNativeDefined && options.keepNative !== options.keepNativeDefault ){ - return [options.keepNative, options.keepNativeDefault].join(", "); + var basePrototype = new base(); + // we need to make the options hash a property directly on the new instance + // otherwise we'll modify the options hash on the prototype that we're + // inheriting from +// $.each( basePrototype, function( key, val ) { +// if ( $.isPlainObject(val) ) { +// basePrototype[ key ] = $.extend( {}, val ); +// } +// }); + basePrototype.options = $.extend( true, {}, basePrototype.options ); + $[ namespace ][ name ].prototype = $.extend( true, basePrototype, { + namespace: namespace, + widgetName: name, + widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name, + widgetBaseClass: fullName + }, prototype ); + + $.widget.bridge( name, $[ namespace ][ name ] ); +}; + +$.widget.bridge = function( name, object ) { + $.fn[ name ] = function( options ) { + var isMethodCall = typeof options === "string", + args = Array.prototype.slice.call( arguments, 1 ), + returnValue = this; + + // allow multiple hashes to be passed on init + options = !isMethodCall && args.length ? + $.extend.apply( null, [ true, options ].concat(args) ) : + options; + + // prevent calls to internal methods + if ( isMethodCall && options.charAt( 0 ) === "_" ) { + return returnValue; } - return options.keepNativeDefault; + if ( isMethodCall ) { + this.each(function() { + var instance = $.data( this, name ); + if ( !instance ) { + throw "cannot call methods on " + name + " prior to initialization; " + + "attempted to call method '" + options + "'"; + } + if ( !$.isFunction( instance[options] ) ) { + throw "no such method '" + options + "' for " + name + " widget instance"; + } + var methodValue = instance[ options ].apply( instance, args ); + if ( methodValue !== instance && methodValue !== undefined ) { + returnValue = methodValue; + return false; + } + }); + } else { + this.each(function() { + var instance = $.data( this, name ); + if ( instance ) { + instance.option( options || {} )._init(); + } else { + $.data( this, name, new object( options, this ) ); + } + }); + } + + return returnValue; + }; +}; + +$.Widget = function( options, element ) { + // allow instantiation without initializing for simple inheritance + if ( arguments.length ) { + this._createWidget( options, element ); + } +}; + +$.Widget.prototype = { + widgetName: "widget", + widgetEventPrefix: "", + options: { + disabled: false + }, + _createWidget: function( options, element ) { + // $.widget.bridge stores the plugin instance, but we do it anyway + // so that it's stored even before the _create function runs + $.data( element, this.widgetName, this ); + this.element = $( element ); + this.options = $.extend( true, {}, + this.options, + this._getCreateOptions(), + options ); + + var self = this; + this.element.bind( "remove." + this.widgetName, function() { + self.destroy(); + }); + + this._create(); + this._trigger( "create" ); + this._init(); + }, + _getCreateOptions: function() { + var options = {}; + if ( $.metadata ) { + options = $.metadata.get( element )[ this.widgetName ]; + } + return options; + }, + _create: function() {}, + _init: function() {}, + + destroy: function() { + this.element + .unbind( "." + this.widgetName ) + .removeData( this.widgetName ); + this.widget() + .unbind( "." + this.widgetName ) + .removeAttr( "aria-disabled" ) + .removeClass( + this.widgetBaseClass + "-disabled " + + "ui-state-disabled" ); + }, + + widget: function() { + return this.element; + }, + + option: function( key, value ) { + var options = key; + + if ( arguments.length === 0 ) { + // don't return a reference to the internal hash + return $.extend( {}, this.options ); + } + + if (typeof key === "string" ) { + if ( value === undefined ) { + return this.options[ key ]; + } + options = {}; + options[ key ] = value; + } + + this._setOptions( options ); + + return this; + }, + _setOptions: function( options ) { + var self = this; + $.each( options, function( key, value ) { + self._setOption( key, value ); + }); + + return this; + }, + _setOption: function( key, value ) { + this.options[ key ] = value; + + if ( key === "disabled" ) { + this.widget() + [ value ? "addClass" : "removeClass"]( + this.widgetBaseClass + "-disabled" + " " + + "ui-state-disabled" ) + .attr( "aria-disabled", value ); + } + + return this; + }, + + enable: function() { + return this._setOption( "disabled", false ); + }, + disable: function() { + return this._setOption( "disabled", true ); + }, + + _trigger: function( type, event, data ) { + var callback = this.options[ type ]; + + event = $.Event( event ); + event.type = ( type === this.widgetEventPrefix ? + type : + this.widgetEventPrefix + type ).toLowerCase(); + data = data || {}; + + // copy original event properties over to the new event + // this would happen if we could call $.event.fix instead of $.Event + // but we don't have a way to force an event to be fixed multiple times + if ( event.originalEvent ) { + for ( var i = $.event.props.length, prop; i; ) { + prop = $.event.props[ --i ]; + event[ prop ] = event.originalEvent[ prop ]; + } + } + + this.element.trigger( event, data ); + + return !( $.isFunction(callback) && + callback.call( this.element[0], event, data ) === false || + event.isDefaultPrevented() ); + } +}; + +})( jQuery ); + +(function( $, undefined ) { + +$.widget( "mobile.widget", { + // decorate the parent _createWidget to trigger `widgetinit` for users + // who wish to do post post `widgetcreate` alterations/additions + // + // TODO create a pull request for jquery ui to trigger this event + // in the original _createWidget + _createWidget: function() { + $.Widget.prototype._createWidget.apply( this, arguments ); + this._trigger( 'init' ); + }, + + _getCreateOptions: function() { + + var elem = this.element, + options = {}; + + $.each( this.options, function( option ) { + + var value = elem.jqmData( option.replace( /[A-Z]/g, function( c ) { + return "-" + c.toLowerCase(); + }) + ); + + if ( value !== undefined ) { + options[ option ] = value; + } + }); + + return options; + }, + + enhanceWithin: function( target, useKeepNative ) { + this.enhance( $( this.options.initSelector, $( target )), useKeepNative ); + }, + + enhance: function( targets, useKeepNative ) { + var page, keepNative, $widgetElements = $( targets ), self = this; + + // if ignoreContentEnabled is set to true the framework should + // only enhance the selected elements when they do NOT have a + // parent with the data-namespace-ignore attribute + $widgetElements = $.mobile.enhanceable( $widgetElements ); + + if ( useKeepNative && $widgetElements.length ) { + // TODO remove dependency on the page widget for the keepNative. + // Currently the keepNative value is defined on the page prototype so + // the method is as well + page = $.mobile.closestPageData( $widgetElements ); + keepNative = (page && page.keepNativeSelector()) || ""; + + $widgetElements = $widgetElements.not( keepNative ); + } + + $widgetElements[ this.widgetName ](); + }, + + raise: function( msg ) { + throw "Widget [" + this.widgetName + "]: " + msg; } }); + })( jQuery ); -/* -* "core" - The base file for jQm -*/ (function( $, window, undefined ) { var nsNormalizeDict = {}; // jQuery.mobile configurable options - $.extend( $.mobile, { + $.mobile = $.extend( {}, { + + // Version of the jQuery Mobile Framework + version: "1.1.0", // Namespace used framework-wide for data-attrs. Default is no namespace ns: "", @@ -1735,6 +1256,9 @@ $.widget( "mobile.page", $.mobile.widget, { // Class used for "active" button state, from CSS framework activeBtnClass: "ui-btn-active", + // Class used for "focus" form element state, from CSS framework + focusClass: "ui-focus", + // Automatically handle clicks and form submissions through Ajax, when same-domain ajaxEnabled: true, @@ -1745,11 +1269,17 @@ $.widget( "mobile.page", $.mobile.widget, { linkBindingEnabled: true, // Set default page transition - 'none' for no transitions - defaultPageTransition: "slide", + defaultPageTransition: "fade", + + // Set maximum window width for transitions to apply - 'false' for no limit + maxTransitionWidth: false, // Minimum scroll distance that will be remembered when returning to a page minScrollBack: 250, + // DEPRECATED: the following property is no longer in use, but defined until 2.0 to prevent conflicts + touchOverflowEnabled: false, + // Set default dialog transition - 'none' for no transitions defaultDialogTransition: "pop", @@ -1760,18 +1290,29 @@ $.widget( "mobile.page", $.mobile.widget, { // Error response message - appears when an Ajax page request fails pageLoadErrorMessage: "Error Loading Page", + // Should the text be visble in the loading message? + loadingMessageTextVisible: false, + + // When the text is visible, what theme does the loading box use? + loadingMessageTheme: "a", + + // For error messages, which theme does the box uses? + pageLoadErrorMessageTheme: "e", + //automatically initialize the DOM when it's ready autoInitializePage: true, pushStateEnabled: true, + // allows users to opt in to ignoring content by marking a parent element as + // data-ignored + ignoreContentEnabled: false, + // turn of binding to the native orientationchange due to android orientation behavior orientationChangeEnabled: true, - // Support conditions that must be met in order to proceed - // default enhanced qualifications are media query support OR IE 7+ - gradeA: function(){ - return $.support.mediaquery || $.mobile.browser.ie && $.mobile.browser.ie >= 7; + buttonMarkup: { + hoverDelay: 200 }, // TODO might be useful upstream in jquery itself ? @@ -1852,7 +1393,7 @@ $.widget( "mobile.page", $.mobile.widget, { var e = el[ 0 ], ltr = "", - re = /ui-(bar|body)-([a-z])\b/, + re = /ui-(bar|body|overlay)-([a-z])\b/, c, m; while ( e ) { @@ -1864,20 +1405,77 @@ $.widget( "mobile.page", $.mobile.widget, { } e = e.parentNode; } - + // Return the theme letter we found, if none, return the // specified default. return ltr || defaultTheme || "a"; + }, + + // TODO the following $ and $.fn extensions can/probably should be moved into jquery.mobile.core.helpers + // + // Find the closest javascript page element to gather settings data jsperf test + // http://jsperf.com/single-complex-selector-vs-many-complex-selectors/edit + // possibly naive, but it shows that the parsing overhead for *just* the page selector vs + // the page and dialog selector is negligable. This could probably be speed up by + // doing a similar parent node traversal to the one found in the inherited theme code above + closestPageData: function( $target ) { + return $target + .closest(':jqmData(role="page"), :jqmData(role="dialog")') + .data("page"); + }, + + enhanceable: function( $set ) { + return this.haveParents( $set, "enhance" ); + }, + + hijackable: function( $set ) { + return this.haveParents( $set, "ajax" ); + }, + + haveParents: function( $set, attr ) { + if( !$.mobile.ignoreContentEnabled ){ + return $set; + } + + var count = $set.length, + $newSet = $(), + e, $element, excluded; + + for ( var i = 0; i < count; i++ ) { + $element = $set.eq( i ); + excluded = false; + e = $set[ i ]; + + while ( e ) { + var c = e.getAttribute ? e.getAttribute( "data-" + $.mobile.ns + attr ) : ""; + + if ( c === "false" ) { + excluded = true; + break; + } + + e = e.parentNode; + } + + if ( !excluded ) { + $newSet = $newSet.add( $element ); + } + } + + return $newSet; } - }); + }, $.mobile ); // Mobile version of data and removeData and hasData methods // ensures all data is set and retrieved using jQuery Mobile's data namespace $.fn.jqmData = function( prop, value ) { var result; if ( typeof prop != "undefined" ) { - result = this.data( prop ? $.mobile.nsNormalize( prop ) : prop, value ); + if ( prop ) { + prop = $.mobile.nsNormalize( prop ); + } + result = this.data.apply( this, arguments.length < 2 ? [ prop ] : [ prop, value ] ); } return result; }; @@ -1926,6 +1524,15 @@ $.widget( "mobile.page", $.mobile.widget, { return $( "
          " ).text( $(this).text() ).html(); }; + // fluent helper function for the mobile namespaced equivalent + $.fn.jqmEnhanceable = function() { + return $.mobile.enhanceable( this ); + }; + + $.fn.jqmHijackable = function() { + return $.mobile.hijackable( this ); + }; + // Monkey-patching Sizzle to filter the :jqmData selector var oldFind = $.find, jqmDataRE = /:jqmData\(([^)]*)\)/g; @@ -1947,9 +1554,768 @@ $.widget( "mobile.page", $.mobile.widget, { }; })( jQuery, this ); -/* -* core utilities for auto ajax navigation, base tag mgmt, + +(function( $, undefined ) { + +var $window = $( window ), + $html = $( "html" ); + +/* $.mobile.media method: pass a CSS media type or query and get a bool return + note: this feature relies on actual media query support for media queries, though types will work most anywhere + examples: + $.mobile.media('screen') // tests for screen media type + $.mobile.media('screen and (min-width: 480px)') // tests for screen media type with window width > 480px + $.mobile.media('@media screen and (-webkit-min-device-pixel-ratio: 2)') // tests for webkit 2x pixel ratio (iPhone 4) */ +$.mobile.media = (function() { + // TODO: use window.matchMedia once at least one UA implements it + var cache = {}, + testDiv = $( "
          " ), + fakeBody = $( "" ).append( testDiv ); + + return function( query ) { + if ( !( query in cache ) ) { + var styleBlock = document.createElement( "style" ), + cssrule = "@media " + query + " { #jquery-mediatest { position:absolute; } }"; + + //must set type for IE! + styleBlock.type = "text/css"; + + if ( styleBlock.styleSheet ){ + styleBlock.styleSheet.cssText = cssrule; + } else { + styleBlock.appendChild( document.createTextNode(cssrule) ); + } + + $html.prepend( fakeBody ).prepend( styleBlock ); + cache[ query ] = testDiv.css( "position" ) === "absolute"; + fakeBody.add( styleBlock ).remove(); + } + return cache[ query ]; + }; +})(); + +})(jQuery); + +(function( $, undefined ) { + +var fakeBody = $( "" ).prependTo( "html" ), + fbCSS = fakeBody[ 0 ].style, + vendors = [ "Webkit", "Moz", "O" ], + webos = "palmGetResource" in window, //only used to rule out scrollTop + operamini = window.operamini && ({}).toString.call( window.operamini ) === "[object OperaMini]", + bb = window.blackberry; //only used to rule out box shadow, as it's filled opaque on BB + +// thx Modernizr +function propExists( prop ) { + var uc_prop = prop.charAt( 0 ).toUpperCase() + prop.substr( 1 ), + props = ( prop + " " + vendors.join( uc_prop + " " ) + uc_prop ).split( " " ); + + for ( var v in props ){ + if ( fbCSS[ props[ v ] ] !== undefined ) { + return true; + } + } +} + +function validStyle( prop, value, check_vend ) { + var div = document.createElement('div'), + uc = function( txt ) { + return txt.charAt( 0 ).toUpperCase() + txt.substr( 1 ) + }, + vend_pref = function( vend ) { + return "-" + vend.charAt( 0 ).toLowerCase() + vend.substr( 1 ) + "-"; + }, + check_style = function( vend ) { + var vend_prop = vend_pref( vend ) + prop + ": " + value + ";", + uc_vend = uc( vend ), + propStyle = uc_vend + uc( prop ); + + div.setAttribute( "style", vend_prop ); + + if( !!div.style[ propStyle ] ) { + ret = true; + } + }, + check_vends = check_vend ? [ check_vend ] : vendors, + ret; + + for( i = 0; i < check_vends.length; i++ ) { + check_style( check_vends[i] ); + } + return !!ret; +} + +// Thanks to Modernizr src for this test idea. `perspective` check is limited to Moz to prevent a false positive for 3D transforms on Android. +function transform3dTest() { + var prop = "transform-3d"; + return validStyle( 'perspective', '10px', 'moz' ) || $.mobile.media( "(-" + vendors.join( "-" + prop + "),(-" ) + "-" + prop + "),(" + prop + ")" ); +} + +// Test for dynamic-updating base tag support ( allows us to avoid href,src attr rewriting ) +function baseTagTest() { + var fauxBase = location.protocol + "//" + location.host + location.pathname + "ui-dir/", + base = $( "head base" ), + fauxEle = null, + href = "", + link, rebase; + + if ( !base.length ) { + base = fauxEle = $( "", { "href": fauxBase }).appendTo( "head" ); + } else { + href = base.attr( "href" ); + } + + link = $( "" ).prependTo( fakeBody ); + rebase = link[ 0 ].href; + base[ 0 ].href = href || location.pathname; + + if ( fauxEle ) { + fauxEle.remove(); + } + return rebase.indexOf( fauxBase ) === 0; +} + + +// non-UA-based IE version check by James Padolsey, modified by jdalton - from http://gist.github.com/527683 +// allows for inclusion of IE 6+, including Windows Mobile 7 +$.extend( $.mobile, { browser: {} } ); +$.mobile.browser.ie = (function() { + var v = 3, + div = document.createElement( "div" ), + a = div.all || []; + + // added {} to silence closure compiler warnings. registering my dislike of all things + // overly clever here for future reference + while ( div.innerHTML = "", a[ 0 ] ){}; + + return v > 4 ? v : !v; +})(); + + +$.extend( $.support, { + orientation: "orientation" in window && "onorientationchange" in window, + touch: "ontouchend" in document, + cssTransitions: "WebKitTransitionEvent" in window || validStyle( 'transition', 'height 100ms linear' ), + pushState: "pushState" in history && "replaceState" in history, + mediaquery: $.mobile.media( "only all" ), + cssPseudoElement: !!propExists( "content" ), + touchOverflow: !!propExists( "overflowScrolling" ), + cssTransform3d: transform3dTest(), + boxShadow: !!propExists( "boxShadow" ) && !bb, + scrollTop: ( "pageXOffset" in window || "scrollTop" in document.documentElement || "scrollTop" in fakeBody[ 0 ] ) && !webos && !operamini, + dynamicBaseTag: baseTagTest() +}); + +fakeBody.remove(); + + +// $.mobile.ajaxBlacklist is used to override ajaxEnabled on platforms that have known conflicts with hash history updates (BB5, Symbian) +// or that generally work better browsing in regular http for full page refreshes (Opera Mini) +// Note: This detection below is used as a last resort. +// We recommend only using these detection methods when all other more reliable/forward-looking approaches are not possible +var nokiaLTE7_3 = (function(){ + + var ua = window.navigator.userAgent; + + //The following is an attempt to match Nokia browsers that are running Symbian/s60, with webkit, version 7.3 or older + return ua.indexOf( "Nokia" ) > -1 && + ( ua.indexOf( "Symbian/3" ) > -1 || ua.indexOf( "Series60/5" ) > -1 ) && + ua.indexOf( "AppleWebKit" ) > -1 && + ua.match( /(BrowserNG|NokiaBrowser)\/7\.[0-3]/ ); +})(); + +// Support conditions that must be met in order to proceed +// default enhanced qualifications are media query support OR IE 7+ +$.mobile.gradeA = function(){ + return $.support.mediaquery || $.mobile.browser.ie && $.mobile.browser.ie >= 7; +}; + +$.mobile.ajaxBlacklist = + // BlackBerry browsers, pre-webkit + window.blackberry && !window.WebKitPoint || + // Opera Mini + operamini || + // Symbian webkits pre 7.3 + nokiaLTE7_3; + +// Lastly, this workaround is the only way we've found so far to get pre 7.3 Symbian webkit devices +// to render the stylesheets when they're referenced before this script, as we'd recommend doing. +// This simply reappends the CSS in place, which for some reason makes it apply +if ( nokiaLTE7_3 ) { + $(function() { + $( "head link[rel='stylesheet']" ).attr( "rel", "alternate stylesheet" ).attr( "rel", "stylesheet" ); + }); +} + +// For ruling out shadows via css +if ( !$.support.boxShadow ) { + $( "html" ).addClass( "ui-mobile-nosupport-boxshadow" ); +} + +})( jQuery ); + +(function( $, window, undefined ) { + +// add new event shortcuts +$.each( ( "touchstart touchmove touchend orientationchange throttledresize " + + "tap taphold swipe swipeleft swiperight scrollstart scrollstop" ).split( " " ), function( i, name ) { + + $.fn[ name ] = function( fn ) { + return fn ? this.bind( name, fn ) : this.trigger( name ); + }; + + $.attrFn[ name ] = true; +}); + +var supportTouch = $.support.touch, + scrollEvent = "touchmove scroll", + touchStartEvent = supportTouch ? "touchstart" : "mousedown", + touchStopEvent = supportTouch ? "touchend" : "mouseup", + touchMoveEvent = supportTouch ? "touchmove" : "mousemove"; + +function triggerCustomEvent( obj, eventType, event ) { + var originalType = event.type; + event.type = eventType; + $.event.handle.call( obj, event ); + event.type = originalType; +} + +// also handles scrollstop +$.event.special.scrollstart = { + + enabled: true, + + setup: function() { + + var thisObject = this, + $this = $( thisObject ), + scrolling, + timer; + + function trigger( event, state ) { + scrolling = state; + triggerCustomEvent( thisObject, scrolling ? "scrollstart" : "scrollstop", event ); + } + + // iPhone triggers scroll after a small delay; use touchmove instead + $this.bind( scrollEvent, function( event ) { + + if ( !$.event.special.scrollstart.enabled ) { + return; + } + + if ( !scrolling ) { + trigger( event, true ); + } + + clearTimeout( timer ); + timer = setTimeout(function() { + trigger( event, false ); + }, 50 ); + }); + } +}; + +// also handles taphold +$.event.special.tap = { + setup: function() { + var thisObject = this, + $this = $( thisObject ); + + $this.bind( "vmousedown", function( event ) { + + if ( event.which && event.which !== 1 ) { + return false; + } + + var origTarget = event.target, + origEvent = event.originalEvent, + timer; + + function clearTapTimer() { + clearTimeout( timer ); + } + + function clearTapHandlers() { + clearTapTimer(); + + $this.unbind( "vclick", clickHandler ) + .unbind( "vmouseup", clearTapTimer ); + $( document ).unbind( "vmousecancel", clearTapHandlers ); + } + + function clickHandler(event) { + clearTapHandlers(); + + // ONLY trigger a 'tap' event if the start target is + // the same as the stop target. + if ( origTarget == event.target ) { + triggerCustomEvent( thisObject, "tap", event ); + } + } + + $this.bind( "vmouseup", clearTapTimer ) + .bind( "vclick", clickHandler ); + $( document ).bind( "vmousecancel", clearTapHandlers ); + + timer = setTimeout(function() { + triggerCustomEvent( thisObject, "taphold", $.Event( "taphold", { target: origTarget } ) ); + }, 750 ); + }); + } +}; + +// also handles swipeleft, swiperight +$.event.special.swipe = { + scrollSupressionThreshold: 10, // More than this horizontal displacement, and we will suppress scrolling. + + durationThreshold: 1000, // More time than this, and it isn't a swipe. + + horizontalDistanceThreshold: 30, // Swipe horizontal displacement must be more than this. + + verticalDistanceThreshold: 75, // Swipe vertical displacement must be less than this. + + setup: function() { + var thisObject = this, + $this = $( thisObject ); + + $this.bind( touchStartEvent, function( event ) { + var data = event.originalEvent.touches ? + event.originalEvent.touches[ 0 ] : event, + start = { + time: ( new Date() ).getTime(), + coords: [ data.pageX, data.pageY ], + origin: $( event.target ) + }, + stop; + + function moveHandler( event ) { + + if ( !start ) { + return; + } + + var data = event.originalEvent.touches ? + event.originalEvent.touches[ 0 ] : event; + + stop = { + time: ( new Date() ).getTime(), + coords: [ data.pageX, data.pageY ] + }; + + // prevent scrolling + if ( Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ) > $.event.special.swipe.scrollSupressionThreshold ) { + event.preventDefault(); + } + } + + $this.bind( touchMoveEvent, moveHandler ) + .one( touchStopEvent, function( event ) { + $this.unbind( touchMoveEvent, moveHandler ); + + if ( start && stop ) { + if ( stop.time - start.time < $.event.special.swipe.durationThreshold && + Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ) > $.event.special.swipe.horizontalDistanceThreshold && + Math.abs( start.coords[ 1 ] - stop.coords[ 1 ] ) < $.event.special.swipe.verticalDistanceThreshold ) { + + start.origin.trigger( "swipe" ) + .trigger( start.coords[0] > stop.coords[ 0 ] ? "swipeleft" : "swiperight" ); + } + } + start = stop = undefined; + }); + }); + } +}; + +(function( $, window ) { + // "Cowboy" Ben Alman + + var win = $( window ), + special_event, + get_orientation, + last_orientation, + initial_orientation_is_landscape, + initial_orientation_is_default, + portrait_map = { "0": true, "180": true }; + + // It seems that some device/browser vendors use window.orientation values 0 and 180 to + // denote the "default" orientation. For iOS devices, and most other smart-phones tested, + // the default orientation is always "portrait", but in some Android and RIM based tablets, + // the default orientation is "landscape". The following code attempts to use the window + // dimensions to figure out what the current orientation is, and then makes adjustments + // to the to the portrait_map if necessary, so that we can properly decode the + // window.orientation value whenever get_orientation() is called. + // + // Note that we used to use a media query to figure out what the orientation the browser + // thinks it is in: + // + // initial_orientation_is_landscape = $.mobile.media("all and (orientation: landscape)"); + // + // but there was an iPhone/iPod Touch bug beginning with iOS 4.2, up through iOS 5.1, + // where the browser *ALWAYS* applied the landscape media query. This bug does not + // happen on iPad. + + if ( $.support.orientation ) { + + // Check the window width and height to figure out what the current orientation + // of the device is at this moment. Note that we've initialized the portrait map + // values to 0 and 180, *AND* we purposely check for landscape so that if we guess + // wrong, , we default to the assumption that portrait is the default orientation. + // We use a threshold check below because on some platforms like iOS, the iPhone + // form-factor can report a larger width than height if the user turns on the + // developer console. The actual threshold value is somewhat arbitrary, we just + // need to make sure it is large enough to exclude the developer console case. + + var ww = window.innerWidth || $( window ).width(), + wh = window.innerHeight || $( window ).height(), + landscape_threshold = 50; + + initial_orientation_is_landscape = ww > wh && ( ww - wh ) > landscape_threshold; + + + // Now check to see if the current window.orientation is 0 or 180. + initial_orientation_is_default = portrait_map[ window.orientation ]; + + // If the initial orientation is landscape, but window.orientation reports 0 or 180, *OR* + // if the initial orientation is portrait, but window.orientation reports 90 or -90, we + // need to flip our portrait_map values because landscape is the default orientation for + // this device/browser. + if ( ( initial_orientation_is_landscape && initial_orientation_is_default ) || ( !initial_orientation_is_landscape && !initial_orientation_is_default ) ) { + portrait_map = { "-90": true, "90": true }; + } + } + + $.event.special.orientationchange = special_event = { + setup: function() { + // If the event is supported natively, return false so that jQuery + // will bind to the event using DOM methods. + if ( $.support.orientation && $.mobile.orientationChangeEnabled ) { + return false; + } + + // Get the current orientation to avoid initial double-triggering. + last_orientation = get_orientation(); + + // Because the orientationchange event doesn't exist, simulate the + // event by testing window dimensions on resize. + win.bind( "throttledresize", handler ); + }, + teardown: function(){ + // If the event is not supported natively, return false so that + // jQuery will unbind the event using DOM methods. + if ( $.support.orientation && $.mobile.orientationChangeEnabled ) { + return false; + } + + // Because the orientationchange event doesn't exist, unbind the + // resize event handler. + win.unbind( "throttledresize", handler ); + }, + add: function( handleObj ) { + // Save a reference to the bound event handler. + var old_handler = handleObj.handler; + + + handleObj.handler = function( event ) { + // Modify event object, adding the .orientation property. + event.orientation = get_orientation(); + + // Call the originally-bound event handler and return its result. + return old_handler.apply( this, arguments ); + }; + } + }; + + // If the event is not supported natively, this handler will be bound to + // the window resize event to simulate the orientationchange event. + function handler() { + // Get the current orientation. + var orientation = get_orientation(); + + if ( orientation !== last_orientation ) { + // The orientation has changed, so trigger the orientationchange event. + last_orientation = orientation; + win.trigger( "orientationchange" ); + } + } + + // Get the current page orientation. This method is exposed publicly, should it + // be needed, as jQuery.event.special.orientationchange.orientation() + $.event.special.orientationchange.orientation = get_orientation = function() { + var isPortrait = true, elem = document.documentElement; + + // prefer window orientation to the calculation based on screensize as + // the actual screen resize takes place before or after the orientation change event + // has been fired depending on implementation (eg android 2.3 is before, iphone after). + // More testing is required to determine if a more reliable method of determining the new screensize + // is possible when orientationchange is fired. (eg, use media queries + element + opacity) + if ( $.support.orientation ) { + // if the window orientation registers as 0 or 180 degrees report + // portrait, otherwise landscape + isPortrait = portrait_map[ window.orientation ]; + } else { + isPortrait = elem && elem.clientWidth / elem.clientHeight < 1.1; + } + + return isPortrait ? "portrait" : "landscape"; + }; + +})( jQuery, window ); + + +// throttled resize event +(function() { + + $.event.special.throttledresize = { + setup: function() { + $( this ).bind( "resize", handler ); + }, + teardown: function(){ + $( this ).unbind( "resize", handler ); + } + }; + + var throttle = 250, + handler = function() { + curr = ( new Date() ).getTime(); + diff = curr - lastCall; + + if ( diff >= throttle ) { + + lastCall = curr; + $( this ).trigger( "throttledresize" ); + + } else { + + if ( heldCall ) { + clearTimeout( heldCall ); + } + + // Promise a held call will still execute + heldCall = setTimeout( handler, throttle - diff ); + } + }, + lastCall = 0, + heldCall, + curr, + diff; +})(); + + +$.each({ + scrollstop: "scrollstart", + taphold: "tap", + swipeleft: "swipe", + swiperight: "swipe" +}, function( event, sourceEvent ) { + + $.event.special[ event ] = { + setup: function() { + $( this ).bind( sourceEvent, $.noop ); + } + }; +}); + +})( jQuery, this ); + +(function( $, undefined ) { + +$.widget( "mobile.page", $.mobile.widget, { + options: { + theme: "c", + domCache: false, + keepNativeDefault: ":jqmData(role='none'), :jqmData(role='nojs')" + }, + + _create: function() { + + var self = this; + + // if false is returned by the callbacks do not create the page + if( self._trigger( "beforecreate" ) === false ){ + return false; + } + + self.element + .attr( "tabindex", "0" ) + .addClass( "ui-page ui-body-" + self.options.theme ) + .bind( "pagebeforehide", function(){ + self.removeContainerBackground(); + } ) + .bind( "pagebeforeshow", function(){ + self.setContainerBackground(); + } ); + + }, + + removeContainerBackground: function(){ + $.mobile.pageContainer.removeClass( "ui-overlay-" + $.mobile.getInheritedTheme( this.element.parent() ) ); + }, + + // set the page container background to the page theme + setContainerBackground: function( theme ){ + if( this.options.theme ){ + $.mobile.pageContainer.addClass( "ui-overlay-" + ( theme || this.options.theme ) ); + } + }, + + keepNativeSelector: function() { + var options = this.options, + keepNativeDefined = options.keepNative && $.trim(options.keepNative); + + if( keepNativeDefined && options.keepNative !== options.keepNativeDefault ){ + return [options.keepNative, options.keepNativeDefault].join(", "); + } + + return options.keepNativeDefault; + } +}); +})( jQuery ); + + +(function( $, window, undefined ) { + +var createHandler = function( sequential ){ + + // Default to sequential + if( sequential === undefined ){ + sequential = true; + } + + return function( name, reverse, $to, $from ) { + + var deferred = new $.Deferred(), + reverseClass = reverse ? " reverse" : "", + active = $.mobile.urlHistory.getActive(), + toScroll = active.lastScroll || $.mobile.defaultHomeScroll, + screenHeight = $.mobile.getScreenHeight(), + maxTransitionOverride = $.mobile.maxTransitionWidth !== false && $( window ).width() > $.mobile.maxTransitionWidth, + none = !$.support.cssTransitions || maxTransitionOverride || !name || name === "none", + toggleViewportClass = function(){ + $.mobile.pageContainer.toggleClass( "ui-mobile-viewport-transitioning viewport-" + name ); + }, + scrollPage = function(){ + // By using scrollTo instead of silentScroll, we can keep things better in order + // Just to be precautios, disable scrollstart listening like silentScroll would + $.event.special.scrollstart.enabled = false; + + window.scrollTo( 0, toScroll ); + + // reenable scrollstart listening like silentScroll would + setTimeout(function() { + $.event.special.scrollstart.enabled = true; + }, 150 ); + }, + cleanFrom = function(){ + $from + .removeClass( $.mobile.activePageClass + " out in reverse " + name ) + .height( "" ); + }, + startOut = function(){ + // if it's not sequential, call the doneOut transition to start the TO page animating in simultaneously + if( !sequential ){ + doneOut(); + } + else { + $from.animationComplete( doneOut ); + } + + // Set the from page's height and start it transitioning out + // Note: setting an explicit height helps eliminate tiling in the transitions + $from + .height( screenHeight + $(window ).scrollTop() ) + .addClass( name + " out" + reverseClass ); + }, + + doneOut = function() { + + if ( $from && sequential ) { + cleanFrom(); + } + + startIn(); + }, + + startIn = function(){ + + $to.addClass( $.mobile.activePageClass ); + + // Send focus to page as it is now display: block + $.mobile.focusPage( $to ); + + // Set to page height + $to.height( screenHeight + toScroll ); + + scrollPage(); + + if( !none ){ + $to.animationComplete( doneIn ); + } + + $to.addClass( name + " in" + reverseClass ); + + if( none ){ + doneIn(); + } + + }, + + doneIn = function() { + + if ( !sequential ) { + + if( $from ){ + cleanFrom(); + } + } + + $to + .removeClass( "out in reverse " + name ) + .height( "" ); + + toggleViewportClass(); + + // In some browsers (iOS5), 3D transitions block the ability to scroll to the desired location during transition + // This ensures we jump to that spot after the fact, if we aren't there already. + if( $( window ).scrollTop() !== toScroll ){ + scrollPage(); + } + + deferred.resolve( name, reverse, $to, $from, true ); + }; + + toggleViewportClass(); + + if ( $from && !none ) { + startOut(); + } + else { + doneOut(); + } + + return deferred.promise(); + }; +} + +// generate the handlers from the above +var sequentialHandler = createHandler(), + simultaneousHandler = createHandler( false ); + +// Make our transition handler the public default. +$.mobile.defaultTransitionHandler = sequentialHandler; + +//transition handler dictionary for 3rd party transitions +$.mobile.transitionHandlers = { + "default": $.mobile.defaultTransitionHandler, + "sequential": sequentialHandler, + "simultaneous": simultaneousHandler +}; + +$.mobile.transitionFallbacks = {}; + +})( jQuery, this ); ( function( $, undefined ) { @@ -2319,8 +2685,14 @@ $.widget( "mobile.page", $.mobile.widget, { //direct focus to the page title, or otherwise first focusable element - function reFocus( page ) { - var pageTitle = page.find( ".ui-title:eq(0)" ); + $.mobile.focusPage = function ( page ) { + var autofocus = page.find("[autofocus]"), + pageTitle = page.find( ".ui-title:eq(0)" ); + + if( autofocus.length ) { + autofocus.focus(); + return; + } if( pageTitle.length ) { pageTitle.focus(); @@ -2347,21 +2719,9 @@ $.widget( "mobile.page", $.mobile.widget, { // Save the last scroll distance per page, before it is hidden var setLastScrollEnabled = true, - firstScrollElem, getScrollElem, setLastScroll, delayedSetLastScroll; + setLastScroll, delayedSetLastScroll; - getScrollElem = function() { - var scrollElem = $window, activePage, - touchOverflow = $.support.touchOverflow && $.mobile.touchOverflowEnabled; - - if( touchOverflow ){ - activePage = $( ".ui-page-active" ); - scrollElem = activePage.is( ".ui-native-fixed" ) ? activePage.find( ".ui-content" ) : activePage; - } - - return scrollElem; - }; - - setLastScroll = function( scrollElem ) { + setLastScroll = function() { // this barrier prevents setting the scroll value based on the browser // scrolling the window based on a hashchange if( !setLastScrollEnabled ) { @@ -2371,7 +2731,7 @@ $.widget( "mobile.page", $.mobile.widget, { var active = $.mobile.urlHistory.getActive(); if( active ) { - var lastScroll = scrollElem && scrollElem.scrollTop(); + var lastScroll = $window.scrollTop(); // Set active page's lastScroll prop. // If the location we're scrolling to is less than minScrollBack, let it go. @@ -2384,14 +2744,14 @@ $.widget( "mobile.page", $.mobile.widget, { // to the hash targets location (sometimes the top of the page). once pagechange fires // getLastScroll is again permitted to operate delayedSetLastScroll = function() { - setTimeout( setLastScroll, 100, $(this) ); + setTimeout( setLastScroll, 100 ); }; // disable an scroll setting when a hashchange has been fired, this only works // because the recording of the scroll position is delayed for 100ms after // the browser might have changed the position because of the hashchange $window.bind( $.support.pushState ? "popstate" : "hashchange", function() { - setLastScrollEnabled = false; + setLastScrollEnabled = false; }); // handle initial hashchange from chrome :( @@ -2403,103 +2763,51 @@ $.widget( "mobile.page", $.mobile.widget, { $window.one( "pagecontainercreate", function(){ // once the page has changed, re-enable the scroll recording $.mobile.pageContainer.bind( "pagechange", function() { - var scrollElem = getScrollElem(); - setLastScrollEnabled = true; + setLastScrollEnabled = true; // remove any binding that previously existed on the get scroll // which may or may not be different than the scroll element determined for // this page previously - scrollElem.unbind( "scrollstop", delayedSetLastScroll ); + $window.unbind( "scrollstop", delayedSetLastScroll ); // determine and bind to the current scoll element which may be the window // or in the case of touch overflow the element with touch overflow - scrollElem.bind( "scrollstop", delayedSetLastScroll ); + $window.bind( "scrollstop", delayedSetLastScroll ); }); }); // bind to scrollstop for the first page as "pagechange" won't be fired in that case - getScrollElem().bind( "scrollstop", delayedSetLastScroll ); - - // Make the iOS clock quick-scroll work again if we're using native overflow scrolling - /* - if( $.support.touchOverflow ){ - if( $.mobile.touchOverflowEnabled ){ - $( window ).bind( "scrollstop", function(){ - if( $( this ).scrollTop() === 0 ){ - $.mobile.activePage.scrollTop( 0 ); - } - }); - } - } - */ + $window.bind( "scrollstop", delayedSetLastScroll ); //function for transitioning between two existing pages function transitionPages( toPage, fromPage, transition, reverse ) { - //get current scroll distance - var active = $.mobile.urlHistory.getActive(), - touchOverflow = $.support.touchOverflow && $.mobile.touchOverflowEnabled, - toScroll = active.lastScroll || ( touchOverflow ? 0 : $.mobile.defaultHomeScroll ), - screenHeight = getScreenHeight(); - - // Scroll to top, hide addr bar - window.scrollTo( 0, $.mobile.defaultHomeScroll ); - if( fromPage ) { //trigger before show/hide events fromPage.data( "page" )._trigger( "beforehide", null, { nextPage: toPage } ); } - if( !touchOverflow){ - toPage.height( screenHeight + toScroll ); - } - toPage.data( "page" )._trigger( "beforeshow", null, { prevPage: fromPage || $( "" ) } ); //clear page loader $.mobile.hidePageLoadingMsg(); - if( touchOverflow && toScroll ){ - - toPage.addClass( "ui-mobile-pre-transition" ); - // Send focus to page as it is now display: block - reFocus( toPage ); - - //set page's scrollTop to remembered distance - if( toPage.is( ".ui-native-fixed" ) ){ - toPage.find( ".ui-content" ).scrollTop( toScroll ); - } - else{ - toPage.scrollTop( toScroll ); - } + // If transition is defined, check if css 3D transforms are supported, and if not, if a fallback is specified + if( transition && !$.support.cssTransform3d && $.mobile.transitionFallbacks[ transition ] ){ + transition = $.mobile.transitionFallbacks[ transition ]; } //find the transition handler for the specified transition. If there //isn't one in our transitionHandlers dictionary, use the default one. //call the handler immediately to kick-off the transition. - var th = $.mobile.transitionHandlers[transition || "none"] || $.mobile.defaultTransitionHandler, + var th = $.mobile.transitionHandlers[ transition || "default" ] || $.mobile.defaultTransitionHandler, promise = th( transition, reverse, toPage, fromPage ); promise.done(function() { - //reset toPage height back - if( !touchOverflow ){ - toPage.height( "" ); - // Send focus to the newly shown page - reFocus( toPage ); - } - - // Jump to top or prev scroll, sometimes on iOS the page has not rendered yet. - if( !touchOverflow ){ - $.mobile.silentScroll( toScroll ); - } //trigger show/hide events if( fromPage ) { - if( !touchOverflow ){ - fromPage.height( "" ); - } - fromPage.data( "page" )._trigger( "hide", null, { nextPage: toPage } ); } @@ -2512,25 +2820,20 @@ $.widget( "mobile.page", $.mobile.widget, { //simply set the active page's minimum height to screen height, depending on orientation function getScreenHeight(){ - var orientation = $.event.special.orientationchange.orientation(), - port = orientation === "portrait", - winMin = port ? 480 : 320, - screenHeight = port ? screen.availHeight : screen.availWidth, - winHeight = Math.max( winMin, $( window ).height() ), - pageMin = Math.min( screenHeight, winHeight ); - - return pageMin; + // Native innerHeight returns more accurate value for this across platforms, + // jQuery version is here as a normalized fallback for platforms like Symbian + return window.innerHeight || $( window ).height(); } $.mobile.getScreenHeight = getScreenHeight; //simply set the active page's minimum height to screen height, depending on orientation function resetActivePageHeight(){ - // Don't apply this height in touch overflow enabled mode - if( $.support.touchOverflow && $.mobile.touchOverflowEnabled ){ - return; - } - $( "." + $.mobile.activePageClass ).css( "min-height", getScreenHeight() ); + var aPage = $( "." + $.mobile.activePageClass ), + aPagePadT = parseFloat( aPage.css( "padding-top" ) ), + aPagePadB = parseFloat( aPage.css( "padding-bottom" ) ); + + aPage.css( "min-height", getScreenHeight() - aPagePadT - aPagePadB ); } //shared page enhancements @@ -2550,7 +2853,7 @@ $.widget( "mobile.page", $.mobile.widget, { //animation complete callback $.fn.animationComplete = function( callback ) { if( $.support.cssTransitions ) { - return $( this ).one( 'webkitAnimationEnd', callback ); + return $( this ).one( 'webkitAnimationEnd animationend', callback ); } else{ // defer execution for consistency between webkit/non webkit @@ -2570,23 +2873,7 @@ $.widget( "mobile.page", $.mobile.widget, { $.mobile.dialogHashKey = dialogHashKey; - //default non-animation transition handler - $.mobile.noneTransitionHandler = function( name, reverse, $toPage, $fromPage ) { - if ( $fromPage ) { - $fromPage.removeClass( $.mobile.activePageClass ); - } - $toPage.addClass( $.mobile.activePageClass ); - return $.Deferred().resolve( name, reverse, $toPage, $fromPage ).promise(); - }; - - //default handler for unknown transitions - $.mobile.defaultTransitionHandler = $.mobile.noneTransitionHandler; - - //transition handler dictionary for 3rd party transitions - $.mobile.transitionHandlers = { - none: $.mobile.defaultTransitionHandler - }; //enable cross-domain page support $.mobile.allowCrossDomainPages = false; @@ -2693,6 +2980,7 @@ $.widget( "mobile.page", $.mobile.widget, { // refers to the first page in the application. If it isn't a reference // to the first page and refers to non-existent embedded page, error out. if ( page.length === 0 ) { + //john try scroll to here alert('test' + dataUrl + ' | ' + page.length); if ( $.mobile.firstPage && path.isFirstPageUrl( fileUrl ) ) { // Check to make sure our cached-first-page is actually // in the DOM. Some user deployed apps are pruning the first @@ -2897,14 +3185,11 @@ $.widget( "mobile.page", $.mobile.widget, { // Remove loading message. hideMsg(); - //show error message - $( "

          "+ $.mobile.pageLoadErrorMessage +"

          " ) - .css({ "display": "block", "opacity": 0.96, "top": $window.scrollTop() + 100 }) - .appendTo( settings.pageContainer ) - .delay( 800 ) - .fadeOut( 400, function() { - $( this ).remove(); - }); + // show error message + $.mobile.showPageLoadingMsg( $.mobile.pageLoadErrorMessageTheme, $.mobile.pageLoadErrorMessage, true ); + + // hide after delay + setTimeout( $.mobile.hidePageLoadingMsg, 1500 ); } deferred.reject( absUrl, options ); @@ -3010,7 +3295,6 @@ $.widget( "mobile.page", $.mobile.widget, { historyDir = 0, pageTitle = document.title, isDialog = settings.role === "dialog" || toPage.jqmData( "role" ) === "dialog"; - // By default, we prevent changePage requests when the fromPage and toPage // are the same element, but folks that generate content manually/dynamically // and reuse pages want to be able to transition to the same page. To allow @@ -3043,7 +3327,7 @@ $.widget( "mobile.page", $.mobile.widget, { // Kill the keyboard. // XXX_jblas: We need to stop crawling the entire document to kill focus. Instead, - // we should be tracking focus with a live() handler so we already have + // we should be tracking focus with a delegate() handler so we already have // the element in hand at this point. // Wrap this in a try/catch block since IE9 throw "Unspecified error" if document.activeElement // is undefined when we are in an IFrame. @@ -3104,7 +3388,7 @@ $.widget( "mobile.page", $.mobile.widget, { settings.reverse = settings.reverse || historyDir < 0; transitionPages( toPage, fromPage, settings.transition, settings.reverse ) - .done(function() { + .done(function( name, reverse, $to, $from, alreadyFocused ) { removeActiveLinkClass(); //if there's a duplicateCachedPage, remove it from the DOM now that it's hidden @@ -3112,8 +3396,13 @@ $.widget( "mobile.page", $.mobile.widget, { settings.duplicateCachedPage.remove(); } - //remove initial build class (only present on first pageshow) - $html.removeClass( "ui-mobile-rendering" ); + // Send focus to the newly shown page. Moved from promise .done binding in transitionPages + // itself to avoid ie bug that reports offsetWidth as > 0 (core check for visibility) + // despite visibility: hidden addresses issue #2965 + // https://github.com/jquery/jquery-mobile/issues/2965 + if( !alreadyFocused ){ + $.mobile.focusPage( toPage ); + } releasePageTransitionLock(); @@ -3175,12 +3464,17 @@ $.widget( "mobile.page", $.mobile.widget, { $.mobile._registerInternalEvents = function(){ //bind to form submit events, handle with Ajax - $( "form" ).live('submit', function( event ) { + $( document ).delegate( "form", "submit", function( event ) { var $this = $( this ); + if( !$.mobile.ajaxEnabled || - $this.is( ":jqmData(ajax='false')" ) ) { - return; - } + // test that the form is, itself, ajax false + $this.is(":jqmData(ajax='false')") || + // test that $.mobile.ignoreContentEnabled is set and + // the form or one of it's parents is ajax=false + !$this.jqmHijackable().length ) { + return; + } var type = $this.attr( "method" ), target = $this.attr( "target" ), @@ -3226,18 +3520,31 @@ $.widget( "mobile.page", $.mobile.widget, { //add active state on vclick $( document ).bind( "vclick", function( event ) { // if this isn't a left click we don't care. Its important to note - // that when the virtual event is generated it will create - if ( event.which > 1 || !$.mobile.linkBindingEnabled ){ + // that when the virtual event is generated it will create the which attr + if ( event.which > 1 || !$.mobile.linkBindingEnabled ) { return; } var link = findClosestLink( event.target ); + + // split from the previous return logic to avoid find closest where possible + // TODO teach $.mobile.hijackable to operate on raw dom elements so the link wrapping + // can be avoided + if ( !$(link).jqmHijackable().length ) { + return; + } + if ( link ) { if ( path.parseUrl( link.getAttribute( "href" ) || "#" ).hash !== "#" ) { removeActiveLinkClass( true ); $activeClickedLink = $( link ).closest( ".ui-btn" ).not( ".ui-disabled" ); $activeClickedLink.addClass( $.mobile.activeBtnClass ); $( "." + $.mobile.activePageClass + " .ui-btn" ).not( link ).blur(); + + // By caching the href value to data and switching the href to a #, we can avoid address bar showing in iOS. The click handler resets the href during its initial steps if this data is present + $( link ) + .jqmData( "href", $( link ).attr( "href" ) ) + .attr( "href", "#" ); } } }); @@ -3248,19 +3555,25 @@ $.widget( "mobile.page", $.mobile.widget, { return; } - var link = findClosestLink( event.target ); + var link = findClosestLink( event.target ), $link = $( link ), httpCleanup; // If there is no link associated with the click or its not a left // click we want to ignore the click - if ( !link || event.which > 1) { + // TODO teach $.mobile.hijackable to operate on raw dom elements so the link wrapping + // can be avoided + if ( !link || event.which > 1 || !$link.jqmHijackable().length ) { return; } - var $link = $( link ), - //remove active link class if external (then it won't be there if you come back) - httpCleanup = function(){ - window.setTimeout( function() { removeActiveLinkClass( true ); }, 200 ); - }; + //remove active link class if external (then it won't be there if you come back) + httpCleanup = function(){ + window.setTimeout( function() { removeActiveLinkClass( true ); }, 200 ); + }; + + // If there's data cached for the real href value, set the link's href back to it again. This pairs with an address bar workaround from the vclick handler + if( $link.jqmData( "href" ) ){ + $link.attr( "href", $link.jqmData( "href" ) ); + } //if there's a data-rel=back attr, go back in history if( $link.is( ":jqmData(rel='back')" ) ) { @@ -3342,7 +3655,7 @@ $.widget( "mobile.page", $.mobile.widget, { }); //prefetch pages when anchors with data-prefetch are encountered - $( ".ui-page" ).live( "pageshow.prefetch", function() { + $( document ).delegate( ".ui-page", "pageshow.prefetch", function() { var urls = []; $( this ).find( "a:jqmData(prefetch)" ).each(function(){ var $link = $(this), @@ -3444,9 +3757,6 @@ $.widget( "mobile.page", $.mobile.widget, { };//_registerInternalEvents callback })( jQuery ); -/* -* history.pushState support, layered on top of hashchange -*/ ( function( $, window ) { // For now, let's Monkeypatch this onto the end of $.mobile._registerInternalEvents @@ -3465,9 +3775,6 @@ $.widget( "mobile.page", $.mobile.widget, { initialHref: url.hrefNoHash, - // Flag for tracking if a Hashchange naturally occurs after each popstate + replace - hashchangeFired: false, - state: function() { return { hash: location.hash || "#" + self.initialFilePath, @@ -3492,6 +3799,11 @@ $.widget( "mobile.page", $.mobile.widget, { return url; }, + hashValueAfterReset: function( url ) { + var resetUrl = self.resetUIKeys( url ); + return $.mobile.path.parseUrl( resetUrl ).hash; + }, + // TODO sort out a single barrier to hashchange functionality nextHashChangePrevented: function( value ) { $.mobile.urlHistory.ignoreNextHashChange = value; @@ -3506,13 +3818,15 @@ $.widget( "mobile.page", $.mobile.widget, { if( self.onHashChangeDisabled ){ return; } - + var href, state, hash = location.hash, isPath = $.mobile.path.isPath( hash ), resolutionUrl = isPath ? location.href : $.mobile.getDocumentUrl(); + hash = isPath ? hash.replace( "#", "" ) : hash; + // propulate the hash when its not available state = self.state(); @@ -3539,23 +3853,42 @@ $.widget( "mobile.page", $.mobile.widget, { // on popstate (ie back or forward) we need to replace the hash that was there previously // cleaned up by the additional hash handling onPopState: function( e ) { - var poppedState = e.originalEvent.state, holdnexthashchange = false; + var poppedState = e.originalEvent.state, + timeout, fromHash, toHash, hashChanged; - // if there's no state its not a popstate we care about, ie chrome's initial popstate - // or forward popstate + // if there's no state its not a popstate we care about, eg chrome's initial popstate if( poppedState ) { - // disable any hashchange triggered by the browser - self.nextHashChangePrevented( true ); + // the active url in the history stack will still be from the previous state + // so we can use it to verify if a hashchange will be fired from the popstate + fromHash = self.hashValueAfterReset( $.mobile.urlHistory.getActive().url ); - // defer our manual hashchange until after the browser fired - // version has come and gone - setTimeout(function() { - // make sure that the manual hash handling takes place - self.nextHashChangePrevented( false ); + // the hash stored in the state popped off the stack will be our currenturl or + // the url to which we wish to navigate + toHash = self.hashValueAfterReset( poppedState.hash.replace("#", "") ); - // change the page based on the hash - $.mobile._handleHashChange( poppedState.hash ); - }, 100); + // if the hashes of the urls are different we must assume that the browser + // will fire a hashchange + hashChanged = fromHash !== toHash; + + // unlock hash handling once the hashchange caused be the popstate has fired + if( hashChanged ) { + $win.one( "hashchange.pushstate", function() { + self.nextHashChangePrevented( false ); + }); + } + + // enable hash handling for the the _handleHashChange call + self.nextHashChangePrevented( false ); + + // change the page based on the hash + $.mobile._handleHashChange( poppedState.hash ); + + // only prevent another hash change handling if a hash change will be fired + // by the browser + if( hashChanged ) { + // disable hash handling until one of the above timers fires + self.nextHashChangePrevented( true ); + } } }, @@ -3578,55 +3911,81 @@ $.widget( "mobile.page", $.mobile.widget, { } }); })( jQuery, this ); + /* -* "transitions" plugin - Page change tranistions +* fallback transition for pop in non-3D supporting browsers (which tend to handle complex transitions poorly in general */ (function( $, window, undefined ) { -function css3TransitionHandler( name, reverse, $to, $from ) { - - var deferred = new $.Deferred(), - reverseClass = reverse ? " reverse" : "", - viewportClass = "ui-mobile-viewport-transitioning viewport-" + name, - doneFunc = function() { - - $to.add( $from ).removeClass( "out in reverse " + name ); - - if ( $from && $from[ 0 ] !== $to[ 0 ] ) { - $from.removeClass( $.mobile.activePageClass ); - } - - $to.parent().removeClass( viewportClass ); - - deferred.resolve( name, reverse, $to, $from ); - }; - - $to.animationComplete( doneFunc ); - - $to.parent().addClass( viewportClass ); - - if ( $from ) { - $from.addClass( name + " out" + reverseClass ); - } - $to.addClass( $.mobile.activePageClass + " " + name + " in" + reverseClass ); - - return deferred.promise(); -} - -// Make our transition handler public. -$.mobile.css3TransitionHandler = css3TransitionHandler; - -// If the default transition handler is the 'none' handler, replace it with our handler. -if ( $.mobile.defaultTransitionHandler === $.mobile.noneTransitionHandler ) { - $.mobile.defaultTransitionHandler = css3TransitionHandler; -} +$.mobile.transitionFallbacks.pop = "fade"; })( jQuery, this ); + /* -* "degradeInputs" plugin - degrades inputs to another type after custom enhancements are made. +* fallback transition for slide in non-3D supporting browsers (which tend to handle complex transitions poorly in general */ +(function( $, window, undefined ) { + +// Use the simultaneous transition handler for slide transitions +$.mobile.transitionHandlers.slide = $.mobile.transitionHandlers.simultaneous; + +// Set the slide transition's fallback to "fade" +$.mobile.transitionFallbacks.slide = "fade"; + +})( jQuery, this ); + +/* +* fallback transition for slidedown in non-3D supporting browsers (which tend to handle complex transitions poorly in general +*/ + +(function( $, window, undefined ) { + +$.mobile.transitionFallbacks.slidedown = "fade"; + +})( jQuery, this ); + +/* +* fallback transition for slideup in non-3D supporting browsers (which tend to handle complex transitions poorly in general +*/ + +(function( $, window, undefined ) { + +$.mobile.transitionFallbacks.slideup = "fade"; + +})( jQuery, this ); + +/* +* fallback transition for flip in non-3D supporting browsers (which tend to handle complex transitions poorly in general +*/ + +(function( $, window, undefined ) { + +$.mobile.transitionFallbacks.flip = "fade"; + +})( jQuery, this ); + +/* +* fallback transition for flow in non-3D supporting browsers (which tend to handle complex transitions poorly in general +*/ + +(function( $, window, undefined ) { + +$.mobile.transitionFallbacks.flow = "fade"; + +})( jQuery, this ); + +/* +* fallback transition for turn in non-3D supporting browsers (which tend to handle complex transitions poorly in general +*/ + +(function( $, window, undefined ) { + +$.mobile.transitionFallbacks.turn = "fade"; + +})( jQuery, this ); + (function( $, undefined ) { $.mobile.page.prototype.options.degradeInputs = { @@ -3649,7 +4008,7 @@ $.mobile.page.prototype.options.degradeInputs = { //auto self-init widgets $( document ).bind( "pagecreate create", function( e ){ - var page = $(e.target).closest(':jqmData(role="page")').data("page"), options; + var page = $.mobile.closestPageData($(e.target)), options; if( !page ) { return; @@ -3676,9 +4035,7 @@ $( document ).bind( "pagecreate create", function( e ){ }); -})( jQuery );/* -* "dialog" plugin. -*/ +})( jQuery ); (function( $, window, undefined ) { @@ -3691,27 +4048,35 @@ $.widget( "mobile.dialog", $.mobile.widget, { _create: function() { var self = this, $el = this.element, - headerCloseButton = $( "
          "+ this.options.closeBtnText + "" ); + headerCloseButton = $( ""+ this.options.closeBtnText + "" ), + dialogWrap = $("
          ", { + "role" : "dialog", + "class" : "ui-dialog-contain ui-corner-all ui-overlay-shadow" + }); - $el.addClass( "ui-overlay-" + this.options.overlayTheme ); + $el.addClass( "ui-dialog ui-overlay-" + this.options.overlayTheme ); // Class the markup for dialog styling // Set aria role - $el.attr( "role", "dialog" ) - .addClass( "ui-dialog" ) - .find( ":jqmData(role='header')" ) - .addClass( "ui-corner-top ui-overlay-shadow" ) - .prepend( headerCloseButton ) - .end() - .find( ":jqmData(role='content'),:jqmData(role='footer')" ) - .addClass( "ui-overlay-shadow" ) - .last() - .addClass( "ui-corner-bottom" ); + $el + .wrapInner( dialogWrap ) + .children() + .find( ":jqmData(role='header')" ) + .prepend( headerCloseButton ) + .end() + .children( ':first-child') + .addClass( "ui-corner-top" ) + .end() + .children( ":last-child" ) + .addClass( "ui-corner-bottom" ); // this must be an anonymous function so that select menu dialogs can replace // the close method. This is a change from previously just defining data-rel=back // on the button and letting nav handle it - headerCloseButton.bind( "vclick", function() { + // + // Use click rather than vclick in order to prevent the possibility of unintentionally + // reopening the dialog if the dialog opening item was directly under the close button. + headerCloseButton.bind( "click", function() { self.close(); }); @@ -3732,8 +4097,16 @@ $.widget( "mobile.dialog", $.mobile.widget, { .attr( "data-" + $.mobile.ns + "direction", "reverse" ); } }) - .bind( "pagehide", function() { + .bind( "pagehide", function( e, ui ) { $( this ).find( "." + $.mobile.activeBtnClass ).removeClass( $.mobile.activeBtnClass ); + }) + // Override the theme set by the page plugin on pageshow + .bind( "pagebeforeshow", function(){ + if( self.options.overlayTheme ){ + self.element + .page( "removeContainerBackground" ) + .page( "setContainerBackground", self.options.overlayTheme ); + } }); }, @@ -3744,14 +4117,322 @@ $.widget( "mobile.dialog", $.mobile.widget, { }); //auto self-init widgets -$( $.mobile.dialog.prototype.options.initSelector ).live( "pagecreate", function(){ - $( this ).dialog(); +$( document ).delegate( $.mobile.dialog.prototype.options.initSelector, "pagecreate", function(){ + $.mobile.dialog.prototype.enhance( this ); }); })( jQuery, this ); -/* -* This plugin handles theming and layout of headers, footers, and content areas -*/ + +(function( $, undefined ) { + +$.fn.fieldcontain = function( options ) { + return this.addClass( "ui-field-contain ui-body ui-br" ); +}; + +//auto self-init widgets +$( document ).bind( "pagecreate create", function( e ){ + $( ":jqmData(role='fieldcontain')", e.target ).jqmEnhanceable().fieldcontain(); +}); + +})( jQuery ); + +(function( $, undefined ) { + +$.fn.grid = function( options ) { + return this.each(function() { + + var $this = $( this ), + o = $.extend({ + grid: null + },options), + $kids = $this.children(), + gridCols = {solo:1, a:2, b:3, c:4, d:5}, + grid = o.grid, + iterator; + + if ( !grid ) { + if ( $kids.length <= 5 ) { + for ( var letter in gridCols ) { + if ( gridCols[ letter ] === $kids.length ) { + grid = letter; + } + } + } else { + grid = "a"; + } + } + iterator = gridCols[grid]; + + $this.addClass( "ui-grid-" + grid ); + + $kids.filter( ":nth-child(" + iterator + "n+1)" ).addClass( "ui-block-a" ); + + if ( iterator > 1 ) { + $kids.filter( ":nth-child(" + iterator + "n+2)" ).addClass( "ui-block-b" ); + } + if ( iterator > 2 ) { + $kids.filter( ":nth-child(3n+3)" ).addClass( "ui-block-c" ); + } + if ( iterator > 3 ) { + $kids.filter( ":nth-child(4n+4)" ).addClass( "ui-block-d" ); + } + if ( iterator > 4 ) { + $kids.filter( ":nth-child(5n+5)" ).addClass( "ui-block-e" ); + } + }); +}; +})( jQuery ); + +(function( $, undefined ) { + +$( document ).bind( "pagecreate create", function( e ){ + $( ":jqmData(role='nojs')", e.target ).addClass( "ui-nojs" ); + +}); + +})( jQuery ); + +( function( $, undefined ) { + +$.fn.buttonMarkup = function( options ) { + var $workingSet = this; + + // Enforce options to be of type string + options = ( options && ( $.type( options ) == "object" ) )? options : {}; + for ( var i = 0; i < $workingSet.length; i++ ) { + var el = $workingSet.eq( i ), + e = el[ 0 ], + o = $.extend( {}, $.fn.buttonMarkup.defaults, { + icon: options.icon !== undefined ? options.icon : el.jqmData( "icon" ), + iconpos: options.iconpos !== undefined ? options.iconpos : el.jqmData( "iconpos" ), + theme: options.theme !== undefined ? options.theme : el.jqmData( "theme" ) || $.mobile.getInheritedTheme( el, "c" ), + inline: options.inline !== undefined ? options.inline : el.jqmData( "inline" ), + shadow: options.shadow !== undefined ? options.shadow : el.jqmData( "shadow" ), + corners: options.corners !== undefined ? options.corners : el.jqmData( "corners" ), + iconshadow: options.iconshadow !== undefined ? options.iconshadow : el.jqmData( "iconshadow" ), + mini: options.mini !== undefined ? options.mini : el.jqmData( "mini" ) + }, options ), + + // Classes Defined + innerClass = "ui-btn-inner", + textClass = "ui-btn-text", + buttonClass, iconClass, + // Button inner markup + buttonInner, + buttonText, + buttonIcon, + buttonElements; + + $.each(o, function(key, value) { + e.setAttribute( "data-" + $.mobile.ns + key, value ); + el.jqmData(key, value); + }); + + // Check if this element is already enhanced + buttonElements = $.data(((e.tagName === "INPUT" || e.tagName === "BUTTON") ? e.parentNode : e), "buttonElements"); + + if (buttonElements) { + e = buttonElements.outer; + el = $(e); + buttonInner = buttonElements.inner; + buttonText = buttonElements.text; + // We will recreate this icon below + $(buttonElements.icon).remove(); + buttonElements.icon = null; + } + else { + buttonInner = document.createElement( o.wrapperEls ); + buttonText = document.createElement( o.wrapperEls ); + } + buttonIcon = o.icon ? document.createElement( "span" ) : null; + + if ( attachEvents && !buttonElements) { + attachEvents(); + } + + // if not, try to find closest theme container + if ( !o.theme ) { + o.theme = $.mobile.getInheritedTheme( el, "c" ); + } + + buttonClass = "ui-btn ui-btn-up-" + o.theme; + buttonClass += o.inline ? " ui-btn-inline" : ""; + buttonClass += o.shadow ? " ui-shadow" : ""; + buttonClass += o.corners ? " ui-btn-corner-all" : ""; + + if ( o.mini !== undefined ) { + // Used to control styling in headers/footers, where buttons default to `mini` style. + buttonClass += o.mini ? " ui-mini" : " ui-fullsize"; + } + + if ( o.inline !== undefined ) { + // Used to control styling in headers/footers, where buttons default to `mini` style. + buttonClass += o.inline === false ? " ui-btn-block" : " ui-btn-inline"; + } + + + if ( o.icon ) { + o.icon = "ui-icon-" + o.icon; + o.iconpos = o.iconpos || "left"; + + iconClass = "ui-icon " + o.icon; + + if ( o.iconshadow ) { + iconClass += " ui-icon-shadow"; + } + } + + if ( o.iconpos ) { + buttonClass += " ui-btn-icon-" + o.iconpos; + + if ( o.iconpos == "notext" && !el.attr( "title" ) ) { + el.attr( "title", el.getEncodedText() ); + } + } + + innerClass += o.corners ? " ui-btn-corner-all" : ""; + + if ( o.iconpos && o.iconpos === "notext" && !el.attr( "title" ) ) { + el.attr( "title", el.getEncodedText() ); + } + + if ( buttonElements ) { + el.removeClass( buttonElements.bcls || "" ); + } + el.removeClass( "ui-link" ).addClass( buttonClass ); + + buttonInner.className = innerClass; + + buttonText.className = textClass; + if ( !buttonElements ) { + buttonInner.appendChild( buttonText ); + } + if ( buttonIcon ) { + buttonIcon.className = iconClass; + if ( !(buttonElements && buttonElements.icon) ) { + buttonIcon.appendChild( document.createTextNode("\u00a0") ); + buttonInner.appendChild( buttonIcon ); + } + } + + while ( e.firstChild && !buttonElements) { + buttonText.appendChild( e.firstChild ); + } + + if ( !buttonElements ) { + e.appendChild( buttonInner ); + } + + // Assign a structure containing the elements of this button to the elements of this button. This + // will allow us to recognize this as an already-enhanced button in future calls to buttonMarkup(). + buttonElements = { + bcls : buttonClass, + outer : e, + inner : buttonInner, + text : buttonText, + icon : buttonIcon + }; + + $.data(e, 'buttonElements', buttonElements); + $.data(buttonInner, 'buttonElements', buttonElements); + $.data(buttonText, 'buttonElements', buttonElements); + if (buttonIcon) { + $.data(buttonIcon, 'buttonElements', buttonElements); + } + } + + return this; +}; + +$.fn.buttonMarkup.defaults = { + corners: true, + shadow: true, + iconshadow: true, + wrapperEls: "span" +}; + +function closestEnabledButton( element ) { + var cname; + + while ( element ) { + // Note that we check for typeof className below because the element we + // handed could be in an SVG DOM where className on SVG elements is defined to + // be of a different type (SVGAnimatedString). We only operate on HTML DOM + // elements, so we look for plain "string". + cname = ( typeof element.className === 'string' ) && (element.className + ' '); + if ( cname && cname.indexOf("ui-btn ") > -1 && cname.indexOf("ui-disabled ") < 0 ) { + break; + } + + element = element.parentNode; + } + + return element; +} + +var attachEvents = function() { + var hoverDelay = $.mobile.buttonMarkup.hoverDelay, hov, foc; + + $( document ).bind( { + "vmousedown vmousecancel vmouseup vmouseover vmouseout focus blur scrollstart": function( event ) { + var theme, + $btn = $( closestEnabledButton( event.target ) ), + evt = event.type; + + if ( $btn.length ) { + theme = $btn.attr( "data-" + $.mobile.ns + "theme" ); + + if ( evt === "vmousedown" ) { + if ( $.support.touch ) { + hov = setTimeout(function() { + $btn.removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-down-" + theme ); + }, hoverDelay ); + } else { + $btn.removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-down-" + theme ); + } + } else if ( evt === "vmousecancel" || evt === "vmouseup" ) { + $btn.removeClass( "ui-btn-down-" + theme ).addClass( "ui-btn-up-" + theme ); + } else if ( evt === "vmouseover" || evt === "focus" ) { + if ( $.support.touch ) { + foc = setTimeout(function() { + $btn.removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-hover-" + theme ); + }, hoverDelay ); + } else { + $btn.removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-hover-" + theme ); + } + } else if ( evt === "vmouseout" || evt === "blur" || evt === "scrollstart" ) { + $btn.removeClass( "ui-btn-hover-" + theme + " ui-btn-down-" + theme ).addClass( "ui-btn-up-" + theme ); + if ( hov ) { + clearTimeout( hov ); + } + if ( foc ) { + clearTimeout( foc ); + } + } + } + }, + "focusin focus": function( event ){ + $( closestEnabledButton( event.target ) ).addClass( $.mobile.focusClass ); + }, + "focusout blur": function( event ){ + $( closestEnabledButton( event.target ) ).removeClass( $.mobile.focusClass ); + } + }); + + attachEvents = null; +}; + +//links in bars, or those with data-role become buttons +//auto self-init widgets +$( document ).bind( "pagecreate create", function( e ){ + + $( ":jqmData(role='button'), .ui-bar > a, .ui-header > a, .ui-footer > a, .ui-bar > :jqmData(role='controlgroup') > a", e.target ) + .not( ".ui-btn, :jqmData(role='none'), :jqmData(role='nojs')" ) + .buttonMarkup(); +}); + +})( jQuery ); + (function( $, undefined ) { @@ -3762,14 +4443,17 @@ $.mobile.page.prototype.options.headerTheme = "a"; $.mobile.page.prototype.options.footerTheme = "a"; $.mobile.page.prototype.options.contentTheme = null; -$( ":jqmData(role='page'), :jqmData(role='dialog')" ).live( "pagecreate", function( e ) { - +$( document ).delegate( ":jqmData(role='page'), :jqmData(role='dialog')", "pagecreate", function( e ) { + var $page = $( this ), o = $page.data( "page" ).options, pageRole = $page.jqmData( "role" ), pageTheme = o.theme; - - $( ":jqmData(role='header'), :jqmData(role='footer'), :jqmData(role='content')", this ).each(function() { + + $( ":jqmData(role='header'), :jqmData(role='footer'), :jqmData(role='content')", this ) + .jqmEnhanceable() + .each(function() { + var $this = $( this ), role = $this.jqmData( "role" ), theme = $this.jqmData( "theme" ), @@ -3778,12 +4462,12 @@ $( ":jqmData(role='page'), :jqmData(role='dialog')" ).live( "pagecreate", functi leftbtn, rightbtn, backBtn; - - $this.addClass( "ui-" + role ); + + $this.addClass( "ui-" + role ); //apply theming and markup modifications to page,header,content,footer if ( role === "header" || role === "footer" ) { - + var thisTheme = theme || ( role === "header" ? o.headerTheme : o.footerTheme ) || pageTheme; $this @@ -3792,26 +4476,28 @@ $( ":jqmData(role='page'), :jqmData(role='dialog')" ).live( "pagecreate", functi // Add ARIA role .attr( "role", role === "header" ? "banner" : "contentinfo" ); - // Right,left buttons - $headeranchors = $this.children( "a" ); - leftbtn = $headeranchors.hasClass( "ui-btn-left" ); - rightbtn = $headeranchors.hasClass( "ui-btn-right" ); + if( role === "header") { + // Right,left buttons + $headeranchors = $this.children( "a" ); + leftbtn = $headeranchors.hasClass( "ui-btn-left" ); + rightbtn = $headeranchors.hasClass( "ui-btn-right" ); + + leftbtn = leftbtn || $headeranchors.eq( 0 ).not( ".ui-btn-right" ).addClass( "ui-btn-left" ).length; + + rightbtn = rightbtn || $headeranchors.eq( 1 ).addClass( "ui-btn-right" ).length; + } - leftbtn = leftbtn || $headeranchors.eq( 0 ).not( ".ui-btn-right" ).addClass( "ui-btn-left" ).length; - - rightbtn = rightbtn || $headeranchors.eq( 1 ).addClass( "ui-btn-right" ).length; - // Auto-add back btn on pages beyond first view if ( o.addBackBtn && role === "header" && $( ".ui-page" ).length > 1 && - $this.jqmData( "url" ) !== $.mobile.path.stripHash( location.hash ) && + $page.jqmData( "url" ) !== $.mobile.path.stripHash( location.hash ) && !leftbtn ) { backBtn = $( ""+ o.backBtnText +"" ) // If theme is provided, override default inheritance .attr( "data-"+ $.mobile.ns +"theme", o.backBtnTheme || thisTheme ) - .prependTo( $this ); + .prependTo( $this ); } // Page title @@ -3819,7 +4505,6 @@ $( ":jqmData(role='page'), :jqmData(role='dialog')" ).live( "pagecreate", functi .addClass( "ui-title" ) // Regardless of h element number in src, it becomes h1 for the enhanced page .attr({ - "tabindex": "0", "role": "heading", "aria-level": "1" }); @@ -3835,9 +4520,7 @@ $( ":jqmData(role='page'), :jqmData(role='dialog')" ).live( "pagecreate", functi }); }); -})( jQuery );/* -* "collapsible" plugin -*/ +})( jQuery ); (function( $, undefined ) { @@ -3850,6 +4533,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, { theme: null, contentTheme: null, iconTheme: "d", + mini: false, initSelector: ":jqmData(role='collapsible')" }, _create: function() { @@ -3859,8 +4543,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, { collapsible = $el.addClass( "ui-collapsible" ), collapsibleHeading = $el.children( o.heading ).first(), collapsibleContent = collapsible.wrapInner( "
          " ).find( ".ui-collapsible-content" ), - collapsibleSet = $el.closest( ":jqmData(role='collapsible-set')" ).addClass( "ui-collapsible-set" ), - collapsiblesInSet = collapsibleSet.children( ":jqmData(role='collapsible')" ); + collapsibleSet = $el.closest( ":jqmData(role='collapsible-set')" ).addClass( "ui-collapsible-set" ); // Replace collapsibleHeading if it's a legend if ( collapsibleHeading.is( "legend" ) ) { @@ -3872,14 +4555,22 @@ $.widget( "mobile.collapsible", $.mobile.widget, { if ( collapsibleSet.length ) { // Inherit the theme from collapsible-set if ( !o.theme ) { - o.theme = collapsibleSet.jqmData( "theme" ); + o.theme = collapsibleSet.jqmData("theme") || $.mobile.getInheritedTheme( collapsibleSet, "c" ); } // Inherit the content-theme from collapsible-set if ( !o.contentTheme ) { o.contentTheme = collapsibleSet.jqmData( "content-theme" ); } - } + // Gets the preference icon position in the set + if ( !o.iconPos ) { + o.iconPos = collapsibleSet.jqmData( "iconpos" ); + } + + if( !o.mini ) { + o.mini = collapsibleSet.jqmData( "mini" ); + } + } collapsibleContent.addClass( ( o.contentTheme ) ? ( "ui-body-" + o.contentTheme ) : ""); collapsibleHeading @@ -3894,55 +4585,13 @@ $.widget( "mobile.collapsible", $.mobile.widget, { .buttonMarkup({ shadow: false, corners: false, - iconPos: "left", + iconpos: $el.jqmData( "iconpos" ) || o.iconPos || "left", icon: "plus", + mini: o.mini, theme: o.theme - }); - - if ( !collapsibleSet.length ) { - collapsibleHeading - .find( "a" ).first().add( collapsibleHeading.find( ".ui-btn-inner" ) ) - .addClass( "ui-corner-top ui-corner-bottom" ); - } else { - // If we are in a collapsible set - - // Initialize the collapsible set if it's not already initialized - if ( !collapsibleSet.jqmData( "collapsiblebound" ) ) { - - collapsibleSet - .jqmData( "collapsiblebound", true ) - .bind( "expand", function( event ) { - - $( event.target ) - .closest( ".ui-collapsible" ) - .siblings( ".ui-collapsible" ) - .trigger( "collapse" ); - - }); - } - - collapsiblesInSet.first() - .find( "a" ) - .first() - .addClass( "ui-corner-top" ) - .find( ".ui-btn-inner" ) - .addClass( "ui-corner-top" ); - - collapsiblesInSet.last() - .jqmData( "collapsible-last", true ) - .find( "a" ) - .first() - .addClass( "ui-corner-bottom" ) - .find( ".ui-btn-inner" ) - .addClass( "ui-corner-bottom" ); - - - if ( collapsible.jqmData( "collapsible-last" ) ) { - collapsibleHeading - .find( "a" ).first().add ( collapsibleHeading.find( ".ui-btn-inner" ) ) - .addClass( "ui-corner-bottom" ); - } - } + }) + .add( ".ui-btn-inner", $el ) + .addClass( "ui-corner-top ui-corner-bottom" ); //events collapsible @@ -3993,77 +4642,102 @@ $.widget( "mobile.collapsible", $.mobile.widget, { //auto self-init widgets $( document ).bind( "pagecreate create", function( e ){ - $( $.mobile.collapsible.prototype.options.initSelector, e.target ).collapsible(); + $.mobile.collapsible.prototype.enhanceWithin( e.target ); }); })( jQuery ); -/* -* "fieldcontain" plugin - simple class additions to make form row separators -*/ (function( $, undefined ) { -$.fn.fieldcontain = function( options ) { - return this.addClass( "ui-field-contain ui-body ui-br" ); -}; +$.widget( "mobile.collapsibleset", $.mobile.widget, { + options: { + initSelector: ":jqmData(role='collapsible-set')" + }, + _create: function() { + var $el = this.element.addClass( "ui-collapsible-set" ), + o = this.options; + + // Inherit the theme from collapsible-set + if ( !o.theme ) { + o.theme = $.mobile.getInheritedTheme( $el, "c" ); + } + // Inherit the content-theme from collapsible-set + if ( !o.contentTheme ) { + o.contentTheme = $el.jqmData( "content-theme" ); + } + + if ( !o.corners ) { + o.corners = $el.jqmData( "corners" ) === undefined ? true : false; + } + + // Initialize the collapsible set if it's not already initialized + if ( !$el.jqmData( "collapsiblebound" ) ) { + $el + .jqmData( "collapsiblebound", true ) + .bind( "expand collapse", function( event ) { + var isCollapse = ( event.type === "collapse" ), + collapsible = $( event.target ).closest( ".ui-collapsible" ), + widget = collapsible.data( "collapsible" ), + contentTheme = widget.options.contentTheme; + if ( contentTheme && collapsible.jqmData( "collapsible-last" ) ) { + collapsible.find( widget.options.heading ).first() + .find( "a" ).first() + .add( ".ui-btn-inner" ) + .toggleClass( "ui-corner-bottom", isCollapse ); + collapsible.find( ".ui-collapsible-content" ).toggleClass( "ui-corner-bottom", !isCollapse ); + } + }) + .bind( "expand", function( event ) { + $( event.target ) + .closest( ".ui-collapsible" ) + .siblings( ".ui-collapsible" ) + .trigger( "collapse" ); + }); + } + }, + + _init: function() { + this.refresh(); + }, + + refresh: function() { + var $el = this.element, + o = this.options, + collapsiblesInSet = $el.children( ":jqmData(role='collapsible')" ); + + $.mobile.collapsible.prototype.enhance( collapsiblesInSet.not( ".ui-collapsible" ) ); + + // clean up borders + collapsiblesInSet.each( function() { + $( this ).find( $.mobile.collapsible.prototype.options.heading ) + .find( "a" ).first() + .add( ".ui-btn-inner" ) + .removeClass( "ui-corner-top ui-corner-bottom" ); + }); + + collapsiblesInSet.first() + .find( "a" ) + .first() + .addClass( o.corners ? "ui-corner-top" : "" ) + .find( ".ui-btn-inner" ) + .addClass( "ui-corner-top" ); + + collapsiblesInSet.last() + .jqmData( "collapsible-last", true ) + .find( "a" ) + .first() + .addClass( o.corners ? "ui-corner-bottom" : "" ) + .find( ".ui-btn-inner" ) + .addClass( "ui-corner-bottom" ); + } +}); //auto self-init widgets $( document ).bind( "pagecreate create", function( e ){ - $( ":jqmData(role='fieldcontain')", e.target ).fieldcontain(); + $.mobile.collapsibleset.prototype.enhanceWithin( e.target ); }); -})( jQuery );/* -* plugin for creating CSS grids -*/ - -(function( $, undefined ) { - -$.fn.grid = function( options ) { - return this.each(function() { - - var $this = $( this ), - o = $.extend({ - grid: null - },options), - $kids = $this.children(), - gridCols = {solo:1, a:2, b:3, c:4, d:5}, - grid = o.grid, - iterator; - - if ( !grid ) { - if ( $kids.length <= 5 ) { - for ( var letter in gridCols ) { - if ( gridCols[ letter ] === $kids.length ) { - grid = letter; - } - } - } else { - grid = "a"; - } - } - iterator = gridCols[grid]; - - $this.addClass( "ui-grid-" + grid ); - - $kids.filter( ":nth-child(" + iterator + "n+1)" ).addClass( "ui-block-a" ); - - if ( iterator > 1 ) { - $kids.filter( ":nth-child(" + iterator + "n+2)" ).addClass( "ui-block-b" ); - } - if ( iterator > 2 ) { - $kids.filter( ":nth-child(3n+3)" ).addClass( "ui-block-c" ); - } - if ( iterator > 3 ) { - $kids.filter( ":nth-child(4n+4)" ).addClass( "ui-block-d" ); - } - if ( iterator > 4 ) { - $kids.filter( ":nth-child(5n+5)" ).addClass( "ui-block-e" ); - } - }); -}; -})( jQuery );/* -* "navbar" plugin -*/ +})( jQuery ); (function( $, undefined ) { @@ -4084,7 +4758,8 @@ $.widget( "mobile.navbar", $.mobile.widget, { $navbar.addClass( "ui-navbar" ) .attr( "role","navigation" ) .find( "ul" ) - .grid({ grid: this.options.grid }); + .jqmEnhanceable() + .grid({ grid: this.options.grid }); if ( !iconpos ) { $navbar.addClass( "ui-navbar-noicons" ); @@ -4093,25 +4768,30 @@ $.widget( "mobile.navbar", $.mobile.widget, { $navbtns.buttonMarkup({ corners: false, shadow: false, + inline: true, iconpos: iconpos }); $navbar.delegate( "a", "vclick", function( event ) { - $navbtns.not( ".ui-state-persist" ).removeClass( $.mobile.activeBtnClass ); - $( this ).addClass( $.mobile.activeBtnClass ); + if( !$(event.target).hasClass("ui-disabled") ) { + $navbtns.removeClass( $.mobile.activeBtnClass ); + $( this ).addClass( $.mobile.activeBtnClass ); + } + }); + + // Buttons in the navbar with ui-state-persist class should regain their active state before page show + $navbar.closest( ".ui-page" ).bind( "pagebeforeshow", function() { + $navbtns.filter( ".ui-state-persist" ).addClass( $.mobile.activeBtnClass ); }); } }); //auto self-init widgets $( document ).bind( "pagecreate create", function( e ){ - $( $.mobile.navbar.prototype.options.initSelector, e.target ).navbar(); + $.mobile.navbar.prototype.enhanceWithin( e.target ); }); })( jQuery ); -/* -* "listview" plugin -*/ (function( $, undefined ) { @@ -4121,6 +4801,7 @@ $( document ).bind( "pagecreate create", function( e ){ var listCountPerPage = {}; $.widget( "mobile.listview", $.mobile.widget, { + options: { theme: null, countTheme: "c", @@ -4128,16 +4809,21 @@ $.widget( "mobile.listview", $.mobile.widget, { dividerTheme: "b", splitIcon: "arrow-r", splitTheme: "b", + mini: false, inset: false, initSelector: ":jqmData(role='listview')" }, _create: function() { - var t = this; + var t = this, + listviewClasses = ""; + + listviewClasses += t.options.inset ? " ui-listview-inset ui-corner-all ui-shadow " : ""; + listviewClasses += t.element.jqmData( "mini" ) || t.options.mini === true ? " ui-mini" : ""; // create listview markup t.element.addClass(function( i, orig ) { - return orig + " ui-listview " + ( t.options.inset ? " ui-listview-inset ui-corner-all ui-shadow " : "" ); + return orig + " ui-listview " + listviewClasses; }); t.refresh( true ); @@ -4267,12 +4953,12 @@ $.widget( "mobile.listview", $.mobile.widget, { counter = $.support.cssPseudoElement || !$.nodeName( $list[ 0 ], "ol" ) ? 0 : 1, itemClassDict = {}, item, itemClass, itemTheme, - a, last, splittheme, countParent, icon, imgParents, img; + a, last, splittheme, countParent, icon, imgParents, img, linkIcon; if ( counter ) { $list.find( ".ui-li-dec" ).remove(); } - + if ( !o.theme ) { o.theme = $.mobile.getInheritedTheme( this.element, "c" ); } @@ -4294,7 +4980,6 @@ $.widget( "mobile.listview", $.mobile.widget, { else { var a = this._getChildrenByTagName( item[ 0 ], "a", "A" ); } - if ( a.length ) { icon = item.jqmData("icon"); @@ -4311,13 +4996,14 @@ $.widget( "mobile.listview", $.mobile.widget, { item.addClass( "ui-li-has-arrow" ); } - a.first().addClass( "ui-link-inherit" ); + a.first().removeClass( "ui-link" ).addClass( "ui-link-inherit" ); if ( a.length > 1 ) { itemClass += " ui-li-has-alt"; last = a.last(); splittheme = listsplittheme || last.jqmData( "theme" ) || o.splitTheme; + linkIcon = last.jqmData("icon"); last.appendTo(item) .attr( "title", last.getEncodedText() ) @@ -4337,13 +5023,14 @@ $.widget( "mobile.listview", $.mobile.widget, { corners: true, theme: splittheme, iconpos: "notext", - icon: listspliticon || last.jqmData( "icon" ) || o.splitIcon + // link icon overrides list item icon overrides ul element overrides options + icon: linkIcon || icon || listspliticon || o.splitIcon }) ); } } else if ( item.jqmData( "role" ) === "list-divider" ) { - itemClass += " ui-li-divider ui-btn ui-bar-" + dividertheme; + itemClass += " ui-li-divider ui-bar-" + dividertheme; item.attr( "role", "heading" ); //reset counter when a divider heading is encountered @@ -4513,16 +5200,592 @@ $.widget( "mobile.listview", $.mobile.widget, { //auto self-init widgets $( document ).bind( "pagecreate create", function( e ){ - $( $.mobile.listview.prototype.options.initSelector, e.target ).listview(); + $.mobile.listview.prototype.enhanceWithin( e.target ); }); })( jQuery ); + /* -* "listview" filter extension +* "checkboxradio" plugin */ (function( $, undefined ) { +$.widget( "mobile.checkboxradio", $.mobile.widget, { + options: { + theme: null, + initSelector: "input[type='checkbox'],input[type='radio']" + }, + _create: function() { + var self = this, + input = this.element, + inheritAttr = function( input, dataAttr ) { + return input.jqmData( dataAttr ) || input.closest( "form,fieldset" ).jqmData( dataAttr ) + }, + // NOTE: Windows Phone could not find the label through a selector + // filter works though. + parentLabel = $( input ).closest( "label" ), + label = parentLabel.length ? parentLabel : $( input ).closest( "form,fieldset,:jqmData(role='page'),:jqmData(role='dialog')" ).find( "label" ).filter( "[for='" + input[0].id + "']" ), + inputtype = input[0].type, + mini = inheritAttr( input, "mini" ), + checkedState = inputtype + "-on", + uncheckedState = inputtype + "-off", + icon = input.parents( ":jqmData(type='horizontal')" ).length ? undefined : uncheckedState, + iconpos = inheritAttr( input, "iconpos" ), + activeBtn = icon ? "" : " " + $.mobile.activeBtnClass, + checkedClass = "ui-" + checkedState + activeBtn, + uncheckedClass = "ui-" + uncheckedState, + checkedicon = "ui-icon-" + checkedState, + uncheckedicon = "ui-icon-" + uncheckedState; + + if ( inputtype !== "checkbox" && inputtype !== "radio" ) { + return; + } + + // Expose for other methods + $.extend( this, { + label: label, + inputtype: inputtype, + checkedClass: checkedClass, + uncheckedClass: uncheckedClass, + checkedicon: checkedicon, + uncheckedicon: uncheckedicon + }); + + // If there's no selected theme check the data attr + if( !this.options.theme ) { + this.options.theme = $.mobile.getInheritedTheme( this.element, "c" ); + } + + label.buttonMarkup({ + theme: this.options.theme, + icon: icon, + shadow: false, + mini: mini, + iconpos: iconpos + }); + + // Wrap the input + label in a div + var wrapper = document.createElement('div'); + wrapper.className = 'ui-' + inputtype; + + input.add( label ).wrapAll( wrapper ); + + label.bind({ + vmouseover: function( event ) { + if ( $( this ).parent().is( ".ui-disabled" ) ) { + event.stopPropagation(); + } + }, + + vclick: function( event ) { + if ( input.is( ":disabled" ) ) { + event.preventDefault(); + return; + } + + self._cacheVals(); + + input.prop( "checked", inputtype === "radio" && true || !input.prop( "checked" ) ); + + // trigger click handler's bound directly to the input as a substitute for + // how label clicks behave normally in the browsers + // TODO: it would be nice to let the browser's handle the clicks and pass them + // through to the associate input. we can swallow that click at the parent + // wrapper element level + input.triggerHandler( 'click' ); + + // Input set for common radio buttons will contain all the radio + // buttons, but will not for checkboxes. clearing the checked status + // of other radios ensures the active button state is applied properly + self._getInputSet().not( input ).prop( "checked", false ); + + self._updateAll(); + return false; + } + }); + + input + .bind({ + vmousedown: function() { + self._cacheVals(); + }, + + vclick: function() { + var $this = $(this); + + // Adds checked attribute to checked input when keyboard is used + if ( $this.is( ":checked" ) ) { + + $this.prop( "checked", true); + self._getInputSet().not($this).prop( "checked", false ); + } else { + + $this.prop( "checked", false ); + } + + self._updateAll(); + }, + + focus: function() { + label.addClass( $.mobile.focusClass ); + }, + + blur: function() { + label.removeClass( $.mobile.focusClass ); + } + }); + + this.refresh(); + }, + + _cacheVals: function() { + this._getInputSet().each(function() { + $(this).jqmData( "cacheVal", this.checked ); + }); + }, + + //returns either a set of radios with the same name attribute, or a single checkbox + _getInputSet: function(){ + if(this.inputtype === "checkbox") { + return this.element; + } + + return this.element.closest( "form,fieldset,:jqmData(role='page')" ) + .find( "input[name='"+ this.element[0].name +"'][type='"+ this.inputtype +"']" ); + }, + + _updateAll: function() { + var self = this; + + this._getInputSet().each(function() { + var $this = $(this); + + if ( this.checked || self.inputtype === "checkbox" ) { + $this.trigger( "change" ); + } + }) + .checkboxradio( "refresh" ); + }, + + refresh: function() { + var input = this.element[0], + label = this.label, + icon = label.find( ".ui-icon" ); + + if ( input.checked ) { + label.addClass( this.checkedClass ).removeClass( this.uncheckedClass ); + icon.addClass( this.checkedicon ).removeClass( this.uncheckedicon ); + } else { + label.removeClass( this.checkedClass ).addClass( this.uncheckedClass ); + icon.removeClass( this.checkedicon ).addClass( this.uncheckedicon ); + } + + if ( input.disabled ) { + this.disable(); + } else { + this.enable(); + } + }, + + disable: function() { + this.element.prop( "disabled", true ).parent().addClass( "ui-disabled" ); + }, + + enable: function() { + this.element.prop( "disabled", false ).parent().removeClass( "ui-disabled" ); + } +}); + +//auto self-init widgets +$( document ).bind( "pagecreate create", function( e ){ + $.mobile.checkboxradio.prototype.enhanceWithin( e.target, true ); +}); + +})( jQuery ); + +(function( $, undefined ) { + +$.widget( "mobile.button", $.mobile.widget, { + options: { + theme: null, + icon: null, + iconpos: null, + inline: false, + corners: true, + shadow: true, + iconshadow: true, + initSelector: "button, [type='button'], [type='submit'], [type='reset'], [type='image']", + mini: false + }, + _create: function() { + var $el = this.element, + $button, + o = this.options, + type, + name, + classes = "", + $buttonPlaceholder; + + // if this is a link, check if it's been enhanced and, if not, use the right function + if( $el[ 0 ].tagName === "A" ) { + !$el.hasClass( "ui-btn" ) && $el.buttonMarkup(); + return; + } + + // get the inherited theme + // TODO centralize for all widgets + if ( !this.options.theme ) { + this.options.theme = $.mobile.getInheritedTheme( this.element, "c" ); + } + + // TODO: Post 1.1--once we have time to test thoroughly--any classes manually applied to the original element should be carried over to the enhanced element, with an `-enhanced` suffix. See https://github.com/jquery/jquery-mobile/issues/3577 + /* if( $el[0].className.length ) { + classes = $el[0].className; + } */ + if( !!~$el[0].className.indexOf( "ui-btn-left" ) ) { + classes = "ui-btn-left"; + } + + if( !!~$el[0].className.indexOf( "ui-btn-right" ) ) { + classes = "ui-btn-right"; + } + + // Add ARIA role + this.button = $( "
          " ) + .text( $el.text() || $el.val() ) + .insertBefore( $el ) + .buttonMarkup({ + theme: o.theme, + icon: o.icon, + iconpos: o.iconpos, + inline: o.inline, + corners: o.corners, + shadow: o.shadow, + iconshadow: o.iconshadow, + mini: o.mini + }) + .addClass( classes ) + .append( $el.addClass( "ui-btn-hidden" ) ); + + $button = this.button; + type = $el.attr( "type" ); + name = $el.attr( "name" ); + + // Add hidden input during submit if input type="submit" has a name. + if ( type !== "button" && type !== "reset" && name ) { + $el.bind( "vclick", function() { + // Add hidden input if it doesn’t already exist. + if( $buttonPlaceholder === undefined ) { + $buttonPlaceholder = $( "", { + type: "hidden", + name: $el.attr( "name" ), + value: $el.attr( "value" ) + }).insertBefore( $el ); + + // Bind to doc to remove after submit handling + $( document ).one("submit", function(){ + $buttonPlaceholder.remove(); + + // reset the local var so that the hidden input + // will be re-added on subsequent clicks + $buttonPlaceholder = undefined; + }); + } + }); + } + + $el.bind({ + focus: function() { + $button.addClass( $.mobile.focusClass ); + }, + + blur: function() { + $button.removeClass( $.mobile.focusClass ); + } + }); + + this.refresh(); + }, + + enable: function() { + this.element.attr( "disabled", false ); + this.button.removeClass( "ui-disabled" ).attr( "aria-disabled", false ); + return this._setOption( "disabled", false ); + }, + + disable: function() { + this.element.attr( "disabled", true ); + this.button.addClass( "ui-disabled" ).attr( "aria-disabled", true ); + return this._setOption( "disabled", true ); + }, + + refresh: function() { + var $el = this.element; + + if ( $el.prop("disabled") ) { + this.disable(); + } else { + this.enable(); + } + + // Grab the button's text element from its implementation-independent data item + $( this.button.data( 'buttonElements' ).text ).text( $el.text() || $el.val() ); + } +}); + +//auto self-init widgets +$( document ).bind( "pagecreate create", function( e ){ + $.mobile.button.prototype.enhanceWithin( e.target, true ); +}); + +})( jQuery ); + +(function( $, undefined ) { + +$.fn.controlgroup = function( options ) { + function flipClasses( els, flCorners ) { + els.removeClass( "ui-btn-corner-all ui-shadow" ) + .eq( 0 ).addClass( flCorners[ 0 ] ) + .end() + .last().addClass( flCorners[ 1 ] ).addClass( "ui-controlgroup-last" ); + } + + return this.each(function() { + var $el = $( this ), + o = $.extend({ + direction: $el.jqmData( "type" ) || "vertical", + shadow: false, + excludeInvisible: true, + mini: $el.jqmData( "mini" ) + }, options ), + groupheading = $el.children( "legend" ), + flCorners = o.direction == "horizontal" ? [ "ui-corner-left", "ui-corner-right" ] : [ "ui-corner-top", "ui-corner-bottom" ], + type = $el.find( "input" ).first().attr( "type" ); + + // Replace legend with more stylable replacement div + if ( groupheading.length ) { + $el.wrapInner( "
          " ); + $( "
          " + groupheading.html() + "
          " ).insertBefore( $el.children(0) ); + groupheading.remove(); + } + + $el.addClass( "ui-corner-all ui-controlgroup ui-controlgroup-" + o.direction ); + + flipClasses( $el.find( ".ui-btn" + ( o.excludeInvisible ? ":visible" : "" ) ).not('.ui-slider-handle'), flCorners ); + flipClasses( $el.find( ".ui-btn-inner" ), flCorners ); + + if ( o.shadow ) { + $el.addClass( "ui-shadow" ); + } + + if ( o.mini ) { + $el.addClass( "ui-mini" ); + } + + }); +}; + +// The pagecreate handler for controlgroup is in jquery.mobile.init because of the soft-dependency on the wrapped widgets + +})(jQuery); + +(function( $, undefined ) { + +$( document ).bind( "pagecreate create", function( e ){ + + //links within content areas, tests included with page + $( e.target ) + .find( "a" ) + .jqmEnhanceable() + .not( ".ui-btn, .ui-link-inherit, :jqmData(role='none'), :jqmData(role='nojs')" ) + .addClass( "ui-link" ); + +}); + +})( jQuery ); + + +( function( $ ) { + var meta = $( "meta[name=viewport]" ), + initialContent = meta.attr( "content" ), + disabledZoom = initialContent + ",maximum-scale=1, user-scalable=no", + enabledZoom = initialContent + ",maximum-scale=10, user-scalable=yes", + disabledInitially = /(user-scalable[\s]*=[\s]*no)|(maximum-scale[\s]*=[\s]*1)[$,\s]/.test( initialContent ); + + $.mobile.zoom = $.extend( {}, { + enabled: !disabledInitially, + locked: false, + disable: function( lock ) { + if( !disabledInitially && !$.mobile.zoom.locked ){ + meta.attr( "content", disabledZoom ); + $.mobile.zoom.enabled = false; + $.mobile.zoom.locked = lock || false; + } + }, + enable: function( unlock ) { + if( !disabledInitially && ( !$.mobile.zoom.locked || unlock === true ) ){ + meta.attr( "content", enabledZoom ); + $.mobile.zoom.enabled = true; + $.mobile.zoom.locked = false; + } + }, + restore: function() { + if( !disabledInitially ){ + meta.attr( "content", initialContent ); + $.mobile.zoom.enabled = true; + } + } + }); + +}( jQuery )); + +(function( $, undefined ) { + +$.widget( "mobile.textinput", $.mobile.widget, { + options: { + theme: null, + // This option defaults to true on iOS devices. + preventFocusZoom: /iPhone|iPad|iPod/.test( navigator.platform ) && navigator.userAgent.indexOf( "AppleWebKit" ) > -1, + initSelector: "input[type='text'], input[type='search'], :jqmData(type='search'), input[type='number'], :jqmData(type='number'), input[type='password'], input[type='email'], input[type='url'], input[type='tel'], textarea, input[type='time'], input[type='date'], input[type='month'], input[type='week'], input[type='datetime'], input[type='datetime-local'], input[type='color'], input:not([type])", + clearSearchButtonText: "clear text" + }, + + _create: function() { + + var input = this.element, + o = this.options, + theme = o.theme || $.mobile.getInheritedTheme( this.element, "c" ), + themeclass = " ui-body-" + theme, + mini = input.jqmData("mini") == true, + miniclass = mini ? " ui-mini" : "", + focusedEl, clearbtn; + + $( "label[for='" + input.attr( "id" ) + "']" ).addClass( "ui-input-text" ); + + focusedEl = input.addClass("ui-input-text ui-body-"+ theme ); + + // XXX: Temporary workaround for issue 785 (Apple bug 8910589). + // Turn off autocorrect and autocomplete on non-iOS 5 devices + // since the popup they use can't be dismissed by the user. Note + // that we test for the presence of the feature by looking for + // the autocorrect property on the input element. We currently + // have no test for iOS 5 or newer so we're temporarily using + // the touchOverflow support flag for jQM 1.0. Yes, I feel dirty. - jblas + if ( typeof input[0].autocorrect !== "undefined" && !$.support.touchOverflow ) { + // Set the attribute instead of the property just in case there + // is code that attempts to make modifications via HTML. + input[0].setAttribute( "autocorrect", "off" ); + input[0].setAttribute( "autocomplete", "off" ); + } + + + //"search" input widget + if ( input.is( "[type='search'],:jqmData(type='search')" ) ) { + + focusedEl = input.wrap( "" ).parent(); + clearbtn = $( "" + o.clearSearchButtonText + "" ) + .bind('click', function( event ) { + input + .val( "" ) + .focus() + .trigger( "change" ); + clearbtn.addClass( "ui-input-clear-hidden" ); + event.preventDefault(); + }) + .appendTo( focusedEl ) + .buttonMarkup({ + icon: "delete", + iconpos: "notext", + corners: true, + shadow: true, + mini: mini + }); + + function toggleClear() { + setTimeout(function() { + clearbtn.toggleClass( "ui-input-clear-hidden", !input.val() ); + }, 0); + } + + toggleClear(); + + input.bind('paste cut keyup focus change blur', toggleClear); + + } else { + input.addClass( "ui-corner-all ui-shadow-inset" + themeclass + miniclass ); + } + + input.focus(function() { + focusedEl.addClass( $.mobile.focusClass ); + }) + .blur(function(){ + focusedEl.removeClass( $.mobile.focusClass ); + }) + // In many situations, iOS will zoom into the select upon tap, this prevents that from happening + .bind( "focus", function() { + if( o.preventFocusZoom ){ + $.mobile.zoom.disable( true ); + } + }) + .bind( "blur", function() { + if( o.preventFocusZoom ){ + $.mobile.zoom.enable( true ); + } + }); + + // Autogrow + if ( input.is( "textarea" ) ) { + var extraLineHeight = 15, + keyupTimeoutBuffer = 100, + keyup = function() { + var scrollHeight = input[ 0 ].scrollHeight, + clientHeight = input[ 0 ].clientHeight; + + if ( clientHeight < scrollHeight ) { + input.height(scrollHeight + extraLineHeight); + } + }, + keyupTimeout; + + input.keyup(function() { + clearTimeout( keyupTimeout ); + keyupTimeout = setTimeout( keyup, keyupTimeoutBuffer ); + }); + + // binding to pagechange here ensures that for pages loaded via + // ajax the height is recalculated without user input + $( document ).one( "pagechange", keyup ); + + // Issue 509: the browser is not providing scrollHeight properly until the styles load + if ( $.trim( input.val() ) ) { + // bind to the window load to make sure the height is calculated based on BOTH + // the DOM and CSS + $( window ).load( keyup ); + } + } + }, + + disable: function(){ + ( this.element.attr( "disabled", true ).is( "[type='search'],:jqmData(type='search')" ) ? + this.element.parent() : this.element ).addClass( "ui-disabled" ); + }, + + enable: function(){ + ( this.element.attr( "disabled", false).is( "[type='search'],:jqmData(type='search')" ) ? + this.element.parent() : this.element ).removeClass( "ui-disabled" ); + } +}); + +//auto self-init widgets +$( document ).bind( "pagecreate create", function( e ){ + $.mobile.textinput.prototype.enhanceWithin( e.target, true ); +}); + +})( jQuery ); + +(function( $, undefined ) { + $.mobile.listview.prototype.options.filter = false; $.mobile.listview.prototype.options.filterPlaceholder = "Filter items..."; $.mobile.listview.prototype.options.filterTheme = "c"; @@ -4530,7 +5793,7 @@ $.mobile.listview.prototype.options.filterCallback = function( text, searchValue return text.toLowerCase().indexOf( searchValue ) === -1; }; -$( ":jqmData(role='listview')" ).live( "listviewcreate", function() { +$( document ).delegate( ":jqmData(role='listview')", "listviewcreate", function() { var list = $( this ), listview = list.data( "listview" ); @@ -4556,13 +5819,11 @@ $( ":jqmData(role='listview')" ).live( "listviewcreate", function() { lastval = $this.jqmData( "lastval" ) + "", childItems = false, itemtext = "", - item, change; + item; // Change val as lastval for next execution $this.jqmData( "lastval" , val ); - change = val.substr( 0 , lastval.length - 1 ).replace( lastval , "" ); - - if ( val.length < lastval.length || change.length != ( val.length - lastval.length ) ) { + if ( val.length < lastval.length || val.indexOf(lastval) !== 0 ) { // Removed chars or pasted something totally different, check all items listItems = list.children(); @@ -4620,7 +5881,7 @@ $( ":jqmData(role='listview')" ).live( "listviewcreate", function() { .appendTo( wrapper ) .textinput(); - if ( $( this ).jqmData( "inset" ) ) { + if ( listview.options.inset ) { wrapper.addClass( "ui-listview-filter-inset" ); } @@ -4630,316 +5891,7 @@ $( ":jqmData(role='listview')" ).live( "listviewcreate", function() { .insertBefore( list ); }); -})( jQuery );/* -* "nojs" plugin - class to make elements hidden to A grade browsers -*/ - -(function( $, undefined ) { - -$( document ).bind( "pagecreate create", function( e ){ - $( ":jqmData(role='nojs')", e.target ).addClass( "ui-nojs" ); - -}); - -})( jQuery );/* -* "checkboxradio" plugin -*/ - -(function( $, undefined ) { - -$.widget( "mobile.checkboxradio", $.mobile.widget, { - options: { - theme: null, - initSelector: "input[type='checkbox'],input[type='radio']" - }, - _create: function() { - var self = this, - input = this.element, - // NOTE: Windows Phone could not find the label through a selector - // filter works though. - label = input.closest( "form,fieldset,:jqmData(role='page')" ).find( "label[for='" + input[ 0 ].id + "']"), - inputtype = input.attr( "type" ), - checkedState = inputtype + "-on", - uncheckedState = inputtype + "-off", - icon = input.parents( ":jqmData(type='horizontal')" ).length ? undefined : uncheckedState, - activeBtn = icon ? "" : " " + $.mobile.activeBtnClass, - checkedClass = "ui-" + checkedState + activeBtn, - uncheckedClass = "ui-" + uncheckedState, - checkedicon = "ui-icon-" + checkedState, - uncheckedicon = "ui-icon-" + uncheckedState; - - if ( inputtype !== "checkbox" && inputtype !== "radio" ) { - return; - } - - // Expose for other methods - $.extend( this, { - label: label, - inputtype: inputtype, - checkedClass: checkedClass, - uncheckedClass: uncheckedClass, - checkedicon: checkedicon, - uncheckedicon: uncheckedicon - }); - - // If there's no selected theme... - if( !this.options.theme ) { - this.options.theme = this.element.jqmData( "theme" ); - } - - label.buttonMarkup({ - theme: this.options.theme, - icon: icon, - shadow: false - }); - - // Wrap the input + label in a div - input.add( label ) - .wrapAll( "
          " ); - - label.bind({ - vmouseover: function( event ) { - if ( $( this ).parent().is( ".ui-disabled" ) ) { - event.stopPropagation(); - } - }, - - vclick: function( event ) { - if ( input.is( ":disabled" ) ) { - event.preventDefault(); - return; - } - - self._cacheVals(); - - input.prop( "checked", inputtype === "radio" && true || !input.prop( "checked" ) ); - - // trigger click handler's bound directly to the input as a substitute for - // how label clicks behave normally in the browsers - // TODO: it would be nice to let the browser's handle the clicks and pass them - // through to the associate input. we can swallow that click at the parent - // wrapper element level - input.triggerHandler( 'click' ); - - // Input set for common radio buttons will contain all the radio - // buttons, but will not for checkboxes. clearing the checked status - // of other radios ensures the active button state is applied properly - self._getInputSet().not( input ).prop( "checked", false ); - - self._updateAll(); - return false; - } - - }); - - input - .bind({ - vmousedown: function() { - self._cacheVals(); - }, - - vclick: function() { - var $this = $(this); - - // Adds checked attribute to checked input when keyboard is used - if ( $this.is( ":checked" ) ) { - - $this.prop( "checked", true); - self._getInputSet().not($this).prop( "checked", false ); - } else { - - $this.prop( "checked", false ); - } - - self._updateAll(); - }, - - focus: function() { - label.addClass( "ui-focus" ); - }, - - blur: function() { - label.removeClass( "ui-focus" ); - } - }); - - this.refresh(); - }, - - _cacheVals: function() { - this._getInputSet().each(function() { - var $this = $(this); - - $this.jqmData( "cacheVal", $this.is( ":checked" ) ); - }); - }, - - //returns either a set of radios with the same name attribute, or a single checkbox - _getInputSet: function(){ - if(this.inputtype == "checkbox") { - return this.element; - } - - return this.element.closest( "form,fieldset,:jqmData(role='page')" ) - .find( "input[name='"+ this.element.attr( "name" ) +"'][type='"+ this.inputtype +"']" ); - }, - - _updateAll: function() { - var self = this; - - this._getInputSet().each(function() { - var $this = $(this); - - if ( $this.is( ":checked" ) || self.inputtype === "checkbox" ) { - $this.trigger( "change" ); - } - }) - .checkboxradio( "refresh" ); - }, - - refresh: function() { - var input = this.element, - label = this.label, - icon = label.find( ".ui-icon" ); - - // input[0].checked expando doesn't always report the proper value - // for checked='checked' - if ( $( input[ 0 ] ).prop( "checked" ) ) { - - label.addClass( this.checkedClass ).removeClass( this.uncheckedClass ); - icon.addClass( this.checkedicon ).removeClass( this.uncheckedicon ); - - } else { - - label.removeClass( this.checkedClass ).addClass( this.uncheckedClass ); - icon.removeClass( this.checkedicon ).addClass( this.uncheckedicon ); - } - - if ( input.is( ":disabled" ) ) { - this.disable(); - } else { - this.enable(); - } - }, - - disable: function() { - this.element.prop( "disabled", true ).parent().addClass( "ui-disabled" ); - }, - - enable: function() { - this.element.prop( "disabled", false ).parent().removeClass( "ui-disabled" ); - } -}); - -//auto self-init widgets -$( document ).bind( "pagecreate create", function( e ){ - $.mobile.checkboxradio.prototype.enhanceWithin( e.target ); -}); - })( jQuery ); -/* -* "button" plugin - links that proxy to native input/buttons -*/ - -(function( $, undefined ) { - -$.widget( "mobile.button", $.mobile.widget, { - options: { - theme: null, - icon: null, - iconpos: null, - inline: null, - corners: true, - shadow: true, - iconshadow: true, - initSelector: "button, [type='button'], [type='submit'], [type='reset'], [type='image']" - }, - _create: function() { - var $el = this.element, - o = this.options, - type, - name, - $buttonPlaceholder; - - // Add ARIA role - this.button = $( "
          " ) - .text( $el.text() || $el.val() ) - .insertBefore( $el ) - .buttonMarkup({ - theme: o.theme, - icon: o.icon, - iconpos: o.iconpos, - inline: o.inline, - corners: o.corners, - shadow: o.shadow, - iconshadow: o.iconshadow - }) - .append( $el.addClass( "ui-btn-hidden" ) ); - - type = $el.attr( "type" ); - name = $el.attr( "name" ); - - // Add hidden input during submit if input type="submit" has a name. - if ( type !== "button" && type !== "reset" && name ) { - $el.bind( "vclick", function() { - // Add hidden input if it doesn’t already exist. - if( $buttonPlaceholder === undefined ) { - $buttonPlaceholder = $( "", { - type: "hidden", - name: $el.attr( "name" ), - value: $el.attr( "value" ) - }).insertBefore( $el ); - - // Bind to doc to remove after submit handling - $( document ).one("submit", function(){ - $buttonPlaceholder.remove(); - - // reset the local var so that the hidden input - // will be re-added on subsequent clicks - $buttonPlaceholder = undefined; - }); - } - }); - } - - this.refresh(); - }, - - enable: function() { - this.element.attr( "disabled", false ); - this.button.removeClass( "ui-disabled" ).attr( "aria-disabled", false ); - return this._setOption( "disabled", false ); - }, - - disable: function() { - this.element.attr( "disabled", true ); - this.button.addClass( "ui-disabled" ).attr( "aria-disabled", true ); - return this._setOption( "disabled", true ); - }, - - refresh: function() { - var $el = this.element; - - if ( $el.prop("disabled") ) { - this.disable(); - } else { - this.enable(); - } - - // the textWrapper is stored as a data element on the button object - // to prevent referencing by it's implementation details (eg 'class') - this.button.data( 'textWrapper' ).text( $el.text() || $el.val() ); - } -}); - -//auto self-init widgets -$( document ).bind( "pagecreate create", function( e ){ - $.mobile.button.prototype.enhanceWithin( e.target ); -}); - -})( jQuery );/* -* "slider" plugin -*/ ( function( $, undefined ) { @@ -4948,7 +5900,8 @@ $.widget( "mobile.slider", $.mobile.widget, { theme: null, trackTheme: null, disabled: false, - initSelector: "input[type='range'], :jqmData(type='range'), :jqmData(role='slider')" + initSelector: "input[type='range'], :jqmData(type='range'), :jqmData(role='slider')", + mini: false }, _create: function() { @@ -4984,12 +5937,31 @@ $.widget( "mobile.slider", $.mobile.widget, { step = window.parseFloat( control.attr( "step" ) || 1 ), - slider = $( "
          " ), + inlineClass = ( this.options.inline || control.jqmData("inline") == true ) ? " ui-slider-inline" : "", - handle = $( "" ) - .appendTo( slider ) - .buttonMarkup({ corners: true, theme: theme, shadow: true }) + miniClass = ( this.options.mini || control.jqmData("mini") ) ? " ui-slider-mini" : "", + + + domHandle = document.createElement('a'), + handle = $( domHandle ), + domSlider = document.createElement('div'), + slider = $( domSlider ), + + valuebg = control.jqmData("highlight") && cType != "select" ? (function() { + var bg = document.createElement('div'); + bg.className = 'ui-slider-bg ui-btn-active ui-btn-corner-all'; + return $( bg ).prependTo( slider ); + })() : false, + + options; + + domHandle.setAttribute( 'href', "#" ); + domSlider.setAttribute('role','application'); + domSlider.className = ['ui-slider ',selectClass," ui-btn-down-",trackTheme,' ui-btn-corner-all', inlineClass, miniClass].join(""); + domHandle.className = 'ui-slider-handle'; + domSlider.appendChild(domHandle); + + handle.buttonMarkup({ corners: true, theme: theme, shadow: true }) .attr({ "role": "slider", "aria-valuemin": min, @@ -4998,12 +5970,12 @@ $.widget( "mobile.slider", $.mobile.widget, { "aria-valuetext": val(), "title": val(), "aria-labelledby": labelID - }), - options; + }); $.extend( this, { slider: slider, handle: handle, + valuebg: valuebg, dragging: false, beforeStart: null, userModified: false, @@ -5011,26 +5983,35 @@ $.widget( "mobile.slider", $.mobile.widget, { }); if ( cType == "select" ) { + var wrapper = document.createElement('div'); + wrapper.className = 'ui-slider-inneroffset'; + + for(var j = 0,length = domSlider.childNodes.length;j < length;j++){ + wrapper.appendChild(domSlider.childNodes[j]); + } + + domSlider.appendChild(wrapper); + + // slider.wrapInner( "
          " ); - slider.wrapInner( "
          " ); - // make the handle move with a smooth transition handle.addClass( "ui-slider-handle-snapping" ); options = control.find( "option" ); - control.find( "option" ).each(function( i ) { - + for(var i = 0, optionsCount = options.length; i < optionsCount; i++){ var side = !i ? "b":"a", - corners = !i ? "right" :"left", - theme = !i ? " ui-btn-down-" + trackTheme :( " " + $.mobile.activeBtnClass ); + sliderTheme = !i ? " ui-btn-down-" + trackTheme :( " " + $.mobile.activeBtnClass ), + sliderLabel = document.createElement('div'), + sliderImg = document.createElement('span'); - $( "
          " ) - .prependTo( slider ); + sliderImg.className = ['ui-slider-label ui-slider-label-',side,sliderTheme," ui-btn-corner-all"].join(""); + sliderImg.setAttribute('role','img'); + sliderImg.appendChild(document.createTextNode(options[i].innerHTML)); + $(sliderImg).prependTo( slider ); + } - $( "" + $( this ).getEncodedText() + "" ) - .prependTo( handle ); - }); + self._labels = $( ".ui-slider-label", slider ); } @@ -5056,14 +6037,14 @@ $.widget( "mobile.slider", $.mobile.widget, { if ( self.dragging ) { // self.mouseMoved must be updated before refresh() because it will be used in the control "change" event self.mouseMoved = true; - + if ( cType === "select" ) { // make the handle move in sync with the mouse handle.removeClass( "ui-slider-handle-snapping" ); } - + self.refresh( event ); - + // only after refresh() you can calculate self.userModified self.userModified = self.beforeStart !== control[0].selectedIndex; return false; @@ -5078,10 +6059,11 @@ $.widget( "mobile.slider", $.mobile.widget, { if ( cType === "select" ) { self.beforeStart = control[0].selectedIndex; } - + self.refresh( event ); return false; - }); + }) + .bind( "vclick", false ); slider.add( document ) .bind( "vmouseup", function() { @@ -5090,12 +6072,12 @@ $.widget( "mobile.slider", $.mobile.widget, { self.dragging = false; if ( cType === "select") { - + // make the handle move with a smooth transition handle.addClass( "ui-slider-handle-snapping" ); - + if ( self.mouseMoved ) { - + // this is a drag, change the value only if user dragged enough if ( self.userModified ) { self.refresh( self.beforeStart == 0 ? 1 : 0 ); @@ -5103,32 +6085,45 @@ $.widget( "mobile.slider", $.mobile.widget, { else { self.refresh( self.beforeStart ); } - + } else { // this is just a click, change the value self.refresh( self.beforeStart == 0 ? 1 : 0 ); } - + } - + self.mouseMoved = false; - + return false; } }); slider.insertAfter( control ); - // NOTE force focus on handle - this.handle - .bind( "vmousedown", function() { - $( this ).focus(); - }) - .bind( "vclick", false ); + // Only add focus class to toggle switch, sliders get it automatically from ui-btn + if( cType == 'select' ) { + this.handle.bind({ + focus: function() { + slider.addClass( $.mobile.focusClass ); + }, - this.handle - .bind( "keydown", function( event ) { + blur: function() { + slider.removeClass( $.mobile.focusClass ); + } + }); + } + + this.handle.bind({ + // NOTE force focus on handle + vmousedown: function() { + $( this ).focus(); + }, + + vclick: false, + + keydown: function( event ) { var index = val(); if ( self.options.disabled ) { @@ -5137,48 +6132,50 @@ $.widget( "mobile.slider", $.mobile.widget, { // In all cases prevent the default and mark the handle as active switch ( event.keyCode ) { - case $.mobile.keyCode.HOME: - case $.mobile.keyCode.END: - case $.mobile.keyCode.PAGE_UP: - case $.mobile.keyCode.PAGE_DOWN: - case $.mobile.keyCode.UP: - case $.mobile.keyCode.RIGHT: - case $.mobile.keyCode.DOWN: - case $.mobile.keyCode.LEFT: - event.preventDefault(); + case $.mobile.keyCode.HOME: + case $.mobile.keyCode.END: + case $.mobile.keyCode.PAGE_UP: + case $.mobile.keyCode.PAGE_DOWN: + case $.mobile.keyCode.UP: + case $.mobile.keyCode.RIGHT: + case $.mobile.keyCode.DOWN: + case $.mobile.keyCode.LEFT: + event.preventDefault(); - if ( !self._keySliding ) { - self._keySliding = true; - $( this ).addClass( "ui-state-active" ); - } - break; + if ( !self._keySliding ) { + self._keySliding = true; + $( this ).addClass( "ui-state-active" ); + } + break; } // move the slider according to the keypress switch ( event.keyCode ) { - case $.mobile.keyCode.HOME: - self.refresh( min ); - break; - case $.mobile.keyCode.END: - self.refresh( max ); - break; - case $.mobile.keyCode.PAGE_UP: - case $.mobile.keyCode.UP: - case $.mobile.keyCode.RIGHT: - self.refresh( index + step ); - break; - case $.mobile.keyCode.PAGE_DOWN: - case $.mobile.keyCode.DOWN: - case $.mobile.keyCode.LEFT: - self.refresh( index - step ); - break; + case $.mobile.keyCode.HOME: + self.refresh( min ); + break; + case $.mobile.keyCode.END: + self.refresh( max ); + break; + case $.mobile.keyCode.PAGE_UP: + case $.mobile.keyCode.UP: + case $.mobile.keyCode.RIGHT: + self.refresh( index + step ); + break; + case $.mobile.keyCode.PAGE_DOWN: + case $.mobile.keyCode.DOWN: + case $.mobile.keyCode.LEFT: + self.refresh( index - step ); + break; } - }) // remove active mark - .keyup( function( event ) { + }, // remove active mark + + keyup: function( event ) { if ( self._keySliding ) { self._keySliding = false; $( this ).removeClass( "ui-state-active" ); } + } }); this.refresh(undefined, undefined, true); @@ -5193,7 +6190,8 @@ $.widget( "mobile.slider", $.mobile.widget, { var control = this.element, percent, cType = control[0].nodeName.toLowerCase(), min = cType === "input" ? parseFloat( control.attr( "min" ) ) : 0, - max = cType === "input" ? parseFloat( control.attr( "max" ) ) : control.find( "option" ).length - 1; + max = cType === "input" ? parseFloat( control.attr( "max" ) ) : control.find( "option" ).length - 1, + step = (cType === "input" && parseFloat( control.attr( "step" ) ) > 0) ? parseFloat(control.attr("step")) : 1; if ( typeof val === "object" ) { var data = val, @@ -5207,7 +6205,7 @@ $.widget( "mobile.slider", $.mobile.widget, { percent = Math.round( ( ( data.pageX - this.slider.offset().left ) / this.slider.width() ) * 100 ); } else { if ( val == null ) { - val = cType === "input" ? parseFloat( control.val() ) : control[0].selectedIndex; + val = cType === "input" ? parseFloat( control.val() || 0 ) : control[0].selectedIndex; } percent = ( parseFloat( val ) - min ) / ( max - min ) * 100; } @@ -5224,7 +6222,18 @@ $.widget( "mobile.slider", $.mobile.widget, { percent = 100; } - var newval = Math.round( ( percent / 100 ) * ( max - min ) ) + min; + var newval = ( percent / 100 ) * ( max - min ) + min; + + //from jQuery UI slider, the following source will round to the nearest step + var valModStep = ( newval - min ) % step; + var alignValue = newval - valModStep; + + if ( Math.abs( valModStep ) * 2 >= step ) { + alignValue += ( valModStep > 0 ) ? step : ( -step ); + } + // Since JavaScript has problems with large floats, round + // the final value to 5 digits after the decimal point (see jQueryUI: #4124) + newval = parseFloat( alignValue.toFixed(5) ); if ( newval < min ) { newval = min; @@ -5234,26 +6243,24 @@ $.widget( "mobile.slider", $.mobile.widget, { newval = max; } - // Flip the stack of the bg colors - if ( percent > 60 && cType === "select" ) { - // TODO: Dead path? - } this.handle.css( "left", percent + "%" ); this.handle.attr( { "aria-valuenow": cType === "input" ? newval : control.find( "option" ).eq( newval ).attr( "value" ), "aria-valuetext": cType === "input" ? newval : control.find( "option" ).eq( newval ).getEncodedText(), - title: newval + title: cType === "input" ? newval : control.find( "option" ).eq( newval ).getEncodedText() }); + this.valuebg && this.valuebg.css( "width", percent + "%" ); - // add/remove classes for flip toggle switch - if ( cType === "select" ) { - if ( newval === 0 ) { - this.slider.addClass( "ui-slider-switch-a" ) - .removeClass( "ui-slider-switch-b" ); - } else { - this.slider.addClass( "ui-slider-switch-b" ) - .removeClass( "ui-slider-switch-a" ); - } + // drag the label widths + if ( this._labels ) { + var handlePercent = this.handle.width() / this.slider.width() * 100, + aPercent = percent && handlePercent + ( 100 - handlePercent ) * percent / 100, + bPercent = percent === 100 ? 0 : Math.min( handlePercent + 100 - aPercent, 100 ); + + this._labels.each(function(){ + var ab = $(this).is( ".ui-slider-label-a" ); + $( this ).width( ( ab ? aPercent : bPercent ) + "%" ); + }); } if ( !preventInputUpdate ) { @@ -5289,138 +6296,247 @@ $.widget( "mobile.slider", $.mobile.widget, { //auto self-init widgets $( document ).bind( "pagecreate create", function( e ){ - $.mobile.slider.prototype.enhanceWithin( e.target ); + $.mobile.slider.prototype.enhanceWithin( e.target, true ); }); })( jQuery ); -/* -* "textinput" plugin for text inputs, textareas -*/ (function( $, undefined ) { -$.widget( "mobile.textinput", $.mobile.widget, { +$.widget( "mobile.selectmenu", $.mobile.widget, { options: { theme: null, - initSelector: "input[type='text'], input[type='search'], :jqmData(type='search'), input[type='number'], :jqmData(type='number'), input[type='password'], input[type='email'], input[type='url'], input[type='tel'], textarea, input[type='time'], input[type='date'], input[type='month'], input[type='week'], input[type='datetime'], input[type='datetime-local'], input[type='color'], input:not([type])" + disabled: false, + icon: "arrow-d", + iconpos: "right", + inline: false, + corners: true, + shadow: true, + iconshadow: true, + overlayTheme: "a", + hidePlaceholderMenuItems: true, + closeText: "Close", + nativeMenu: true, + // This option defaults to true on iOS devices. + preventFocusZoom: /iPhone|iPad|iPod/.test( navigator.platform ) && navigator.userAgent.indexOf( "AppleWebKit" ) > -1, + initSelector: "select:not(:jqmData(role='slider'))", + mini: false + }, + + _button: function(){ + return $( "
          " ); + }, + + _setDisabled: function( value ) { + this.element.attr( "disabled", value ); + this.button.attr( "aria-disabled", value ); + return this._setOption( "disabled", value ); + }, + + _focusButton : function() { + var self = this; + + setTimeout( function() { + self.button.focus(); + }, 40); + }, + + _selectOptions: function() { + return this.select.find( "option" ); + }, + + // setup items that are generally necessary for select menu extension + _preExtension: function(){ + var classes = ""; + // TODO: Post 1.1--once we have time to test thoroughly--any classes manually applied to the original element should be carried over to the enhanced element, with an `-enhanced` suffix. See https://github.com/jquery/jquery-mobile/issues/3577 + /* if( $el[0].className.length ) { + classes = $el[0].className; + } */ + if( !!~this.element[0].className.indexOf( "ui-btn-left" ) ) { + classes = " ui-btn-left"; + } + + if( !!~this.element[0].className.indexOf( "ui-btn-right" ) ) { + classes = " ui-btn-right"; + } + + this.select = this.element.wrap( "
          " ); + this.selectID = this.select.attr( "id" ); + this.label = $( "label[for='"+ this.selectID +"']" ).addClass( "ui-select" ); + this.isMultiple = this.select[ 0 ].multiple; + if ( !this.options.theme ) { + this.options.theme = $.mobile.getInheritedTheme( this.select, "c" ); + } }, _create: function() { + this._preExtension(); - var input = this.element, - o = this.options, - theme = o.theme || $.mobile.getInheritedTheme( this.element, "c" ), - themeclass = " ui-body-" + theme, - focusedEl, clearbtn; + // Allows for extension of the native select for custom selects and other plugins + // see select.custom for example extension + // TODO explore plugin registration + this._trigger( "beforeCreate" ); - $( "label[for='" + input.attr( "id" ) + "']" ).addClass( "ui-input-text" ); + this.button = this._button(); - focusedEl = input.addClass("ui-input-text ui-body-"+ theme ); + var self = this, - // XXX: Temporary workaround for issue 785 (Apple bug 8910589). - // Turn off autocorrect and autocomplete on non-iOS 5 devices - // since the popup they use can't be dismissed by the user. Note - // that we test for the presence of the feature by looking for - // the autocorrect property on the input element. We currently - // have no test for iOS 5 or newer so we're temporarily using - // the touchOverflow support flag for jQM 1.0. Yes, I feel dirty. - jblas - if ( typeof input[0].autocorrect !== "undefined" && !$.support.touchOverflow ) { - // Set the attribute instead of the property just in case there - // is code that attempts to make modifications via HTML. - input[0].setAttribute( "autocorrect", "off" ); - input[0].setAttribute( "autocomplete", "off" ); - } + options = this.options, + // IE throws an exception at options.item() function when + // there is no selected item + // select first in this case + selectedIndex = this.select[ 0 ].selectedIndex == -1 ? 0 : this.select[ 0 ].selectedIndex, - //"search" input widget - if ( input.is( "[type='search'],:jqmData(type='search')" ) ) { - - focusedEl = input.wrap( "" ).parent(); - clearbtn = $( "clear text" ) - .tap(function( event ) { - input.val( "" ).focus(); - input.trigger( "change" ); - clearbtn.addClass( "ui-input-clear-hidden" ); - event.preventDefault(); - }) - .appendTo( focusedEl ) - .buttonMarkup({ - icon: "delete", - iconpos: "notext", - corners: true, - shadow: true + // TODO values buttonId and menuId are undefined here + button = this.button + .text( $( this.select[ 0 ].options.item( selectedIndex ) ).text() ) + .insertBefore( this.select ) + .buttonMarkup( { + theme: options.theme, + icon: options.icon, + iconpos: options.iconpos, + inline: options.inline, + corners: options.corners, + shadow: options.shadow, + iconshadow: options.iconshadow, + mini: options.mini }); - function toggleClear() { - setTimeout(function() { - clearbtn.toggleClass( "ui-input-clear-hidden", !input.val() ); - }, 0); - } - - toggleClear(); - - input.bind('paste cut keyup focus change blur', toggleClear); - - } else { - input.addClass( "ui-corner-all ui-shadow-inset" + themeclass ); + // Opera does not properly support opacity on select elements + // In Mini, it hides the element, but not its text + // On the desktop,it seems to do the opposite + // for these reasons, using the nativeMenu option results in a full native select in Opera + if ( options.nativeMenu && window.opera && window.opera.version ) { + this.select.addClass( "ui-select-nativeonly" ); } - input.focus(function() { - focusedEl.addClass( "ui-focus" ); + // Add counter for multi selects + if ( this.isMultiple ) { + this.buttonCount = $( "" ) + .addClass( "ui-li-count ui-btn-up-c ui-btn-corner-all" ) + .hide() + .appendTo( button.addClass('ui-li-has-count') ); + } + + // Disable if specified + if ( options.disabled || this.element.attr('disabled')) { + this.disable(); + } + + // Events on native select + this.select.change( function() { + self.refresh(); + }); + + this.build(); + }, + + build: function() { + var self = this; + + this.select + .appendTo( self.button ) + .bind( "vmousedown", function() { + // Add active class to button + self.button.addClass( $.mobile.activeBtnClass ); }) - .blur(function(){ - focusedEl.removeClass( "ui-focus" ); + .bind( "focus", function() { + self.button.addClass( $.mobile.focusClass ); + }) + .bind( "blur", function() { + self.button.removeClass( $.mobile.focusClass ); + }) + .bind( "focus vmouseover", function() { + self.button.trigger( "vmouseover" ); + }) + .bind( "vmousemove", function() { + // Remove active class on scroll/touchmove + self.button.removeClass( $.mobile.activeBtnClass ); + }) + .bind( "change blur vmouseout", function() { + self.button.trigger( "vmouseout" ) + .removeClass( $.mobile.activeBtnClass ); + }) + .bind( "change blur", function() { + self.button.removeClass( "ui-btn-down-" + self.options.theme ); }); - // Autogrow - if ( input.is( "textarea" ) ) { - var extraLineHeight = 15, - keyupTimeoutBuffer = 100, - keyup = function() { - var scrollHeight = input[ 0 ].scrollHeight, - clientHeight = input[ 0 ].clientHeight; - - if ( clientHeight < scrollHeight ) { - input.height(scrollHeight + extraLineHeight); - } - }, - keyupTimeout; - - input.keyup(function() { - clearTimeout( keyupTimeout ); - keyupTimeout = setTimeout( keyup, keyupTimeoutBuffer ); - }); - - // Issue 509: the browser is not providing scrollHeight properly until the styles load - if ( $.trim( input.val() ) ) { - // bind to the window load to make sure the height is calculated based on BOTH - // the DOM and CSS - $( window ).load( keyup ); - - // binding to pagechange here ensures that for pages loaded via - // ajax the height is recalculated without user input - $( document ).one( "pagechange", keyup ); + // In many situations, iOS will zoom into the select upon tap, this prevents that from happening + self.button.bind( "vmousedown", function() { + if( self.options.preventFocusZoom ){ + $.mobile.zoom.disable( true ); } + }) + .bind( "mouseup", function() { + if( self.options.preventFocusZoom ){ + $.mobile.zoom.enable( true ); + } + }); + }, + + selected: function() { + return this._selectOptions().filter( ":selected" ); + }, + + selectedIndices: function() { + var self = this; + + return this.selected().map( function() { + return self._selectOptions().index( this ); + }).get(); + }, + + setButtonText: function() { + var self = this, selected = this.selected(); + + this.button.find( ".ui-btn-text" ).text( function() { + if ( !self.isMultiple ) { + return selected.text(); + } + + return selected.length ? selected.map( function() { + return $( this ).text(); + }).get().join( ", " ) : self.placeholder; + }); + }, + + setButtonCount: function() { + var selected = this.selected(); + + // multiple count inside button + if ( this.isMultiple ) { + this.buttonCount[ selected.length > 1 ? "show" : "hide" ]().text( selected.length ); } }, - disable: function(){ - ( this.element.attr( "disabled", true ).is( "[type='search'],:jqmData(type='search')" ) ? - this.element.parent() : this.element ).addClass( "ui-disabled" ); + refresh: function() { + this.setButtonText(); + this.setButtonCount(); }, - enable: function(){ - ( this.element.attr( "disabled", false).is( "[type='search'],:jqmData(type='search')" ) ? - this.element.parent() : this.element ).removeClass( "ui-disabled" ); + // open and close preserved in native selects + // to simplify users code when looping over selects + open: $.noop, + close: $.noop, + + disable: function() { + this._setDisabled( true ); + this.button.addClass( "ui-disabled" ); + }, + + enable: function() { + this._setDisabled( false ); + this.button.removeClass( "ui-disabled" ); } }); //auto self-init widgets $( document ).bind( "pagecreate create", function( e ){ - $.mobile.textinput.prototype.enhanceWithin( e.target ); + $.mobile.selectmenu.prototype.enhanceWithin( e.target, true ); }); - })( jQuery ); + /* * custom "selectmenu" plugin */ @@ -5442,7 +6558,7 @@ $( document ).bind( "pagecreate create", function( e ){ "
          " + label.getEncodedText() + "
          "+ "
          "+ "
          "+ - "
          " ).appendTo( $.mobile.pageContainer ).page(), + "
          " ), listbox = $("
          ", { "class": "ui-selectmenu ui-selectmenu-hidden ui-overlay-shadow ui-corner-all ui-body-" + widget.options.overlayTheme + " " + $.mobile.defaultDialogTransition } ).insertAfter(screen), @@ -5461,16 +6577,17 @@ $( document ).bind( "pagecreate create", function( e ){ "class": "ui-title" }).appendTo( header ), + menuPageContent, + menuPageClose, + headerClose; + + if( widget.isMultiple ) { headerClose = $( "", { "text": widget.options.closeText, "href": "#", "class": "ui-btn-left" - }).attr( "data-" + $.mobile.ns + "iconpos", "notext" ).attr( "data-" + $.mobile.ns + "icon", "delete" ).appendTo( header ).buttonMarkup(), - - menuPageContent = menuPage.find( ".ui-content" ), - - menuPageClose = menuPage.find( ".ui-header a" ); - + }).attr( "data-" + $.mobile.ns + "iconpos", "notext" ).attr( "data-" + $.mobile.ns + "icon", "delete" ).appendTo( header ).buttonMarkup(); + } $.extend( widget, { select: widget.select, @@ -5517,11 +6634,16 @@ $( document ).bind( "pagecreate create", function( e ){ // Events for list items self.list.attr( "role", "listbox" ) - .delegate( ".ui-li>a", "focusin", function() { - $( this ).attr( "tabindex", "0" ); + .bind( "focusin", function( e ){ + $( e.target ) + .attr( "tabindex", "0" ) + .trigger( "vmouseover" ); + }) - .delegate( ".ui-li>a", "focusout", function() { - $( this ).attr( "tabindex", "-1" ); + .bind( "focusout", function( e ){ + $( e.target ) + .attr( "tabindex", "-1" ) + .trigger( "vmouseout" ); }) .delegate( "li:not(.ui-disabled, .ui-li-divider)", "click", function( event ) { @@ -5561,7 +6683,11 @@ $( document ).bind( "pagecreate create", function( e ){ switch ( event.keyCode ) { // up or left arrow keys case 38: - prev = li.prev(); + prev = li.prev().not( ".ui-selectmenu-placeholder" ); + + if( prev.is( ".ui-li-divider" ) ) { + prev = prev.prev(); + } // if there's a previous option, focus it if ( prev.length ) { @@ -5569,7 +6695,7 @@ $( document ).bind( "pagecreate create", function( e ){ .blur() .attr( "tabindex", "-1" ); - prev.find( "a" ).first().focus(); + prev.addClass( "ui-btn-down-" + widget.options.theme ).find( "a" ).first().focus(); } return false; @@ -5579,13 +6705,17 @@ $( document ).bind( "pagecreate create", function( e ){ case 40: next = li.next(); + if( next.is( ".ui-li-divider" ) ) { + next = next.next(); + } + // if there's a next option, focus it if ( next.length ) { target .blur() .attr( "tabindex", "-1" ); - next.find( "a" ).first().focus(); + next.addClass( "ui-btn-down-" + widget.options.theme ).find( "a" ).first().focus(); } return false; @@ -5628,12 +6758,14 @@ $( document ).bind( "pagecreate create", function( e ){ }); // Close button on small overlays - self.headerClose.click( function() { - if ( self.menuType == "overlay" ) { - self.close(); - return false; - } - }); + if( self.isMultiple ){ + self.headerClose.click( function() { + if ( self.menuType == "overlay" ) { + self.close(); + return false; + } + }); + } // track this dependency so that when the parent page // is removed on pagehide it will also remove the menupage @@ -5681,7 +6813,11 @@ $( document ).bind( "pagecreate create", function( e ){ if ( self.isMultiple ) { item.find( ".ui-icon" ).removeClass( "ui-icon-checkbox-off" ).addClass( "ui-icon-checkbox-on" ); } else { - item.addClass( $.mobile.activeBtnClass ); + if( item.is( ".ui-selectmenu-placeholder" ) ) { + item.next().addClass( $.mobile.activeBtnClass ); + } else { + item.addClass( $.mobile.activeBtnClass ); + } } } }); @@ -5716,15 +6852,16 @@ $( document ).bind( "pagecreate create", function( e ){ } var self = this, - menuHeight = self.list.parent().outerHeight(), - menuWidth = self.list.parent().outerWidth(), + $window = $( window ), + selfListParent = self.list.parent(), + menuHeight = selfListParent.outerHeight(), + menuWidth = selfListParent.outerWidth(), activePage = $( ".ui-page-active" ), - tOverflow = $.support.touchOverflow && $.mobile.touchOverflowEnabled, - tScrollElem = activePage.is( ".ui-native-fixed" ) ? activePage.find( ".ui-content" ) : activePage; - scrollTop = tOverflow ? tScrollElem.scrollTop() : $( window ).scrollTop(), + tScrollElem = activePage, + scrollTop = $window.scrollTop(), btnOffset = self.button.offset().top, - screenHeight = window.innerHeight, - screenWidth = window.innerWidth; + screenHeight = $window.height(), + screenWidth = $window.width(); //add active class to button self.button.addClass( $.mobile.activeBtnClass ); @@ -5735,10 +6872,15 @@ $( document ).bind( "pagecreate create", function( e ){ }, 300); function focusMenuItem() { - self.list.find( $.mobile.activeBtnClass ).focus(); + self.list.find( "." + $.mobile.activeBtnClass + " a" ).focus(); } if ( menuHeight > screenHeight - 80 || !$.support.scrollTop ) { + + self.menuPage.appendTo( $.mobile.pageContainer ).page(); + self.menuPageContent = menuPage.find( ".ui-content" ); + self.menuPageClose = menuPage.find( ".ui-header a" ); + // prevent the parent page from being removed from the DOM, // otherwise the results of selecting a list item in the dialog // fall into a black hole @@ -5752,15 +6894,7 @@ $( document ).bind( "pagecreate create", function( e ){ } self.menuPage.one( "pageshow", function() { - // silentScroll() is called whenever a page is shown to restore - // any previous scroll position the page may have had. We need to - // wait for the "silentscroll" event before setting focus to avoid - // the browser"s "feature" which offsets rendering to make sure - // whatever has focus is in view. - $( window ).one( "silentscroll", function() { - focusMenuItem(); - }); - + focusMenuItem(); self.isOpen = true; }); @@ -5825,61 +6959,74 @@ $( document ).bind( "pagecreate create", function( e ){ var self = this, o = this.options, placeholder = this.placeholder, + needPlaceholder = true, optgroups = [], lis = [], dataIcon = self.isMultiple ? "checkbox-off" : "false"; self.list.empty().filter( ".ui-listview" ).listview( "destroy" ); - // Populate menu with options from select element - self.select.find( "option" ).each( function( i ) { - var $this = $( this ), - $parent = $this.parent(), - text = $this.getEncodedText(), - anchor = ""+ text +"", - classes = [], - extraAttrs = []; + var $options = self.select.find("option"), + numOptions = $options.length, + select = this.select[ 0 ], + dataPrefix = 'data-' + $.mobile.ns, + dataIndexAttr = dataPrefix + 'option-index', + dataIconAttr = dataPrefix + 'icon', + dataRoleAttr = dataPrefix + 'role', + fragment = document.createDocumentFragment(), + optGroup; + + for (var i = 0; i < numOptions;i++){ + var option = $options[i], + $option = $(option), + parent = option.parentNode, + text = $option.text(), + anchor = document.createElement('a'), + classes = []; + + anchor.setAttribute('href','#'); + anchor.appendChild(document.createTextNode(text)); // Are we inside an optgroup? - if ( $parent.is( "optgroup" ) ) { - var optLabel = $parent.attr( "label" ); - - // has this optgroup already been built yet? - if ( $.inArray( optLabel, optgroups ) === -1 ) { - lis.push( "
        • "+ optLabel +"
        • " ); - optgroups.push( optLabel ); + if (parent !== select && parent.nodeName.toLowerCase() === "optgroup"){ + var optLabel = parent.getAttribute('label'); + if ( optLabel != optGroup) { + var divider = document.createElement('li'); + divider.setAttribute(dataRoleAttr,'list-divider'); + divider.setAttribute('role','option'); + divider.setAttribute('tabindex','-1'); + divider.appendChild(document.createTextNode(optLabel)); + fragment.appendChild(divider); + optGroup = optLabel; } } - // Find placeholder text - // TODO: Are you sure you want to use getAttribute? ^RW - if ( !this.getAttribute( "value" ) || text.length == 0 || $this.jqmData( "placeholder" ) ) { + if (needPlaceholder && (!option.getAttribute( "value" ) || text.length == 0 || $option.jqmData( "placeholder" ))) { + needPlaceholder = false; if ( o.hidePlaceholderMenuItems ) { classes.push( "ui-selectmenu-placeholder" ); } - placeholder = self.placeholder = text; + if (!placeholder) { + placeholder = self.placeholder = text; + } } - // support disabled option tags - if ( this.disabled ) { + var item = document.createElement('li'); + if ( option.disabled ) { classes.push( "ui-disabled" ); - extraAttrs.push( "aria-disabled='true'" ); + item.setAttribute('aria-disabled',true); } - - lis.push( "
        • "+ anchor +"
        • " ); - }); - - self.list.html( lis.join(" ") ); - - self.list.find( "li" ) - .attr({ "role": "option", "tabindex": "-1" }) - .first().attr( "tabindex", "0" ); - - // Hide header close link for single selects - if ( !this.isMultiple ) { - this.headerClose.hide(); + item.setAttribute(dataIndexAttr,i); + item.setAttribute(dataIconAttr,dataIcon); + item.className = classes.join(" "); + item.setAttribute('role','option'); + anchor.setAttribute('tabindex','-1'); + item.appendChild(anchor); + fragment.appendChild(item); } + self.list[0].appendChild(fragment); + // Hide header if it's not a multiselect and there's no placeholder if ( !this.isMultiple && !placeholder.length ) { this.header.hide(); @@ -5906,925 +7053,332 @@ $( document ).bind( "pagecreate create", function( e ){ }); }; - $( "select" ).live( "selectmenubeforecreate", function(){ - var selectmenuWidget = $( this ).data( "selectmenu" ); + // issue #3894 - core doesn't triggered events on disabled delegates + $( document ).bind( "selectmenubeforecreate", function( event ){ + var selectmenuWidget = $( event.target ).data( "selectmenu" ); if( !selectmenuWidget.options.nativeMenu ){ extendSelect( selectmenuWidget ); } }); })( jQuery ); -/* -* "selectmenu" plugin -*/ (function( $, undefined ) { -$.widget( "mobile.selectmenu", $.mobile.widget, { - options: { - theme: null, - disabled: false, - icon: "arrow-d", - iconpos: "right", - inline: null, - corners: true, - shadow: true, - iconshadow: true, - menuPageTheme: "b", - overlayTheme: "a", - hidePlaceholderMenuItems: true, - closeText: "Close", - nativeMenu: true, - initSelector: "select:not(:jqmData(role='slider'))" - }, - _button: function(){ - return $( "
          " ); - }, + $.widget( "mobile.fixedtoolbar", $.mobile.widget, { + options: { + visibleOnPageShow: true, + disablePageZoom: true, + transition: "slide", //can be none, fade, slide (slide maps to slideup or slidedown) + fullscreen: false, + tapToggle: true, + tapToggleBlacklist: "a, input, select, textarea, .ui-header-fixed, .ui-footer-fixed", + hideDuringFocus: "input, textarea, select", + updatePagePadding: true, + trackPersistentToolbars: true, - _setDisabled: function( value ) { - this.element.attr( "disabled", value ); - this.button.attr( "aria-disabled", value ); - return this._setOption( "disabled", value ); - }, + // Browser detection! Weeee, here we go... + // Unfortunately, position:fixed is costly, not to mention probably impossible, to feature-detect accurately. + // Some tests exist, but they currently return false results in critical devices and browsers, which could lead to a broken experience. + // Testing fixed positioning is also pretty obtrusive to page load, requiring injected elements and scrolling the window + // The following function serves to rule out some popular browsers with known fixed-positioning issues + // This is a plugin option like any other, so feel free to improve or overwrite it + supportBlacklist: function(){ + var w = window, + ua = navigator.userAgent, + platform = navigator.platform, + // Rendering engine is Webkit, and capture major version + wkmatch = ua.match( /AppleWebKit\/([0-9]+)/ ), + wkversion = !!wkmatch && wkmatch[ 1 ], + ffmatch = ua.match( /Fennec\/([0-9]+)/ ), + ffversion = !!ffmatch && ffmatch[ 1 ], + operammobilematch = ua.match( /Opera Mobi\/([0-9]+)/ ), + omversion = !!operammobilematch && operammobilematch[ 1 ]; - _focusButton : function() { - var self = this; + if( + // iOS 4.3 and older : Platform is iPhone/Pad/Touch and Webkit version is less than 534 (ios5) + ( ( platform.indexOf( "iPhone" ) > -1 || platform.indexOf( "iPad" ) > -1 || platform.indexOf( "iPod" ) > -1 ) && wkversion && wkversion < 534 ) + || + // Opera Mini + ( w.operamini && ({}).toString.call( w.operamini ) === "[object OperaMini]" ) + || + ( operammobilematch && omversion < 7458 ) + || + //Android lte 2.1: Platform is Android and Webkit version is less than 533 (Android 2.2) + ( ua.indexOf( "Android" ) > -1 && wkversion && wkversion < 533 ) + || + // Firefox Mobile before 6.0 - + ( ffversion && ffversion < 6 ) + || + // WebOS less than 3 + ( "palmGetResource" in window && wkversion && wkversion < 534 ) + || + // MeeGo + ( ua.indexOf( "MeeGo" ) > -1 && ua.indexOf( "NokiaBrowser/8.5.0" ) > -1 ) + ){ + return true; + } - setTimeout( function() { - self.button.focus(); - }, 40); - }, + return false; + }, + initSelector: ":jqmData(position='fixed')" + }, - _selectOptions: function() { - return this.select.find( "option" ); - }, + _create: function() { - // setup items that are generally necessary for select menu extension - _preExtension: function(){ - this.select = this.element.wrap( "
          " ); - this.selectID = this.select.attr( "id" ); - this.label = $( "label[for='"+ this.selectID +"']" ).addClass( "ui-select" ); - this.isMultiple = this.select[ 0 ].multiple; - if ( !this.options.theme ) { - this.options.theme = $.mobile.getInheritedTheme( this.select, "c" ); - } - }, + var self = this, + o = self.options, + $el = self.element, + tbtype = $el.is( ":jqmData(role='header')" ) ? "header" : "footer", + $page = $el.closest(".ui-page"); - _create: function() { - this._preExtension(); + // Feature detecting support for + if( o.supportBlacklist() ){ + self.destroy(); + return; + } - // Allows for extension of the native select for custom selects and other plugins - // see select.custom for example extension - // TODO explore plugin registration - this._trigger( "beforeCreate" ); + $el.addClass( "ui-"+ tbtype +"-fixed" ); - this.button = this._button(); + // "fullscreen" overlay positioning + if( o.fullscreen ){ + $el.addClass( "ui-"+ tbtype +"-fullscreen" ); + $page.addClass( "ui-page-" + tbtype + "-fullscreen" ); + } + // If not fullscreen, add class to page to set top or bottom padding + else{ + $page.addClass( "ui-page-" + tbtype + "-fixed" ); + } - var self = this, + self._addTransitionClass(); + self._bindPageEvents(); + self._bindToggleHandlers(); + }, - options = this.options, + _addTransitionClass: function(){ + var tclass = this.options.transition; - // IE throws an exception at options.item() function when - // there is no selected item - // select first in this case - selectedIndex = this.select[ 0 ].selectedIndex == -1 ? 0 : this.select[ 0 ].selectedIndex, + if( tclass && tclass !== "none" ){ + // use appropriate slide for header or footer + if( tclass === "slide" ){ + tclass = this.element.is( ".ui-header" ) ? "slidedown" : "slideup"; + } - // TODO values buttonId and menuId are undefined here - button = this.button - .text( $( this.select[ 0 ].options.item( selectedIndex ) ).text() ) - .insertBefore( this.select ) - .buttonMarkup( { - theme: options.theme, - icon: options.icon, - iconpos: options.iconpos, - inline: options.inline, - corners: options.corners, - shadow: options.shadow, - iconshadow: options.iconshadow + this.element.addClass( tclass ); + } + }, + + _bindPageEvents: function(){ + var self = this, + o = self.options, + $el = self.element; + + //page event bindings + // Fixed toolbars require page zoom to be disabled, otherwise usability issues crop up + // This method is meant to disable zoom while a fixed-positioned toolbar page is visible + $el.closest( ".ui-page" ) + .bind( "pagebeforeshow", function(){ + if( o.disablePageZoom ){ + $.mobile.zoom.disable( true ); + } + if( !o.visibleOnPageShow ){ + self.hide( true ); + } + } ) + .bind( "webkitAnimationStart animationstart updatelayout", function(){ + if( o.updatePagePadding ){ + self.updatePagePadding(); + } + }) + .bind( "pageshow", function(){ + self.updatePagePadding(); + if( o.updatePagePadding ){ + $( window ).bind( "throttledresize." + self.widgetName, function(){ + self.updatePagePadding(); + }); + } + }) + .bind( "pagebeforehide", function( e, ui ){ + if( o.disablePageZoom ){ + $.mobile.zoom.enable( true ); + } + if( o.updatePagePadding ){ + $( window ).unbind( "throttledresize." + self.widgetName ); + } + + if( o.trackPersistentToolbars ){ + var thisFooter = $( ".ui-footer-fixed:jqmData(id)", this ), + thisHeader = $( ".ui-header-fixed:jqmData(id)", this ), + nextFooter = thisFooter.length && ui.nextPage && $( ".ui-footer-fixed:jqmData(id='" + thisFooter.jqmData( "id" ) + "')", ui.nextPage ), + nextHeader = thisHeader.length && ui.nextPage && $( ".ui-header-fixed:jqmData(id='" + thisHeader.jqmData( "id" ) + "')", ui.nextPage ); + + nextFooter = nextFooter || $(); + + if( nextFooter.length || nextHeader.length ){ + + nextFooter.add( nextHeader ).appendTo( $.mobile.pageContainer ); + + ui.nextPage.one( "pageshow", function(){ + nextFooter.add( nextHeader ).appendTo( this ); + }); + } + } }); + }, - // Opera does not properly support opacity on select elements - // In Mini, it hides the element, but not its text - // On the desktop,it seems to do the opposite - // for these reasons, using the nativeMenu option results in a full native select in Opera - if ( options.nativeMenu && window.opera && window.opera.version ) { - this.select.addClass( "ui-select-nativeonly" ); + _visible: true, + + // This will set the content element's top or bottom padding equal to the toolbar's height + updatePagePadding: function() { + var $el = this.element, + header = $el.is( ".ui-header" ); + + // This behavior only applies to "fixed", not "fullscreen" + if( this.options.fullscreen ){ return; } + + $el.closest( ".ui-page" ).css( "padding-" + ( header ? "top" : "bottom" ), $el.outerHeight() ); + }, + + _useTransition: function( notransition ){ + var $win = $( window ), + $el = this.element, + scroll = $win.scrollTop(), + elHeight = $el.height(), + pHeight = $el.closest( ".ui-page" ).height(), + viewportHeight = $.mobile.getScreenHeight(), + tbtype = $el.is( ":jqmData(role='header')" ) ? "header" : "footer"; + + return !notransition && + ( this.options.transition && this.options.transition !== "none" && + ( + ( tbtype === "header" && !this.options.fullscreen && scroll > elHeight ) || + ( tbtype === "footer" && !this.options.fullscreen && scroll + viewportHeight < pHeight - elHeight ) + ) || this.options.fullscreen + ); + }, + + show: function( notransition ){ + var hideClass = "ui-fixed-hidden", + $el = this.element; + + if( this._useTransition( notransition ) ){ + $el + .removeClass( "out " + hideClass ) + .addClass( "in" ); + } + else { + $el.removeClass( hideClass ); + } + this._visible = true; + }, + + hide: function( notransition ){ + var hideClass = "ui-fixed-hidden", + $el = this.element, + // if it's a slide transition, our new transitions need the reverse class as well to slide outward + outclass = "out" + ( this.options.transition === "slide" ? " reverse" : "" ); + + if( this._useTransition( notransition ) ){ + $el + .addClass( outclass ) + .removeClass( "in" ) + .animationComplete( function(){ + $el.addClass( hideClass ).removeClass( outclass ); + }); + } + else { + $el.addClass( hideClass ).removeClass( outclass ); + } + this._visible = false; + }, + + toggle: function(){ + this[ this._visible ? "hide" : "show" ](); + }, + + _bindToggleHandlers: function(){ + var self = this, + o = self.options, + $el = self.element; + + // tap toggle + $el.closest( ".ui-page" ) + .bind( "vclick", function( e ){ + if( o.tapToggle && !$( e.target ).closest( o.tapToggleBlacklist ).length ){ + self.toggle(); + } + }) + .bind( "focusin focusout", function( e ){ + if( screen.width < 500 && $( e.target ).is( o.hideDuringFocus ) && !$( e.target ).closest( ".ui-header-fixed, .ui-footer-fixed" ).length ){ + self[ ( e.type === "focusin" && self._visible ) ? "hide" : "show" ](); + } + }); + }, + + destroy: function(){ + this.element.removeClass( "ui-header-fixed ui-footer-fixed ui-header-fullscreen ui-footer-fullscreen in out fade slidedown slideup ui-fixed-hidden" ); + this.element.closest( ".ui-page" ).removeClass( "ui-page-header-fixed ui-page-footer-fixed ui-page-header-fullscreen ui-page-footer-fullscreen" ); } - // Add counter for multi selects - if ( this.isMultiple ) { - this.buttonCount = $( "" ) - .addClass( "ui-li-count ui-btn-up-c ui-btn-corner-all" ) - .hide() - .appendTo( button.addClass('ui-li-has-count') ); - } + }); - // Disable if specified - if ( options.disabled || this.element.attr('disabled')) { - this.disable(); - } + //auto self-init widgets + $( document ) + .bind( "pagecreate create", function( e ){ - // Events on native select - this.select.change( function() { - self.refresh(); + // DEPRECATED in 1.1: support for data-fullscreen=true|false on the page element. + // This line ensures it still works, but we recommend moving the attribute to the toolbars themselves. + if( $( e.target ).jqmData( "fullscreen" ) ){ + $( $.mobile.fixedtoolbar.prototype.options.initSelector, e.target ).not( ":jqmData(fullscreen)" ).jqmData( "fullscreen", true ); + } + + $.mobile.fixedtoolbar.prototype.enhanceWithin( e.target ); }); - this.build(); - }, - - build: function() { - var self = this; - - this.select - .appendTo( self.button ) - .bind( "vmousedown", function() { - // Add active class to button - self.button.addClass( $.mobile.activeBtnClass ); - }) - .bind( "focus vmouseover", function() { - self.button.trigger( "vmouseover" ); - }) - .bind( "vmousemove", function() { - // Remove active class on scroll/touchmove - self.button.removeClass( $.mobile.activeBtnClass ); - }) - .bind( "change blur vmouseout", function() { - self.button.trigger( "vmouseout" ) - .removeClass( $.mobile.activeBtnClass ); - }) - .bind( "change blur", function() { - self.button.removeClass( "ui-btn-down-" + self.options.theme ); - }); - }, - - selected: function() { - return this._selectOptions().filter( ":selected" ); - }, - - selectedIndices: function() { - var self = this; - - return this.selected().map( function() { - return self._selectOptions().index( this ); - }).get(); - }, - - setButtonText: function() { - var self = this, selected = this.selected(); - - this.button.find( ".ui-btn-text" ).text( function() { - if ( !self.isMultiple ) { - return selected.text(); - } - - return selected.length ? selected.map( function() { - return $( this ).text(); - }).get().join( ", " ) : self.placeholder; - }); - }, - - setButtonCount: function() { - var selected = this.selected(); - - // multiple count inside button - if ( this.isMultiple ) { - this.buttonCount[ selected.length > 1 ? "show" : "hide" ]().text( selected.length ); - } - }, - - refresh: function() { - this.setButtonText(); - this.setButtonCount(); - }, - - // open and close preserved in native selects - // to simplify users code when looping over selects - open: $.noop, - close: $.noop, - - disable: function() { - this._setDisabled( true ); - this.button.addClass( "ui-disabled" ); - }, - - enable: function() { - this._setDisabled( false ); - this.button.removeClass( "ui-disabled" ); - } -}); - -//auto self-init widgets -$( document ).bind( "pagecreate create", function( e ){ - $.mobile.selectmenu.prototype.enhanceWithin( e.target ); -}); })( jQuery ); -/* -* "buttons" plugin - for making button-like links -*/ -( function( $, undefined ) { +( function( $, window ) { -$.fn.buttonMarkup = function( options ) { - options = options || {}; - - for ( var i = 0; i < this.length; i++ ) { - var el = this.eq( i ), - e = el[ 0 ], - o = $.extend( {}, $.fn.buttonMarkup.defaults, { - icon: options.icon !== undefined ? options.icon : el.jqmData( "icon" ), - iconpos: options.iconpos !== undefined ? options.iconpos : el.jqmData( "iconpos" ), - theme: options.theme !== undefined ? options.theme : el.jqmData( "theme" ), - inline: options.inline !== undefined ? options.inline : el.jqmData( "inline" ), - shadow: options.shadow !== undefined ? options.shadow : el.jqmData( "shadow" ), - corners: options.corners !== undefined ? options.corners : el.jqmData( "corners" ), - iconshadow: options.iconshadow !== undefined ? options.iconshadow : el.jqmData( "iconshadow" ) - }, options ), - - // Classes Defined - innerClass = "ui-btn-inner", - textClass = "ui-btn-text", - buttonClass, iconClass, - - // Button inner markup - buttonInner = document.createElement( o.wrapperEls ), - buttonText = document.createElement( o.wrapperEls ), - buttonIcon = o.icon ? document.createElement( "span" ) : null; - - if ( attachEvents ) { - attachEvents(); - } - - // if not, try to find closest theme container - if ( !o.theme ) { - o.theme = $.mobile.getInheritedTheme( el, "c" ); - } - - buttonClass = "ui-btn ui-btn-up-" + o.theme; - - if ( o.inline ) { - buttonClass += " ui-btn-inline"; - } - - if ( o.icon ) { - o.icon = "ui-icon-" + o.icon; - o.iconpos = o.iconpos || "left"; - - iconClass = "ui-icon " + o.icon; - - if ( o.iconshadow ) { - iconClass += " ui-icon-shadow"; - } - } - - if ( o.iconpos ) { - buttonClass += " ui-btn-icon-" + o.iconpos; - - if ( o.iconpos == "notext" && !el.attr( "title" ) ) { - el.attr( "title", el.getEncodedText() ); - } - } - - if ( o.corners ) { - buttonClass += " ui-btn-corner-all"; - innerClass += " ui-btn-corner-all"; - } - - if ( o.shadow ) { - buttonClass += " ui-shadow"; - } - - e.setAttribute( "data-" + $.mobile.ns + "theme", o.theme ); - el.addClass( buttonClass ); - - buttonInner.className = innerClass; - buttonInner.setAttribute("aria-hidden", "true"); - - buttonText.className = textClass; - buttonInner.appendChild( buttonText ); - - if ( buttonIcon ) { - buttonIcon.className = iconClass; - buttonInner.appendChild( buttonIcon ); - } - - while ( e.firstChild ) { - buttonText.appendChild( e.firstChild ); - } - - e.appendChild( buttonInner ); - - // TODO obviously it would be nice to pull this element out instead of - // retrieving it from the DOM again, but this change is much less obtrusive - // and 1.0 draws nigh - $.data( e, 'textWrapper', $( buttonText ) ); - } - - return this; -}; - -$.fn.buttonMarkup.defaults = { - corners: true, - shadow: true, - iconshadow: true, - inline: false, - wrapperEls: "span" -}; - -function closestEnabledButton( element ) { - var cname; - - while ( element ) { - // Note that we check for typeof className below because the element we - // handed could be in an SVG DOM where className on SVG elements is defined to - // be of a different type (SVGAnimatedString). We only operate on HTML DOM - // elements, so we look for plain "string". - - cname = ( typeof element.className === 'string' ) && element.className.split(' '); - - if ( cname && $.inArray( "ui-btn", cname ) > -1 && $.inArray( "ui-disabled", cname ) < 0 ) { - break; - } - element = element.parentNode; - } - - return element; -} - -var attachEvents = function() { - $( document ).bind( { - "vmousedown": function( event ) { - var btn = closestEnabledButton( event.target ), - $btn, theme; - - if ( btn ) { - $btn = $( btn ); - theme = $btn.attr( "data-" + $.mobile.ns + "theme" ); - $btn.removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-down-" + theme ); - } - }, - "vmousecancel vmouseup": function( event ) { - var btn = closestEnabledButton( event.target ), - $btn, theme; - - if ( btn ) { - $btn = $( btn ); - theme = $btn.attr( "data-" + $.mobile.ns + "theme" ); - $btn.removeClass( "ui-btn-down-" + theme ).addClass( "ui-btn-up-" + theme ); - } - }, - "vmouseover focus": function( event ) { - var btn = closestEnabledButton( event.target ), - $btn, theme; - - if ( btn ) { - $btn = $( btn ); - theme = $btn.attr( "data-" + $.mobile.ns + "theme" ); - $btn.removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-hover-" + theme ); - } - }, - "vmouseout blur": function( event ) { - var btn = closestEnabledButton( event.target ), - $btn, theme; - - if ( btn ) { - $btn = $( btn ); - theme = $btn.attr( "data-" + $.mobile.ns + "theme" ); - $btn.removeClass( "ui-btn-hover-" + theme + " ui-btn-down-" + theme ).addClass( "ui-btn-up-" + theme ); - } - } - }); - - attachEvents = null; -}; - -//links in bars, or those with data-role become buttons -//auto self-init widgets -$( document ).bind( "pagecreate create", function( e ){ - - $( ":jqmData(role='button'), .ui-bar > a, .ui-header > a, .ui-footer > a, .ui-bar > :jqmData(role='controlgroup') > a", e.target ) - .not( ".ui-btn, :jqmData(role='none'), :jqmData(role='nojs')" ) - .buttonMarkup(); -}); - -})( jQuery ); -/* -* "controlgroup" plugin - corner-rounding for groups of buttons, checks, radios, etc -*/ - -(function( $, undefined ) { - -$.fn.controlgroup = function( options ) { - - return this.each(function() { - - var $el = $( this ), - o = $.extend({ - direction: $el.jqmData( "type" ) || "vertical", - shadow: false, - excludeInvisible: true - }, options ), - groupheading = $el.children( "legend" ), - flCorners = o.direction == "horizontal" ? [ "ui-corner-left", "ui-corner-right" ] : [ "ui-corner-top", "ui-corner-bottom" ], - type = $el.find( "input" ).first().attr( "type" ); - - // Replace legend with more stylable replacement div - if ( groupheading.length ) { - $el.wrapInner( "
          " ); - $( "
          " + groupheading.html() + "
          " ).insertBefore( $el.children(0) ); - groupheading.remove(); - } - - $el.addClass( "ui-corner-all ui-controlgroup ui-controlgroup-" + o.direction ); - - // TODO: This should be moved out to the closure - // otherwise it is redefined each time controlgroup() is called - function flipClasses( els ) { - els.removeClass( "ui-btn-corner-all ui-shadow" ) - .eq( 0 ).addClass( flCorners[ 0 ] ) - .end() - .last().addClass( flCorners[ 1 ] ).addClass( "ui-controlgroup-last" ); - } - - flipClasses( $el.find( ".ui-btn" + ( o.excludeInvisible ? ":visible" : "" ) ) ); - flipClasses( $el.find( ".ui-btn-inner" ) ); - - if ( o.shadow ) { - $el.addClass( "ui-shadow" ); - } - }); -}; - -//auto self-init widgets -$( document ).bind( "pagecreate create", function( e ){ - $( ":jqmData(role='controlgroup')", e.target ).controlgroup({ excludeInvisible: false }); -}); - -})(jQuery);/* -* "links" plugin - simple class additions for links -*/ - -(function( $, undefined ) { - -$( document ).bind( "pagecreate create", function( e ){ - - //links within content areas - $( e.target ) - .find( "a" ) - .not( ".ui-btn, .ui-link-inherit, :jqmData(role='none'), :jqmData(role='nojs')" ) - .addClass( "ui-link" ); - -}); - -})( jQuery );/* -* "fixHeaderFooter" plugin - on-demand positioning for headers,footers -*/ - -(function( $, undefined ) { - -var slideDownClass = "ui-header-fixed ui-fixed-inline fade", - slideUpClass = "ui-footer-fixed ui-fixed-inline fade", - - slideDownSelector = ".ui-header:jqmData(position='fixed')", - slideUpSelector = ".ui-footer:jqmData(position='fixed')"; - -$.fn.fixHeaderFooter = function( options ) { - - if ( !$.support.scrollTop || ( $.support.touchOverflow && $.mobile.touchOverflowEnabled ) ) { - return this; - } - - return this.each(function() { - var $this = $( this ); - - if ( $this.jqmData( "fullscreen" ) ) { - $this.addClass( "ui-page-fullscreen" ); - } - - // Should be slidedown - $this.find( slideDownSelector ).addClass( slideDownClass ); - - // Should be slideup - $this.find( slideUpSelector ).addClass( slideUpClass ); - }); -}; - -// single controller for all showing,hiding,toggling -$.mobile.fixedToolbars = (function() { - - if ( !$.support.scrollTop || ( $.support.touchOverflow && $.mobile.touchOverflowEnabled ) ) { + // This fix addresses an iOS bug, so return early if the UA claims it's something else. + if( !(/iPhone|iPad|iPod/.test( navigator.platform ) && navigator.userAgent.indexOf( "AppleWebKit" ) > -1 ) ){ return; } - var stickyFooter, delayTimer, - currentstate = "inline", - autoHideMode = false, - showDelay = 100, - ignoreTargets = "a,input,textarea,select,button,label,.ui-header-fixed,.ui-footer-fixed", - toolbarSelector = ".ui-header-fixed:first, .ui-footer-fixed:not(.ui-footer-duplicate):last", - // for storing quick references to duplicate footers - supportTouch = $.support.touch, - touchStartEvent = supportTouch ? "touchstart" : "mousedown", - touchStopEvent = supportTouch ? "touchend" : "mouseup", - stateBefore = null, - scrollTriggered = false, - touchToggleEnabled = true; + var zoom = $.mobile.zoom, + evt, x, y, z, aig; - function showEventCallback( event ) { - // An event that affects the dimensions of the visual viewport has - // been triggered. If the header and/or footer for the current page are in overlay - // mode, we want to hide them, and then fire off a timer to show them at a later - // point. Events like a resize can be triggered continuously during a scroll, on - // some platforms, so the timer is used to delay the actual positioning until the - // flood of events have subsided. - // - // If we are in autoHideMode, we don't do anything because we know the scroll - // callbacks for the plugin will fire off a show when the scrolling has stopped. - if ( !autoHideMode && currentstate === "overlay" ) { - if ( !delayTimer ) { - $.mobile.fixedToolbars.hide( true ); + function checkTilt( e ){ + evt = e.originalEvent; + aig = evt.accelerationIncludingGravity; + + x = Math.abs( aig.x ); + y = Math.abs( aig.y ); + z = Math.abs( aig.z ); + + // If portrait orientation and in one of the danger zones + if( !window.orientation && ( x > 7 || ( ( z > 6 && y < 8 || z < 8 && y > 6 ) && x > 5 ) ) ){ + if( zoom.enabled ){ + zoom.disable(); } + } + else if( !zoom.enabled ){ + zoom.enable(); + } + } - $.mobile.fixedToolbars.startShowTimer(); - } - } + $( window ) + .bind( "orientationchange.iosorientationfix", zoom.enable ) + .bind( "devicemotion.iosorientationfix", checkTilt ); - $(function() { - var $document = $( document ), - $window = $( window ); +}( jQuery, this )); - $document - .bind( "vmousedown", function( event ) { - if ( touchToggleEnabled ) { - stateBefore = currentstate; - } - }) - .bind( "vclick", function( event ) { - if ( touchToggleEnabled ) { - - if ( $(event.target).closest( ignoreTargets ).length ) { - return; - } - - if ( !scrollTriggered ) { - $.mobile.fixedToolbars.toggle( stateBefore ); - stateBefore = null; - } - } - }) - .bind( "silentscroll", showEventCallback ); - - - // The below checks first for a $(document).scrollTop() value, and if zero, binds scroll events to $(window) instead. - // If the scrollTop value is actually zero, both will return zero anyway. - // - // Works with $(document), not $(window) : Opera Mobile (WinMO phone; kinda broken anyway) - // Works with $(window), not $(document) : IE 7/8 - // Works with either $(window) or $(document) : Chrome, FF 3.6/4, Android 1.6/2.1, iOS - // Needs work either way : BB5, Opera Mobile (iOS) - - ( ( $document.scrollTop() === 0 ) ? $window : $document ) - .bind( "scrollstart", function( event ) { - - scrollTriggered = true; - - if ( stateBefore === null ) { - stateBefore = currentstate; - } - - // We only enter autoHideMode if the headers/footers are in - // an overlay state or the show timer was started. If the - // show timer is set, clear it so the headers/footers don't - // show up until after we're done scrolling. - var isOverlayState = stateBefore == "overlay"; - - autoHideMode = isOverlayState || !!delayTimer; - - if ( autoHideMode ) { - $.mobile.fixedToolbars.clearShowTimer(); - - if ( isOverlayState ) { - $.mobile.fixedToolbars.hide( true ); - } - } - }) - .bind( "scrollstop", function( event ) { - - if ( $( event.target ).closest( ignoreTargets ).length ) { - return; - } - - scrollTriggered = false; - - if ( autoHideMode ) { - $.mobile.fixedToolbars.startShowTimer(); - autoHideMode = false; - } - stateBefore = null; - }); - - $window.bind( "resize updatelayout", showEventCallback ); - }); - - // 1. Before page is shown, check for duplicate footer - // 2. After page is shown, append footer to new page - $( ".ui-page" ) - .live( "pagebeforeshow", function( event, ui ) { - - var page = $( event.target ), - footer = page.find( ":jqmData(role='footer')" ), - id = footer.data( "id" ), - prevPage = ui.prevPage, - prevFooter = prevPage && prevPage.find( ":jqmData(role='footer')" ), - prevFooterMatches = prevFooter.length && prevFooter.jqmData( "id" ) === id; - - if ( id && prevFooterMatches ) { - stickyFooter = footer; - setTop( stickyFooter.removeClass( "fade in out" ).appendTo( $.mobile.pageContainer ) ); - } - }) - .live( "pageshow", function( event, ui ) { - - var $this = $( this ); - - if ( stickyFooter && stickyFooter.length ) { - - setTimeout(function() { - setTop( stickyFooter.appendTo( $this ).addClass( "fade" ) ); - stickyFooter = null; - }, 500); - } - - $.mobile.fixedToolbars.show( true, this ); - }); - - // When a collapsiable is hidden or shown we need to trigger the fixed toolbar to reposition itself (#1635) - $( ".ui-collapsible-contain" ).live( "collapse expand", showEventCallback ); - - // element.getBoundingClientRect() is broken in iOS 3.2.1 on the iPad. The - // coordinates inside of the rect it returns don't have the page scroll position - // factored out of it like the other platforms do. To get around this, - // we'll just calculate the top offset the old fashioned way until core has - // a chance to figure out how to handle this situation. - // - // TODO: We'll need to get rid of getOffsetTop() once a fix gets folded into core. - - function getOffsetTop( ele ) { - var top = 0, - op, body; - - if ( ele ) { - body = document.body; - op = ele.offsetParent; - top = ele.offsetTop; - - while ( ele && ele != body ) { - top += ele.scrollTop || 0; - - if ( ele == op ) { - top += op.offsetTop; - op = ele.offsetParent; - } - - ele = ele.parentNode; - } - } - return top; - } - - function setTop( el ) { - var fromTop = $(window).scrollTop(), - thisTop = getOffsetTop( el[ 0 ] ), // el.offset().top returns the wrong value on iPad iOS 3.2.1, call our workaround instead. - thisCSStop = el.css( "top" ) == "auto" ? 0 : parseFloat(el.css( "top" )), - screenHeight = window.innerHeight, - thisHeight = el.outerHeight(), - useRelative = el.parents( ".ui-page:not(.ui-page-fullscreen)" ).length, - relval; - - if ( el.is( ".ui-header-fixed" ) ) { - - relval = fromTop - thisTop + thisCSStop; - - if ( relval < thisTop ) { - relval = 0; - } - - return el.css( "top", useRelative ? relval : fromTop ); - } else { - // relval = -1 * (thisTop - (fromTop + screenHeight) + thisCSStop + thisHeight); - // if ( relval > thisTop ) { relval = 0; } - relval = fromTop + screenHeight - thisHeight - (thisTop - thisCSStop ); - - return el.css( "top", useRelative ? relval : fromTop + screenHeight - thisHeight ); - } - } - - // Exposed methods - return { - - show: function( immediately, page ) { - - $.mobile.fixedToolbars.clearShowTimer(); - - currentstate = "overlay"; - - var $ap = page ? $( page ) : - ( $.mobile.activePage ? $.mobile.activePage : - $( ".ui-page-active" ) ); - - return $ap.children( toolbarSelector ).each(function() { - - var el = $( this ), - fromTop = $( window ).scrollTop(), - // el.offset().top returns the wrong value on iPad iOS 3.2.1, call our workaround instead. - thisTop = getOffsetTop( el[ 0 ] ), - screenHeight = window.innerHeight, - thisHeight = el.outerHeight(), - alreadyVisible = ( el.is( ".ui-header-fixed" ) && fromTop <= thisTop + thisHeight ) || - ( el.is( ".ui-footer-fixed" ) && thisTop <= fromTop + screenHeight ); - - // Add state class - el.addClass( "ui-fixed-overlay" ).removeClass( "ui-fixed-inline" ); - - if ( !alreadyVisible && !immediately ) { - el.animationComplete(function() { - el.removeClass( "in" ); - }).addClass( "in" ); - } - setTop(el); - }); - }, - - hide: function( immediately ) { - - currentstate = "inline"; - - var $ap = $.mobile.activePage ? $.mobile.activePage : - $( ".ui-page-active" ); - - return $ap.children( toolbarSelector ).each(function() { - - var el = $(this), - thisCSStop = el.css( "top" ), - classes; - - thisCSStop = thisCSStop == "auto" ? 0 : - parseFloat(thisCSStop); - - // Add state class - el.addClass( "ui-fixed-inline" ).removeClass( "ui-fixed-overlay" ); - - if ( thisCSStop < 0 || ( el.is( ".ui-header-fixed" ) && thisCSStop !== 0 ) ) { - - if ( immediately ) { - el.css( "top", 0); - } else { - - if ( el.css( "top" ) !== "auto" && parseFloat( el.css( "top" ) ) !== 0 ) { - - classes = "out reverse"; - - el.animationComplete(function() { - el.removeClass( classes ).css( "top", 0 ); - }).addClass( classes ); - } - } - } - }); - }, - - startShowTimer: function() { - - $.mobile.fixedToolbars.clearShowTimer(); - - var args = [].slice.call( arguments ); - - delayTimer = setTimeout(function() { - delayTimer = undefined; - $.mobile.fixedToolbars.show.apply( null, args ); - }, showDelay); - }, - - clearShowTimer: function() { - if ( delayTimer ) { - clearTimeout( delayTimer ); - } - delayTimer = undefined; - }, - - toggle: function( from ) { - if ( from ) { - currentstate = from; - } - return ( currentstate === "overlay" ) ? $.mobile.fixedToolbars.hide() : - $.mobile.fixedToolbars.show(); - }, - - setTouchToggleEnabled: function( enabled ) { - touchToggleEnabled = enabled; - } - }; -})(); - -//auto self-init widgets -$( document ).bind( "pagecreate create", function( event ) { - - if ( $( ":jqmData(position='fixed')", event.target ).length ) { - - $( event.target ).each(function() { - - if ( !$.support.scrollTop || ( $.support.touchOverflow && $.mobile.touchOverflowEnabled ) ) { - return this; - } - - var $this = $( this ); - - if ( $this.jqmData( "fullscreen" ) ) { - $this.addClass( "ui-page-fullscreen" ); - } - - // Should be slidedown - $this.find( slideDownSelector ).addClass( slideDownClass ); - - // Should be slideup - $this.find( slideUpSelector ).addClass( slideUpClass ); - - }) - - } -}); - -})( jQuery ); -/* -* "fixHeaderFooter" native plugin - Behavior for "fixed" headers,footers, and scrolling inner content -*/ - -(function( $, undefined ) { - -// Enable touch overflow scrolling when it's natively supported -$.mobile.touchOverflowEnabled = false; - -// Enabled zoom when touch overflow is enabled. Can cause usability issues, unfortunately -$.mobile.touchOverflowZoomEnabled = false; - -$( document ).bind( "pagecreate", function( event ) { - if( $.support.touchOverflow && $.mobile.touchOverflowEnabled ){ - - var $target = $( event.target ), - scrollStartY = 0; - - if( $target.is( ":jqmData(role='page')" ) ){ - - $target.each(function() { - var $page = $( this ), - $fixies = $page.find( ":jqmData(role='header'), :jqmData(role='footer')" ).filter( ":jqmData(position='fixed')" ), - fullScreen = $page.jqmData( "fullscreen" ), - $scrollElem = $fixies.length ? $page.find( ".ui-content" ) : $page; - - $page.addClass( "ui-mobile-touch-overflow" ); - - $scrollElem.bind( "scrollstop", function(){ - if( $scrollElem.scrollTop() > 0 ){ - window.scrollTo( 0, $.mobile.defaultHomeScroll ); - } - }); - - if( $fixies.length ){ - - $page.addClass( "ui-native-fixed" ); - - if( fullScreen ){ - - $page.addClass( "ui-native-fullscreen" ); - - $fixies.addClass( "fade in" ); - - $( document ).bind( "vclick", function(){ - $fixies - .removeClass( "ui-native-bars-hidden" ) - .toggleClass( "in out" ) - .animationComplete(function(){ - $(this).not( ".in" ).addClass( "ui-native-bars-hidden" ); - }); - }); - } - } - }); - } - } -}); - -})( jQuery ); -/* -* "init" - Initialize the framework -*/ - -(function( $, window, undefined ) { +( function( $, window, undefined ) { var $html = $( "html" ), $head = $( "head" ), $window = $( window ); - // trigger mobileinit event - useful hook for configuring $.mobile settings before they're used + // trigger mobileinit event - useful hook for configuring $.mobile settings before they're used $( window.document ).trigger( "mobileinit" ); // support conditions @@ -6840,42 +7394,88 @@ $( document ).bind( "pagecreate", function( event ) { $.mobile.ajaxEnabled = false; } - // add mobile, initial load "rendering" classes to docEl + // Add mobile, initial load "rendering" classes to docEl $html.addClass( "ui-mobile ui-mobile-rendering" ); + // This is a fallback. If anything goes wrong (JS errors, etc), or events don't fire, + // this ensures the rendering class is removed after 5 seconds, so content is visible and accessible + setTimeout( hideRenderingClass, 5000 ); + // loading div which appears during Ajax requests // will not appear if $.mobile.loadingMessage is false - var $loader = $( "

          " ); + var loaderClass = "ui-loader", + $loader = $( "

          " ); + + // For non-fixed supportin browsers. Position at y center (if scrollTop supported), above the activeBtn (if defined), or just 100px from top + function fakeFixLoader(){ + var activeBtn = $( "." + $.mobile.activeBtnClass ).first(); + + $loader + .css({ + top: $.support.scrollTop && $window.scrollTop() + $window.height() / 2 || + activeBtn.length && activeBtn.offset().top || 100 + }); + } + + // check position of loader to see if it appears to be "fixed" to center + // if not, use abs positioning + function checkLoaderPosition(){ + var offset = $loader.offset(), + scrollTop = $window.scrollTop(), + screenHeight = $.mobile.getScreenHeight(); + + if( offset.top < scrollTop || (offset.top - scrollTop) > screenHeight ) { + $loader.addClass( "ui-loader-fakefix" ); + fakeFixLoader(); + $window + .unbind( "scroll", checkLoaderPosition ) + .bind( "scroll", fakeFixLoader ); + } + } + + //remove initial build class (only present on first pageshow) + function hideRenderingClass(){ + $html.removeClass( "ui-mobile-rendering" ); + } $.extend($.mobile, { // turn on/off page loading message. - showPageLoadingMsg: function() { + showPageLoadingMsg: function( theme, msgText, textonly ) { + $html.addClass( "ui-loading" ); + if ( $.mobile.loadingMessage ) { - var activeBtn = $( "." + $.mobile.activeBtnClass ).first(); + // text visibility from argument takes priority + var textVisible = textonly || $.mobile.loadingMessageTextVisible; + + theme = theme || $.mobile.loadingMessageTheme, $loader + .attr( "class", loaderClass + " ui-corner-all ui-body-" + ( theme || "a" ) + " ui-loader-" + ( textVisible ? "verbose" : "default" ) + ( textonly ? " ui-loader-textonly" : "" ) ) .find( "h1" ) - .text( $.mobile.loadingMessage ) + .text( msgText || $.mobile.loadingMessage ) .end() - .appendTo( $.mobile.pageContainer ) - // position at y center (if scrollTop supported), above the activeBtn (if defined), or just 100px from top - .css({ - top: $.support.scrollTop && $window.scrollTop() + $window.height() / 2 || - activeBtn.length && activeBtn.offset().top || 100 - }); - } + .appendTo( $.mobile.pageContainer ); - $html.addClass( "ui-loading" ); + checkLoaderPosition(); + $window.bind( "scroll", checkLoaderPosition ); + } }, hidePageLoadingMsg: function() { $html.removeClass( "ui-loading" ); + + if( $.mobile.loadingMessage ){ + $loader.removeClass( "ui-loader-fakefix" ); + } + + $( window ).unbind( "scroll", fakeFixLoader ); + $( window ).unbind( "scroll", checkLoaderPosition ); }, // find and enhance the pages in the dom and transition to the first page. initializePage: function() { // find present pages - var $pages = $( ":jqmData(role='page')" ); + var $pages = $( ":jqmData(role='page'), :jqmData(role='dialog')" ); // if no pages are found, create one with body's inner html if ( !$pages.length ) { @@ -6883,7 +7483,7 @@ $( document ).bind( "pagecreate", function( event ) { } // add dialogs, set data-url attrs - $pages.add( ":jqmData(role='dialog')" ).each(function() { + $pages.each(function() { var $this = $(this); // unless the data url is already set set it to the pathname @@ -6905,6 +7505,9 @@ $( document ).bind( "pagecreate", function( event ) { // cue page loading message $.mobile.showPageLoadingMsg(); + //remove initial build class (only present on first pageshow) + hideRenderingClass(); + // if hashchange listening is disabled or there's no hash deeplink, change to the first page in the DOM if ( !$.mobile.hashListeningEnabled || !$.mobile.path.stripHash( location.hash ) ) { $.mobile.changePage( $.mobile.firstPage, { transition: "none", reverse: true, changeHash: false, fromHashChange: true } ); @@ -6915,24 +7518,6 @@ $( document ).bind( "pagecreate", function( event ) { } } }); - - // This function injects a meta viewport tag to prevent scaling. Off by default, on by default when touchOverflow scrolling is enabled - function disableZoom() { - var cont = "user-scalable=no", - meta = $( "meta[name='viewport']" ); - - if( meta.length ){ - meta.attr( "content", meta.attr( "content" ) + ", " + cont ); - } - else{ - $( "head" ).prepend( "", { "name": "viewport", "content": cont } ); - } - } - - // if touch-overflow is enabled, disable user scaling, as it creates usability issues - if( $.support.touchOverflow && $.mobile.touchOverflowEnabled && !$.mobile.touchOverflowZoomEnabled ){ - disableZoom(); - } // initialize events now, after mobileinit has occurred $.mobile._registerInternalEvents(); @@ -6948,6 +7533,17 @@ $( document ).bind( "pagecreate", function( event ) { // so if it's 1, use 0 from now on $.mobile.defaultHomeScroll = ( !$.support.scrollTop || $(window).scrollTop() === 1 ) ? 0 : 1; + + // TODO: Implement a proper registration mechanism with dependency handling in order to not have exceptions like the one below + //auto self-init widgets for those widgets that have a soft dependency on others + if ( $.fn.controlgroup ) { + $( document ).bind( "pagecreate create", function( e ){ + $( ":jqmData(role='controlgroup')", e.target ) + .jqmEnhanceable() + .controlgroup({ excludeInvisible: false }); + }); + } + //dom-ready inits if( $.mobile.autoInitializePage ){ $.mobile.initializePage(); @@ -6957,4 +7553,7 @@ $( document ).bind( "pagecreate", function( event ) { // hide iOS browser chrome on load $window.load( $.mobile.silentScroll ); }); -})( jQuery, this ); +}( jQuery, this )); + + +})); diff --git a/theme/mymobile/javascript/scrollview.js b/theme/mymobile/javascript/scrollview.js deleted file mode 100644 index df465fe4f51..00000000000 --- a/theme/mymobile/javascript/scrollview.js +++ /dev/null @@ -1,802 +0,0 @@ -/* -* jQuery Mobile Framework : scrollview plugin -* Copyright (c) 2010 Adobe Systems Incorporated - Kin Blas (jblas@adobe.com) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -* Note: Code is in draft form and is subject to change -*/ -(function($,window,document,undefined){ - -jQuery.widget( "mobile.scrollview", jQuery.mobile.widget, { - options: { - fps: 60, // Frames per second in msecs. - direction: null, // "x", "y", or null for both. - - scrollDuration: 2000, // Duration of the scrolling animation in msecs. - overshootDuration: 250, // Duration of the overshoot animation in msecs. - snapbackDuration: 500, // Duration of the snapback animation in msecs. - - moveThreshold: 10, // User must move this many pixels in any direction to trigger a scroll. - moveIntervalThreshold: 150, // Time between mousemoves must not exceed this threshold. - - scrollMethod: "translate", // "translate", "position", "scroll" - - startEventName: "scrollstart", - updateEventName: "scrollupdate", - stopEventName: "scrollstop", - - eventType: $.support.touch ? "touch" : "mouse", - - showScrollBars: true, - - pagingEnabled: false, - delayedClickSelector: "a,input,textarea,select,button,.ui-btn", - delayedClickEnabled: true - }, - - _makePositioned: function($ele) - { - if ($ele.css("position") == "static") - $ele.css("position", "relative"); - }, - - _create: function() - { - this._$clip = $(this.element).addClass("ui-scrollview-clip"); - var $child = this._$clip.children(); - if ($child.length > 1) { - $child = this._$clip.wrapInner("
          ").children(); - } - this._$view = $child.addClass("ui-scrollview-view"); - - this._$clip.css("overflow", this.options.scrollMethod === "scroll" ? "scroll" : "hidden"); - this._makePositioned(this._$clip); - - this._$view.css("overflow", "hidden"); - - // Turn off our faux scrollbars if we are using native scrolling - // to position the view. - - this.options.showScrollBars = this.options.scrollMethod === "scroll" ? false : this.options.showScrollBars; - - // We really don't need this if we are using a translate transformation - // for scrolling. We set it just in case the user wants to switch methods - // on the fly. - - this._makePositioned(this._$view); - this._$view.css({ left: 0, top: 0 }); - - this._sx = 0; - this._sy = 0; - - var direction = this.options.direction; - this._hTracker = (direction !== "y") ? new MomentumTracker(this.options) : null; - this._vTracker = (direction !== "x") ? new MomentumTracker(this.options) : null; - - this._timerInterval = 1000/this.options.fps; - this._timerID = 0; - - var self = this; - this._timerCB = function(){ self._handleMomentumScroll(); }; - - this._addBehaviors(); - }, - - _startMScroll: function(speedX, speedY) - { - this._stopMScroll(); - this._showScrollBars(); - - var keepGoing = false; - var duration = this.options.scrollDuration; - - this._$clip.trigger(this.options.startEventName); - - var ht = this._hTracker; - if (ht) - { - var c = this._$clip.width(); - var v = this._$view.width(); - ht.start(this._sx, speedX, duration, (v > c) ? -(v - c) : 0, 0); - keepGoing = !ht.done(); - } - - var vt = this._vTracker; - if (vt) - { - var c = this._$clip.height(); - var v = this._$view.height(); - vt.start(this._sy, speedY, duration, (v > c) ? -(v - c) : 0, 0); - keepGoing = keepGoing || !vt.done(); - } - - if (keepGoing) - this._timerID = setTimeout(this._timerCB, this._timerInterval); - else - this._stopMScroll(); - }, - - _stopMScroll: function() - { - if (this._timerID) - { - this._$clip.trigger(this.options.stopEventName); - clearTimeout(this._timerID); - } - this._timerID = 0; - - if (this._vTracker) - this._vTracker.reset(); - - if (this._hTracker) - this._hTracker.reset(); - - this._hideScrollBars(); - }, - - _handleMomentumScroll: function() - { - var keepGoing = false; - var v = this._$view; - - var x = 0, y = 0; - - var vt = this._vTracker; - if (vt) - { - vt.update(); - y = vt.getPosition(); - keepGoing = !vt.done(); - } - - var ht = this._hTracker; - if (ht) - { - ht.update(); - x = ht.getPosition(); - keepGoing = keepGoing || !ht.done(); - } - - this._setScrollPosition(x, y); - this._$clip.trigger(this.options.updateEventName, { x: x, y: y }); - - if (keepGoing) - this._timerID = setTimeout(this._timerCB, this._timerInterval); - else - this._stopMScroll(); - }, - - _setScrollPosition: function(x, y) - { - this._sx = x; - this._sy = y; - - var $v = this._$view; - - var sm = this.options.scrollMethod; - - switch (sm) - { - case "translate": - setElementTransform($v, x + "px", y + "px"); - break; - case "position": - $v.css({left: x + "px", top: y + "px"}); - break; - case "scroll": - var c = this._$clip[0]; - c.scrollLeft = -x; - c.scrollTop = -y; - break; - } - - var $vsb = this._$vScrollBar; - var $hsb = this._$hScrollBar; - - if ($vsb) - { - var $sbt = $vsb.find(".ui-scrollbar-thumb"); - if (sm === "translate") - setElementTransform($sbt, "0px", -y/$v.height() * $sbt.parent().height() + "px"); - else - $sbt.css("top", -y/$v.height()*100 + "%"); - } - - if ($hsb) - { - var $sbt = $hsb.find(".ui-scrollbar-thumb"); - if (sm === "translate") - setElementTransform($sbt, -x/$v.width() * $sbt.parent().width() + "px", "0px"); - else - $sbt.css("left", -x/$v.width()*100 + "%"); - } - }, - - scrollTo: function(x, y, duration) - { - this._stopMScroll(); - if (!duration) - return this._setScrollPosition(x, y); - - x = -x; - y = -y; - - var self = this; - var start = getCurrentTime(); - var efunc = $.easing["easeOutQuad"]; - var sx = this._sx; - var sy = this._sy; - var dx = x - sx; - var dy = y - sy; - var tfunc = function(){ - var elapsed = getCurrentTime() - start; - if (elapsed >= duration) - { - self._timerID = 0; - self._setScrollPosition(x, y); - } - else - { - var ec = efunc(elapsed/duration, elapsed, 0, 1, duration); - self._setScrollPosition(sx + (dx * ec), sy + (dy * ec)); - self._timerID = setTimeout(tfunc, self._timerInterval); - } - }; - - this._timerID = setTimeout(tfunc, this._timerInterval); - }, - - getScrollPosition: function() - { - return { x: -this._sx, y: -this._sy }; - }, - - _getScrollHierarchy: function() - { - var svh = []; - this._$clip.parents(".ui-scrollview-clip").each(function(){ - var d = $(this).data("scrollview"); - if (d) svh.unshift(d); - }); - return svh; - }, - - _getAncestorByDirection: function(dir) - { - var svh = this._getScrollHierarchy(); - var n = svh.length; - while (0 < n--) - { - var sv = svh[n]; - var svdir = sv.options.direction; - - if (!svdir || svdir == dir) - return sv; - } - return null; - }, - - _handleDragStart: function(e, ex, ey) - { - // Stop any scrolling of elements in our parent hierarcy. - $.each(this._getScrollHierarchy(),function(i,sv){ sv._stopMScroll(); }); - this._stopMScroll(); - - var c = this._$clip; - var v = this._$view; - - if (this.options.delayedClickEnabled) { - this._$clickEle = $(e.target).closest(this.options.delayedClickSelector); - } - this._lastX = ex; - this._lastY = ey; - this._doSnapBackX = false; - this._doSnapBackY = false; - this._speedX = 0; - this._speedY = 0; - this._directionLock = ""; - this._didDrag = false; - - if (this._hTracker) - { - var cw = parseInt(c.css("width"), 10); - var vw = parseInt(v.css("width"), 10); - this._maxX = cw - vw; - if (this._maxX > 0) this._maxX = 0; - if (this._$hScrollBar) - this._$hScrollBar.find(".ui-scrollbar-thumb").css("width", (cw >= vw ? "100%" : Math.floor(cw/vw*100)+ "%")); - } - - if (this._vTracker) - { - var ch = parseInt(c.css("height"), 10); - var vh = parseInt(v.css("height"), 10); - this._maxY = ch - vh; - if (this._maxY > 0) this._maxY = 0; - if (this._$vScrollBar) - this._$vScrollBar.find(".ui-scrollbar-thumb").css("height", (ch >= vh ? "100%" : Math.floor(ch/vh*100)+ "%")); - } - - var svdir = this.options.direction; - - this._pageDelta = 0; - this._pageSize = 0; - this._pagePos = 0; - - if (this.options.pagingEnabled && (svdir === "x" || svdir === "y")) - { - this._pageSize = svdir === "x" ? cw : ch; - this._pagePos = svdir === "x" ? this._sx : this._sy; - this._pagePos -= this._pagePos % this._pageSize; - } - this._lastMove = 0; - this._enableTracking(); - - // If we're using mouse events, we need to prevent the default - // behavior to suppress accidental selection of text, etc. We - // can't do this on touch devices because it will disable the - // generation of "click" events. - // - // XXX: We should test if this has an effect on links! - kin - - if (this.options.eventType == "mouse" || this.options.delayedClickEnabled) - e.preventDefault(); - e.stopPropagation(); - }, - - _propagateDragMove: function(sv, e, ex, ey, dir) - { - this._hideScrollBars(); - this._disableTracking(); - sv._handleDragStart(e,ex,ey); - sv._directionLock = dir; - sv._didDrag = this._didDrag; - }, - - _handleDragMove: function(e, ex, ey) - { - this._lastMove = getCurrentTime(); - - var v = this._$view; - - var dx = ex - this._lastX; - var dy = ey - this._lastY; - var svdir = this.options.direction; - - if (!this._directionLock) - { - var x = Math.abs(dx); - var y = Math.abs(dy); - var mt = this.options.moveThreshold; - - if (x < mt && y < mt) { - return false; - } - - var dir = null; - var r = 0; - if (x < y && (x/y) < 0.5) { - dir = "y"; - } - else if (x > y && (y/x) < 0.5) { - dir = "x"; - } - - if (svdir && dir && svdir != dir) - { - // This scrollview can't handle the direction the user - // is attempting to scroll. Find an ancestor scrollview - // that can handle the request. - - var sv = this._getAncestorByDirection(dir); - if (sv) - { - this._propagateDragMove(sv, e, ex, ey, dir); - return false; - } - } - - this._directionLock = svdir ? svdir : (dir ? dir : "none"); - } - - var newX = this._sx; - var newY = this._sy; - - if (this._directionLock !== "y" && this._hTracker) - { - var x = this._sx; - this._speedX = dx; - newX = x + dx; - - // Simulate resistance. - - this._doSnapBackX = false; - if (newX > 0 || newX < this._maxX) - { - if (this._directionLock === "x") - { - var sv = this._getAncestorByDirection("x"); - if (sv) - { - this._setScrollPosition(newX > 0 ? 0 : this._maxX, newY); - this._propagateDragMove(sv, e, ex, ey, dir); - return false; - } - } - newX = x + (dx/2); - this._doSnapBackX = true; - } - } - - if (this._directionLock !== "x" && this._vTracker) - { - var y = this._sy; - this._speedY = dy; - newY = y + dy; - - // Simulate resistance. - - this._doSnapBackY = false; - if (newY > 0 || newY < this._maxY) - { - if (this._directionLock === "y") - { - var sv = this._getAncestorByDirection("y"); - if (sv) - { - this._setScrollPosition(newX, newY > 0 ? 0 : this._maxY); - this._propagateDragMove(sv, e, ex, ey, dir); - return false; - } - } - - newY = y + (dy/2); - this._doSnapBackY = true; - } - - } - - if (this.options.pagingEnabled && (svdir === "x" || svdir === "y")) - { - if (this._doSnapBackX || this._doSnapBackY) - this._pageDelta = 0; - else - { - var opos = this._pagePos; - var cpos = svdir === "x" ? newX : newY; - var delta = svdir === "x" ? dx : dy; - - this._pageDelta = (opos > cpos && delta < 0) ? this._pageSize : ((opos < cpos && delta > 0) ? -this._pageSize : 0); - } - } - - this._didDrag = true; - this._lastX = ex; - this._lastY = ey; - - this._setScrollPosition(newX, newY); - - this._showScrollBars(); - - // Call preventDefault() to prevent touch devices from - // scrolling the main window. - - // e.preventDefault(); - - return false; - }, - - _handleDragStop: function(e) - { - var l = this._lastMove; - var t = getCurrentTime(); - var doScroll = l && (t - l) <= this.options.moveIntervalThreshold; - - var sx = (this._hTracker && this._speedX && doScroll) ? this._speedX : (this._doSnapBackX ? 1 : 0); - var sy = (this._vTracker && this._speedY && doScroll) ? this._speedY : (this._doSnapBackY ? 1 : 0); - - var svdir = this.options.direction; - if (this.options.pagingEnabled && (svdir === "x" || svdir === "y") && !this._doSnapBackX && !this._doSnapBackY) - { - var x = this._sx; - var y = this._sy; - if (svdir === "x") - x = -this._pagePos + this._pageDelta; - else - y = -this._pagePos + this._pageDelta; - - this.scrollTo(x, y, this.options.snapbackDuration); - } - else if (sx || sy) - this._startMScroll(sx, sy); - else - this._hideScrollBars(); - - this._disableTracking(); - - if (!this._didDrag && this.options.delayedClickEnabled && this._$clickEle.length) { - this._$clickEle - .trigger("mousedown") - //.trigger("focus") - .trigger("mouseup") - .trigger("click"); - } - - // If a view scrolled, then we need to absorb - // the event so that links etc, underneath our - // cursor/finger don't fire. - - return this._didDrag ? false : undefined; - }, - - _enableTracking: function() - { - $(document).bind(this._dragMoveEvt, this._dragMoveCB); - $(document).bind(this._dragStopEvt, this._dragStopCB); - }, - - _disableTracking: function() - { - $(document).unbind(this._dragMoveEvt, this._dragMoveCB); - $(document).unbind(this._dragStopEvt, this._dragStopCB); - }, - - _showScrollBars: function() - { - var vclass = "ui-scrollbar-visible"; - if (this._$vScrollBar) this._$vScrollBar.addClass(vclass); - if (this._$hScrollBar) this._$hScrollBar.addClass(vclass); - }, - - _hideScrollBars: function() - { - var vclass = "ui-scrollbar-visible"; - if (this._$vScrollBar) this._$vScrollBar.removeClass(vclass); - if (this._$hScrollBar) this._$hScrollBar.removeClass(vclass); - }, - - _addBehaviors: function() - { - var self = this; - if (this.options.eventType === "mouse") - { - this._dragStartEvt = "mousedown"; - this._dragStartCB = function(e){ return self._handleDragStart(e, e.clientX, e.clientY); }; - - this._dragMoveEvt = "mousemove"; - this._dragMoveCB = function(e){ return self._handleDragMove(e, e.clientX, e.clientY); }; - - this._dragStopEvt = "mouseup"; - this._dragStopCB = function(e){ return self._handleDragStop(e); }; - } - else // "touch" - { - this._dragStartEvt = "touchstart"; - this._dragStartCB = function(e) - { - var t = e.originalEvent.targetTouches[0]; - return self._handleDragStart(e, t.pageX, t.pageY); - }; - - this._dragMoveEvt = "touchmove"; - this._dragMoveCB = function(e) - { - var t = e.originalEvent.targetTouches[0]; - return self._handleDragMove(e, t.pageX, t.pageY); - }; - - this._dragStopEvt = "touchend"; - this._dragStopCB = function(e){ return self._handleDragStop(e); }; - } - - this._$view.bind(this._dragStartEvt, this._dragStartCB); - - if (this.options.showScrollBars) - { - var $c = this._$clip; - var prefix = "
          "; - if (this._vTracker) - { - $c.append(prefix + "y" + suffix); - this._$vScrollBar = $c.children(".ui-scrollbar-y"); - } - if (this._hTracker) - { - $c.append(prefix + "x" + suffix); - this._$hScrollBar = $c.children(".ui-scrollbar-x"); - } - } - } -}); - -function setElementTransform($ele, x, y) -{ - var v = "translate3d(" + x + "," + y + ", 0px)"; - $ele.css({ - "-moz-transform": v, - "-webkit-transform": v, - "transform": v - }); -} - - -function MomentumTracker(options) -{ - this.options = $.extend({}, options); - this.easing = "easeOutQuad"; - this.reset(); -} - -var tstates = { - scrolling: 0, - overshot: 1, - snapback: 2, - done: 3 -}; - -function getCurrentTime() { return (new Date()).getTime(); } - -$.extend(MomentumTracker.prototype, { - start: function(pos, speed, duration, minPos, maxPos) - { - this.state = (speed != 0) ? ((pos < minPos || pos > maxPos) ? tstates.snapback : tstates.scrolling) : tstates.done; - this.pos = pos; - this.speed = speed; - this.duration = (this.state == tstates.snapback) ? this.options.snapbackDuration : duration; - this.minPos = minPos; - this.maxPos = maxPos; - - this.fromPos = (this.state == tstates.snapback) ? this.pos : 0; - this.toPos = (this.state == tstates.snapback) ? ((this.pos < this.minPos) ? this.minPos : this.maxPos) : 0; - - this.startTime = getCurrentTime(); - }, - - reset: function() - { - this.state = tstates.done; - this.pos = 0; - this.speed = 0; - this.minPos = 0; - this.maxPos = 0; - this.duration = 0; - }, - - update: function() - { - var state = this.state; - if (state == tstates.done) - return this.pos; - - var duration = this.duration; - var elapsed = getCurrentTime() - this.startTime; - elapsed = elapsed > duration ? duration : elapsed; - - if (state == tstates.scrolling || state == tstates.overshot) - { - var dx = this.speed * (1 - $.easing[this.easing](elapsed/duration, elapsed, 0, 1, duration)); - - var x = this.pos + dx; - - var didOverShoot = (state == tstates.scrolling) && (x < this.minPos || x > this.maxPos); - if (didOverShoot) - x = (x < this.minPos) ? this.minPos : this.maxPos; - - this.pos = x; - - if (state == tstates.overshot) - { - if (elapsed >= duration) - { - this.state = tstates.snapback; - this.fromPos = this.pos; - this.toPos = (x < this.minPos) ? this.minPos : this.maxPos; - this.duration = this.options.snapbackDuration; - this.startTime = getCurrentTime(); - elapsed = 0; - } - } - else if (state == tstates.scrolling) - { - if (didOverShoot) - { - this.state = tstates.overshot; - this.speed = dx / 2; - this.duration = this.options.overshootDuration; - this.startTime = getCurrentTime(); - } - else if (elapsed >= duration) - this.state = tstates.done; - } - } - else if (state == tstates.snapback) - { - if (elapsed >= duration) - { - this.pos = this.toPos; - this.state = tstates.done; - } - else - this.pos = this.fromPos + ((this.toPos - this.fromPos) * $.easing[this.easing](elapsed/duration, elapsed, 0, 1, duration)); - } - - return this.pos; - }, - - done: function() { return this.state == tstates.done; }, - getPosition: function(){ return this.pos; } -}); - -jQuery.widget( "mobile.scrolllistview", jQuery.mobile.scrollview, { - options: { - direction: "y" - }, - - _create: function() { - $.mobile.scrollview.prototype._create.call(this); - - // Cache the dividers so we don't have to search for them everytime the - // view is scrolled. - // - // XXX: Note that we need to update this cache if we ever support lists - // that can dynamically update their content. - - this._$dividers = this._$view.find("[data-role=list-divider]"); - this._lastDivider = null; - }, - - _setScrollPosition: function(x, y) - { - // Let the view scroll like it normally does. - - $.mobile.scrollview.prototype._setScrollPosition.call(this, x, y); - - y = -y; - - // Find the dividers for the list. - - var $divs = this._$dividers; - var cnt = $divs.length; - var d = null; - var dy = 0; - var nd = null; - - for (var i = 0; i < cnt; i++) - { - nd = $divs.get(i); - var t = nd.offsetTop; - if (y >= t) - { - d = nd; - dy = t; - } - else if (d) - break; - } - - // If we found a divider to move position it at the top of the - // clip view. - - if (d) - { - var h = d.offsetHeight; - var mxy = (d != nd) ? nd.offsetTop : (this._$view.get(0).offsetHeight); - if (y + h >= mxy) - y = (mxy - h) - dy; - else - y = y - dy; - - // XXX: Need to convert this over to using $().css() and supporting the non-transform case. - - var ld = this._lastDivider; - if (ld && d != ld) { - setElementTransform($(ld), 0, 0); - } - setElementTransform($(d), 0, y + "px"); - this._lastDivider = d; - - } - } -}); - -})(jQuery,window,document); // End Component diff --git a/theme/mymobile/lang/en/theme_mymobile.php b/theme/mymobile/lang/en/theme_mymobile.php index 77465efa00b..f80ddb3204d 100644 --- a/theme/mymobile/lang/en/theme_mymobile.php +++ b/theme/mymobile/lang/en/theme_mymobile.php @@ -40,4 +40,6 @@ $string['showfullsizeimages'] = 'Show full images on site index and course pages $string['showfullsizeimages_desc'] = 'Show full size images on site index and course pages instead of replaced thumb icon method. Default is to not show full size images.'; $string['usetableview'] = 'Tablet View'; $string['usetableview_desc'] = 'Use the tablet view for larger devices (yes by default).'; -$string['yes'] = 'Yes'; \ No newline at end of file +$string['yes'] = 'Yes'; +$string['customcss'] = 'Custom CSS'; +$string['customcssdesc'] = 'Any CSS you enter here will be added to every page allowing your to easily customise this theme.'; \ No newline at end of file diff --git a/theme/mymobile/layout/embedded.php b/theme/mymobile/layout/embedded.php index 5a0141073e1..7212b70008a 100644 --- a/theme/mymobile/layout/embedded.php +++ b/theme/mymobile/layout/embedded.php @@ -35,11 +35,11 @@ if ($showswatch == "light") { $datatheme = 'a'; $databodytheme = 'c'; } -$mypagetype = $PAGE->pagetype; $bodyclasses = array(); +$mypagetype = $PAGE->pagetype; echo $OUTPUT->doctype() ?> -htmlattributes() ?>> +htmlattributes() ?>> <?php echo $PAGE->title ?> @@ -64,7 +64,7 @@ echo $OUTPUT->doctype() ?>
          -
          +
          main_content(); ?>
          @@ -72,4 +72,4 @@ echo $OUTPUT->doctype() ?> standard_end_of_body_html() ?> - + \ No newline at end of file diff --git a/theme/mymobile/layout/general.php b/theme/mymobile/layout/general.php index 91f90a9b5ec..ba988344054 100644 --- a/theme/mymobile/layout/general.php +++ b/theme/mymobile/layout/general.php @@ -105,7 +105,7 @@ $usercol = (mymobile_get_colpos() == 'on'); $renderer = $PAGE->get_renderer('theme_mymobile'); echo $OUTPUT->doctype() ?> -htmlattributes() ?>> +htmlattributes() ?>> <?php echo $PAGE->title ?> @@ -122,7 +122,7 @@ echo $OUTPUT->doctype() ?> standard_top_of_body_html() ?>
          -
          class="mymobileheader"> +
          class="mymobileheader" data-position="fixed">

          heading ?>

          @@ -210,7 +210,7 @@ echo $OUTPUT->doctype() ?>
          - diff --git a/theme/mymobile/lib.php b/theme/mymobile/lib.php index cefa013ab36..abec9ffcb91 100644 --- a/theme/mymobile/lib.php +++ b/theme/mymobile/lib.php @@ -40,4 +40,27 @@ function mymobile_initialise_colpos(moodle_page $page) { */ function mymobile_get_colpos($default = 'on') { return get_user_preferences('theme_mymobile_chosen_colpos', $default); +} + +/** + * Makes our changes to the CSS + * + * @param string $css + * @param theme_config $theme + * @return string + */ +function mymobile_user_settings($css, $theme) { + if (!empty($theme->settings->customcss)) { + $customcss = $theme->settings->customcss; + } else { + $customcss = null; + } + $css = mymobile_set_customcss($css, $customcss); + return $css; +} + +function mymobile_set_customcss($css, $customcss) { + $tag = '[[setting:customcss]]'; + $css = str_replace($tag, $customcss, $css); + return $css; } \ No newline at end of file diff --git a/theme/mymobile/pix/ajax-loader.png b/theme/mymobile/pix/ajax-loader.png index 811a2cdd1b4..13b208dddd6 100644 Binary files a/theme/mymobile/pix/ajax-loader.png and b/theme/mymobile/pix/ajax-loader.png differ diff --git a/theme/mymobile/pix/ajax-loader2.gif b/theme/mymobile/pix/ajax-loader2.gif new file mode 100644 index 00000000000..fd1a189c21f Binary files /dev/null and b/theme/mymobile/pix/ajax-loader2.gif differ diff --git a/theme/mymobile/pix/icons-18-black.png b/theme/mymobile/pix/icons-18-black.png index 1ecfd26fbcd..ce1b758ad58 100644 Binary files a/theme/mymobile/pix/icons-18-black.png and b/theme/mymobile/pix/icons-18-black.png differ diff --git a/theme/mymobile/pix/icons-18-white.png b/theme/mymobile/pix/icons-18-white.png index 0c70831ac51..1ab01272379 100644 Binary files a/theme/mymobile/pix/icons-18-white.png and b/theme/mymobile/pix/icons-18-white.png differ diff --git a/theme/mymobile/pix/icons-36-black.png b/theme/mymobile/pix/icons-36-black.png index 4c72adf1e81..1a59d7c375d 100644 Binary files a/theme/mymobile/pix/icons-36-black.png and b/theme/mymobile/pix/icons-36-black.png differ diff --git a/theme/mymobile/pix/icons-36-white.png b/theme/mymobile/pix/icons-36-white.png index 84ea9fb31ae..5647bdc945d 100644 Binary files a/theme/mymobile/pix/icons-36-white.png and b/theme/mymobile/pix/icons-36-white.png differ diff --git a/theme/mymobile/renderers.php b/theme/mymobile/renderers.php index a0eac198da4..2b340d95212 100644 --- a/theme/mymobile/renderers.php +++ b/theme/mymobile/renderers.php @@ -179,8 +179,8 @@ class theme_mymobile_core_renderer extends core_renderer { $skipdest = html_writer::tag('span', '', array('id' => 'sb-' . $bc->skipid, 'class' => 'skip-block-to')); } $testb = $bc->attributes['class']; - - // TODO: Find a better solution to this hardcoded block checks + $testc = $bc->attributes['id']; + // TODO: Find a better solution to this hardcoded block checks. if ($testb == "block_calendar_month2 block") { $output = html_writer::start_tag('span'); } else if ($testb == "block_course_overview block") { @@ -196,7 +196,12 @@ class theme_mymobile_core_renderer extends core_renderer { } else { $dtheme = 'c'; } - $output = html_writer::start_tag('div', array('data-role' => 'collapsible', 'data-collapsed' => 'true', 'data-content-theme' => $dtheme)); + if ($testc == "mod_quiz_navblock") { + $collap = 'false'; + } else { + $collap = 'true'; + } + $output = html_writer::start_tag('div', array('data-role' => 'collapsible', 'data-collapsed' => $collap, 'data-content-theme' => $dtheme)); } $output .= html_writer::tag('h1', $this->block_header($bc)); @@ -359,7 +364,7 @@ class theme_mymobile_core_renderer extends core_renderer { } else { $loggedinas .= get_string('failedloginattemptsall', '', $count); } - if (has_capability('coursereport/log:view', get_context_instance(CONTEXT_SYSTEM))) { + if (file_exists("$CFG->dirroot/report/log/index.php") and has_capability('report/log:view', get_context_instance(CONTEXT_SYSTEM))) { $loggedinas .= ' ('.get_string('logs').')'; } $loggedinas .= '
          '; @@ -442,7 +447,7 @@ class theme_mymobile_core_renderer extends core_renderer { } else { $loggedinas .= get_string('failedloginattemptsall', '', $count); } - if (has_capability('coursereport/log:view', get_context_instance(CONTEXT_SYSTEM))) { + if (has_capability('report/log:view', get_context_instance(CONTEXT_SYSTEM))) { $loggedinas .= ' ('.get_string('logs').')'; } $loggedinas .= '
          '; @@ -548,7 +553,7 @@ class theme_mymobile_core_renderer extends core_renderer { $attributes['id'] = $id; $attributes['rel'] = 'notexternal'; $attributes['data-rel'] = 'dialog'; - $attributes['data-transition'] = 'slideup'; + $attributes['data-transition'] = 'flow'; $output = html_writer::tag('a', $output, $attributes); // and finally span @@ -758,7 +763,7 @@ class theme_mymobile_core_renderer extends core_renderer { //by john show go button to fix selects $go = ''; - $output .= html_writer::empty_tag('input data-inline="true"', array('type' => 'submit', 'value' => get_string('go'))); + $output .= html_writer::empty_tag('input data-inline="true"', array('type' => 'submit','value' => get_string('go'))); $output .= html_writer::tag('noscript', html_writer::tag('div', $go), array('style' => 'inline')); $nothing = empty($select->nothing) ? false : key($select->nothing); diff --git a/theme/mymobile/settings.php b/theme/mymobile/settings.php index 10e49147369..cb309406cc8 100644 --- a/theme/mymobile/settings.php +++ b/theme/mymobile/settings.php @@ -74,6 +74,13 @@ if ($ADMIN->fulltree) { $setting = new admin_setting_configselect($name, $title, $description, $default, $choices); $settings->add($setting); + $name = 'theme_mymobile/customcss'; + $title = get_string('customcss','theme_mymobile'); + $description = get_string('customcssdesc', 'theme_mymobile'); + $default = ''; + $setting = new admin_setting_configtextarea($name, $title, $description, $default); + $settings->add($setting); + unset($yesstr); unset($nostr); } \ No newline at end of file diff --git a/theme/mymobile/style/core.css b/theme/mymobile/style/core.css index 545c28b2c86..ef45f30f0c3 100644 --- a/theme/mymobile/style/core.css +++ b/theme/mymobile/style/core.css @@ -124,17 +124,22 @@ div.notifyproblem { cursor:default !important; } /*under footer */ +#underfooter { + padding: 1em 0em; + font-size: 90%; +} #underfooter .logininfo { text-align: center; - padding-top: .8em !important; - padding-bottom: .8em; - font-size: .8em; - font-weight: 400; + padding-top: .0em !important; + padding-bottom: .0em; + font-size: inherit; + font-weight: normal; } -#underfooter div { +#underfooter #theme_switch_link { + padding-top: 0.5em; text-align: center; - font-size: .8em; } + #underfooter .noajax { padding-bottom: .2em; } @@ -584,9 +589,6 @@ table.forumheaderlist2 td.topic a { div.discussioncontrols { display: none; } -.path-mod-forum .indent { - margin-left: 0px; -} .path-mod-forum div.subject { font-size: 120%; } @@ -1274,7 +1276,7 @@ li.reportoption, #page-mod-choice-report .downloadreport ul li { width:100%; overflow: auto; } -.path-mod-choice .ui-scrollview-clip .names { +.path-mod-choice .names { max-width: 1500px; min-width: 480px; } @@ -1441,94 +1443,16 @@ overflow:auto !important; .course_category_tree .controls { display: none; } -/*scrollview */ -.ui-scrollview-clip { -} -.ui-scrollview-view { -} -.ui-scrolllistview .ui-li-divider { - z-index: 10; -} -.ui-scrollbar { - position: absolute; - overflow: hidden; - -webkit-transition: opacity 500ms; - -moz-transition: opacity 500ms; - transition: opacity 500ms; - opacity: .3; -} -.ui-scrollbar-visible { - opacity: 1; -} -.ui-scrollbar-y { - top: 2px; - right: 2px; - bottom: 8px; - width: 5px; -} -.ui-scrollbar-x { - right: 8px; - bottom: 2px; - left: 2px; - height: 5px; -} -.ui-scrollbar-track { - position: relative; - width: 100%; - height: 100%; -} -.ui-scrollbar-thumb { - position: absolute; - top: 0; - left: 0; - background-color: rgba(0, 0, 0, 0.3); - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - border-radius: 2px; -} -.ui-scrollbar-y .ui-scrollbar-thumb { - width: 5px; - height: 100%; -} -.ui-scrollbar-x .ui-scrollbar-thumb { - width: 100%; - height: 5px; +/*touch overflow to allow scrolling of divs, replaces old scrollview method*/ +.gradeparent, .pagelayout-report .no-overflow, .path-mod-choice .response, .resourcecontent.resourceimg, .usersubmissions .no-overflow, .path-course-report-log .generaltable, table.results.anonymous, table.surveytable, div.resultgraph, div.reportsummary a, #completion-progress, #attempts { + overflow: scroll; + -webkit-overflow-scrolling: touch; } /*some loader overrides to hide the loading message */ -body .ui-loader { - background: none; - border: none; - padding: 1em; - background-color: #000; - opacity: 1; - background-position: center center; - -webkit-border-top-left-radius: 0.7em; - -webkit-border-top-right-radius: 0.7em; - -webkit-border-bottom-right-radius: 0.7em; - -webkit-border-bottom-left-radius: 0.7em; - -moz-border-radius-topleft: 0.7em; - -moz-border-radius-topright: 0.7em; - -moz-border-radius-bottomright: 0.7em; - -moz-border-radius-bottomleft: 0.7em; - border-top-left-radius: 0.7em; - border-top-right-radius: 0.7em; - border-bottom-right-radius: 0.7em; - border-bottom-left-radius: 0.7em; - width: 35px; - margin-left: -35px; +.ui-loader-default { + background: #000000; + opacity: 0.8; } -body .ui-loader.ui-body-e { - width: inherit; - color: #fff; - padding: 2em; -} -body .ui-loader h1 { - display: none; -} -body .ui-loader.ui-body-e h1 { - display: inherit; -} -.ui-loader .ui-icon { opacity: 1; } /*current highlight */ .weeks .current .headingwrap, .topics .current div.headingwrap, .current .ui-bar-b, .current .left.side, .tabtree ul.tabrow0 li.selected a, .ui-btn-active, #page-course-view-topcollPAGE .current { border: 1px solid #F7C942; @@ -1569,9 +1493,13 @@ body .ui-loader.ui-body-e h1 { .ui-navbar .ui-select2 .ui-btn-corner-all, .ui-navbar .ui-select .ui-btn-inner { border-radius: 0em 0em 0em 0em; } -.ui-navbar .ui-select .ui-btn-icon-right .ui-btn-inner { +.ui-navbar .ui-select .ui-btn-icon-right .ui-btn-inner2 { padding-right: 5px; } +.ui-navbar .ui-select .ui-btn-icon-right .ui-btn-inner { + padding-right: 15px; + padding-left: 15px; +} .ui-header .ui-navbar li .ui-btn { -webkit-border-radius: .4em /*{global-radii-blocks}*/; -webkit-border-radius: .4em .4em .4em .4em; @@ -1594,10 +1522,21 @@ body .ui-loader.ui-body-e h1 { padding-bottom: 0.6em; padding-top: 0.5em; } +.ui-header .ui-fullsize .ui-btn-inner, .ui-footer .ui-fullsize .ui-btn-inner { + font-size: 12.5px; +} /*split page stuff for tablets */ - div.tablets, #sliderdiv, .has-myblocks .jsetsbar { - display: none; +div.tablets, #sliderdiv, .has-myblocks .jsetsbar { + display: none; +} +@media all and (max-width: 480px){ + .ui-footer.mobilefooter .ui-btn-icon-top .ui-btn-inner, .mobilefooter .ui-mini .ui-btn-icon-top .ui-btn-inner { + padding: 0.7em 3px 0.7em; } + .ui-footer.mobilefooter .ui-btn-icon-top .ui-icon, .mobilefooter .ui-mini.ui-btn-icon-top .ui-icon, .mobilefooter .ui-mini .ui-btn-icon-top .ui-icon { + display: none; + } +} @media all and (min-width: 650px){ .has-myblocks div.tablets, .content-secondary, #sliderdiv { display: block; @@ -1711,3 +1650,5 @@ body .ui-loader.ui-body-e h1 { max-width: 100px; max-height: 100px; } +/** Custom CSS **/ +[[setting:customcss]] \ No newline at end of file diff --git a/theme/mymobile/style/jmobile1.css b/theme/mymobile/style/jmobile11.css similarity index 51% rename from theme/mymobile/style/jmobile1.css rename to theme/mymobile/style/jmobile11.css index bb05feb1574..4e0a49c7a85 100644 --- a/theme/mymobile/style/jmobile1.css +++ b/theme/mymobile/style/jmobile11.css @@ -1,5 +1,5 @@ /* -* jQuery Mobile Framework Git Build: SHA1: ed6a08489708b68de614ddd5bf2f6f4bfd1cb36a <> Date: Thu Nov 17 11:25:15 2011 -0500 +* jQuery Mobile Framework 1.1.0 db342b1f315c282692791aa870455901fdb46a55 * http://jquerymobile.com * * Copyright 2011 (c) jQuery Project @@ -8,22 +8,20 @@ * */ /* Swatches */ - /* A -----------------------------------------------------------------------------------------------------------*/ - .ui-bar-a { - border: 1px solid #2A2A2A /*{a-bar-border}*/; + border: 1px solid #333 /*{a-bar-border}*/; background: #111111 /*{a-bar-background-color}*/; color: #ffffff /*{a-bar-color}*/; font-weight: bold; text-shadow: 0 /*{a-bar-shadow-x}*/ -1px /*{a-bar-shadow-y}*/ 1px /*{a-bar-shadow-radius}*/ #000000 /*{a-bar-shadow-color}*/; background-image: -webkit-gradient(linear, left top, left bottom, from( #3c3c3c /*{a-bar-background-start}*/), to( #111 /*{a-bar-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient(#3c3c3c /*{a-bar-background-start}*/, #111 /*{a-bar-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient(#3c3c3c /*{a-bar-background-start}*/, #111 /*{a-bar-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient(#3c3c3c /*{a-bar-background-start}*/, #111 /*{a-bar-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient(#3c3c3c /*{a-bar-background-start}*/, #111 /*{a-bar-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient(#3c3c3c /*{a-bar-background-start}*/, #111 /*{a-bar-background-end}*/); + background-image: -webkit-linear-gradient( #3c3c3c /*{a-bar-background-start}*/, #111 /*{a-bar-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient( #3c3c3c /*{a-bar-background-start}*/, #111 /*{a-bar-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient( #3c3c3c /*{a-bar-background-start}*/, #111 /*{a-bar-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient( #3c3c3c /*{a-bar-background-start}*/, #111 /*{a-bar-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient( #3c3c3c /*{a-bar-background-start}*/, #111 /*{a-bar-background-end}*/); } .ui-bar-a, .ui-bar-a input, @@ -35,36 +33,36 @@ .ui-bar-a .ui-link-inherit { color: #fff /*{a-bar-color}*/; } - .ui-bar-a .ui-link { color: #7cc4e7 /*{a-bar-link-color}*/; font-weight: bold; } - .ui-bar-a .ui-link:hover { color: #2489CE /*{a-bar-link-hover}*/; } - .ui-bar-a .ui-link:active { color: #2489CE /*{a-bar-link-active}*/; } - .ui-bar-a .ui-link:visited { color: #2489CE /*{a-bar-link-visited}*/; } .ui-body-a, -.ui-dialog.ui-overlay-a { - border: 1px solid #2A2A2A /*{a-body-border}*/; - background: #222222 /*{a-body-background-color}*/; +.ui-overlay-a { + border: 1px solid #444 /*{a-body-border}*/; + background: #222 /*{a-body-background-color}*/; color: #fff /*{a-body-color}*/; - text-shadow: 0 /*{a-body-shadow-x}*/ 1px /*{a-body-shadow-y}*/ 0 /*{a-body-shadow-radius}*/ #000 /*{a-body-shadow-color}*/; + text-shadow: 0 /*{a-body-shadow-x}*/ 1px /*{a-body-shadow-y}*/ 1px /*{a-body-shadow-radius}*/ #111 /*{a-body-shadow-color}*/; font-weight: normal; - background-image: -webkit-gradient(linear, left top, left bottom, from( #666 /*{a-body-background-start}*/), to( #222 /*{a-body-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient(#666 /*{a-body-background-start}*/, #222 /*{a-body-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient(#666 /*{a-body-background-start}*/, #222 /*{a-body-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient(#666 /*{a-body-background-start}*/, #222 /*{a-body-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient(#666 /*{a-body-background-start}*/, #222 /*{a-body-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient(#666 /*{a-body-background-start}*/, #222 /*{a-body-background-end}*/); + background-image: -webkit-gradient(linear, left top, left bottom, from( #444 /*{a-body-background-start}*/), to( #222 /*{a-body-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient( #444 /*{a-body-background-start}*/, #222 /*{a-body-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient( #444 /*{a-body-background-start}*/, #222 /*{a-body-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient( #444 /*{a-body-background-start}*/, #222 /*{a-body-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient( #444 /*{a-body-background-start}*/, #222 /*{a-body-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient( #444 /*{a-body-background-start}*/, #222 /*{a-body-background-end}*/); +} +.ui-overlay-a { + background-image: none; + border-width: 0; } .ui-body-a, .ui-body-a input, @@ -76,36 +74,31 @@ .ui-body-a .ui-link-inherit { color: #fff /*{a-body-color}*/; } - .ui-body-a .ui-link { color: #2489CE /*{a-body-link-color}*/; font-weight: bold; } - .ui-body-a .ui-link:hover { color: #2489CE /*{a-body-link-hover}*/; } - .ui-body-a .ui-link:active { color: #2489CE /*{a-body-link-active}*/; } - .ui-body-a .ui-link:visited { color: #2489CE /*{a-body-link-visited}*/; } - .ui-btn-up-a { - border: 1px solid #222 /*{a-bup-border}*/; - background: #333333 /*{a-bup-background-color}*/; + border: 1px solid #111 /*{a-bup-border}*/; + background: #333 /*{a-bup-background-color}*/; font-weight: bold; color: #fff /*{a-bup-color}*/; - text-shadow: 0 /*{a-bup-shadow-x}*/ -1px /*{a-bup-shadow-y}*/ 1px /*{a-bup-shadow-radius}*/ #000 /*{a-bup-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #555 /*{a-bup-background-start}*/), to( #333 /*{a-bup-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient(#555 /*{a-bup-background-start}*/, #333 /*{a-bup-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient(#555 /*{a-bup-background-start}*/, #333 /*{a-bup-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient(#555 /*{a-bup-background-start}*/, #333 /*{a-bup-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient(#555 /*{a-bup-background-start}*/, #333 /*{a-bup-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient(#555 /*{a-bup-background-start}*/, #333 /*{a-bup-background-end}*/); + text-shadow: 0 /*{a-bup-shadow-x}*/ 1px /*{a-bup-shadow-y}*/ 1px /*{a-bup-shadow-radius}*/ #111 /*{a-bup-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from( #444444 /*{a-bup-background-start}*/), to( #2d2d2d /*{a-bup-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient( #444444 /*{a-bup-background-start}*/, #2d2d2d /*{a-bup-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient( #444444 /*{a-bup-background-start}*/, #2d2d2d /*{a-bup-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient( #444444 /*{a-bup-background-start}*/, #2d2d2d /*{a-bup-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient( #444444 /*{a-bup-background-start}*/, #2d2d2d /*{a-bup-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient( #444444 /*{a-bup-background-start}*/, #2d2d2d /*{a-bup-background-end}*/); } .ui-btn-up-a a.ui-link-inherit { color: #fff /*{a-bup-color}*/; @@ -115,29 +108,29 @@ background: #444444 /*{a-bhover-background-color}*/; font-weight: bold; color: #fff /*{a-bhover-color}*/; - text-shadow: 0 /*{a-bhover-shadow-x}*/ -1px /*{a-bhover-shadow-y}*/ 1px /*{a-bhover-shadow-radius}*/ #000 /*{a-bhover-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #666 /*{a-bhover-background-start}*/), to( #444 /*{a-bhover-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient(#666 /*{a-bhover-background-start}*/, #444 /*{a-bhover-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient(#666 /*{a-bhover-background-start}*/, #444 /*{a-bhover-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient(#666 /*{a-bhover-background-start}*/, #444 /*{a-bhover-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient(#666 /*{a-bhover-background-start}*/, #444 /*{a-bhover-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient(#666 /*{a-bhover-background-start}*/, #444 /*{a-bhover-background-end}*/); + text-shadow: 0 /*{a-bhover-shadow-x}*/ 1px /*{a-bhover-shadow-y}*/ 1px /*{a-bhover-shadow-radius}*/ #111 /*{a-bhover-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from( #555555 /*{a-bhover-background-start}*/), to( #383838 /*{a-bhover-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient( #555555 /*{a-bhover-background-start}*/, #383838 /*{a-bhover-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient( #555555 /*{a-bhover-background-start}*/, #383838 /*{a-bhover-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient( #555555 /*{a-bhover-background-start}*/, #383838 /*{a-bhover-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient( #555555 /*{a-bhover-background-start}*/, #383838 /*{a-bhover-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient( #555555 /*{a-bhover-background-start}*/, #383838 /*{a-bhover-background-end}*/); } .ui-btn-hover-a a.ui-link-inherit { color: #fff /*{a-bhover-color}*/; } .ui-btn-down-a { border: 1px solid #000 /*{a-bdown-border}*/; - background: #3d3d3d /*{a-bdown-background-color}*/; + background: #222 /*{a-bdown-background-color}*/; font-weight: bold; color: #fff /*{a-bdown-color}*/; - text-shadow: 0 /*{a-bdown-shadow-x}*/ -1px /*{a-bdown-shadow-y}*/ 1px /*{a-bdown-shadow-radius}*/ #000 /*{a-bdown-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #333 /*{a-bdown-background-start}*/), to( #5a5a5a /*{a-bdown-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient(#333 /*{a-bdown-background-start}*/, #5a5a5a /*{a-bdown-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient(#333 /*{a-bdown-background-start}*/, #5a5a5a /*{a-bdown-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient(#333 /*{a-bdown-background-start}*/, #5a5a5a /*{a-bdown-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient(#333 /*{a-bdown-background-start}*/, #5a5a5a /*{a-bdown-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient(#333 /*{a-bdown-background-start}*/, #5a5a5a /*{a-bdown-background-end}*/); + text-shadow: 0 /*{a-bdown-shadow-x}*/ 1px /*{a-bdown-shadow-y}*/ 1px /*{a-bdown-shadow-radius}*/ #111 /*{a-bdown-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from( #202020 /*{a-bdown-background-start}*/), to( #2c2c2c /*{a-bdown-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient( #202020 /*{a-bdown-background-start}*/, #2c2c2c /*{a-bdown-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient( #202020 /*{a-bdown-background-start}*/, #2c2c2c /*{a-bdown-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient( #202020 /*{a-bdown-background-start}*/, #2c2c2c /*{a-bdown-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient( #202020 /*{a-bdown-background-start}*/, #2c2c2c /*{a-bdown-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient( #202020 /*{a-bdown-background-start}*/, #2c2c2c /*{a-bdown-background-end}*/); } .ui-btn-down-a a.ui-link-inherit { color: #fff /*{a-bdown-color}*/; @@ -148,23 +141,20 @@ font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/; text-decoration: none; } - - /* B -----------------------------------------------------------------------------------------------------------*/ - .ui-bar-b { border: 1px solid #456f9a /*{b-bar-border}*/; background: #5e87b0 /*{b-bar-background-color}*/; color: #fff /*{b-bar-color}*/; font-weight: bold; - text-shadow: 0 /*{b-bar-shadow-x}*/ -1px /*{b-bar-shadow-y}*/ 1px /*{b-bar-shadow-radius}*/ #254f7a /*{b-bar-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #81a8ce /*{b-bar-background-start}*/), to( #5e87b0 /*{b-bar-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient(#81a8ce /*{b-bar-background-start}*/, #5e87b0 /*{b-bar-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient(#81a8ce /*{b-bar-background-start}*/, #5e87b0 /*{b-bar-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient(#81a8ce /*{b-bar-background-start}*/, #5e87b0 /*{b-bar-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient(#81a8ce /*{b-bar-background-start}*/, #5e87b0 /*{b-bar-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient(#81a8ce /*{b-bar-background-start}*/, #5e87b0 /*{b-bar-background-end}*/); + text-shadow: 0 /*{b-bar-shadow-x}*/ 1px /*{b-bar-shadow-y}*/ 1px /*{b-bar-shadow-radius}*/ #3e6790 /*{b-bar-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from( #6facd5 /*{b-bar-background-start}*/), to( #497bae /*{b-bar-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient( #6facd5 /*{b-bar-background-start}*/, #497bae /*{b-bar-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient( #6facd5 /*{b-bar-background-start}*/, #497bae /*{b-bar-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient( #6facd5 /*{b-bar-background-start}*/, #497bae /*{b-bar-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient( #6facd5 /*{b-bar-background-start}*/, #497bae /*{b-bar-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient( #6facd5 /*{b-bar-background-start}*/, #497bae /*{b-bar-background-end}*/); } .ui-bar-b, .ui-bar-b input, @@ -180,31 +170,32 @@ color: #ddf0f8 /*{b-bar-link-color}*/; font-weight: bold; } - .ui-bar-b .ui-link:hover { color: #ddf0f8 /*{b-bar-link-hover}*/; } - .ui-bar-b .ui-link:active { color: #ddf0f8 /*{b-bar-link-active}*/; } - .ui-bar-b .ui-link:visited { color: #ddf0f8 /*{b-bar-link-visited}*/; } .ui-body-b, -.ui-dialog.ui-overlay-b { - border: 1px solid #C6C6C6 /*{b-body-border}*/; - background: #cccccc /*{b-body-background-color}*/; - color: #333333 /*{b-body-color}*/; +.ui-overlay-b { + border: 1px solid #999 /*{b-body-border}*/; + background: #f3f3f3 /*{b-body-background-color}*/; + color: #222222 /*{b-body-color}*/; text-shadow: 0 /*{b-body-shadow-x}*/ 1px /*{b-body-shadow-y}*/ 0 /*{b-body-shadow-radius}*/ #fff /*{b-body-shadow-color}*/; font-weight: normal; - background-image: -webkit-gradient(linear, left top, left bottom, from( #e6e6e6 /*{b-body-background-start}*/), to( #ccc /*{b-body-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient(#e6e6e6 /*{b-body-background-start}*/, #ccc /*{b-body-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient(#e6e6e6 /*{b-body-background-start}*/, #ccc /*{b-body-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient(#e6e6e6 /*{b-body-background-start}*/, #ccc /*{b-body-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient(#e6e6e6 /*{b-body-background-start}*/, #ccc /*{b-body-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient(#e6e6e6 /*{b-body-background-start}*/, #ccc /*{b-body-background-end}*/); + background-image: -webkit-gradient(linear, left top, left bottom, from( #ddd /*{b-body-background-start}*/), to( #ccc /*{b-body-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient( #ddd /*{b-body-background-start}*/, #ccc /*{b-body-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient( #ddd /*{b-body-background-start}*/, #ccc /*{b-body-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient( #ddd /*{b-body-background-start}*/, #ccc /*{b-body-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient( #ddd /*{b-body-background-start}*/, #ccc /*{b-body-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient( #ddd /*{b-body-background-start}*/, #ccc /*{b-body-background-end}*/); +} +.ui-overlay-b { + background-image: none; + border-width: 0; } .ui-body-b, .ui-body-b input, @@ -216,52 +207,47 @@ .ui-body-b .ui-link-inherit { color: #333333 /*{b-body-color}*/; } - .ui-body-b .ui-link { color: #2489CE /*{b-body-link-color}*/; font-weight: bold; } - .ui-body-b .ui-link:hover { color: #2489CE /*{b-body-link-hover}*/; } - .ui-body-b .ui-link:active { color: #2489CE /*{b-body-link-active}*/; } - .ui-body-b .ui-link:visited { color: #2489CE /*{b-body-link-visited}*/; } - .ui-btn-up-b { - border: 1px solid #145072 /*{b-bup-border}*/; - background: #2567ab /*{b-bup-background-color}*/; + border: 1px solid #044062 /*{b-bup-border}*/; + background: #396b9e /*{b-bup-background-color}*/; font-weight: bold; color: #fff /*{b-bup-color}*/; - text-shadow: 0 /*{b-bup-shadow-x}*/ -1px /*{b-bup-shadow-y}*/ 1px /*{b-bup-shadow-radius}*/ #145072 /*{b-bup-shadow-color}*/; + text-shadow: 0 /*{b-bup-shadow-x}*/ 1px /*{b-bup-shadow-y}*/ 1px /*{b-bup-shadow-radius}*/ #194b7e /*{b-bup-shadow-color}*/; background-image: -webkit-gradient(linear, left top, left bottom, from( #5f9cc5 /*{b-bup-background-start}*/), to( #396b9e /*{b-bup-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient(#5f9cc5 /*{b-bup-background-start}*/, #396b9e /*{b-bup-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient(#5f9cc5 /*{b-bup-background-start}*/, #396b9e /*{b-bup-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient(#5f9cc5 /*{b-bup-background-start}*/, #396b9e /*{b-bup-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient(#5f9cc5 /*{b-bup-background-start}*/, #396b9e /*{b-bup-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient(#5f9cc5 /*{b-bup-background-start}*/, #396b9e /*{b-bup-background-end}*/); + background-image: -webkit-linear-gradient( #5f9cc5 /*{b-bup-background-start}*/, #396b9e /*{b-bup-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient( #5f9cc5 /*{b-bup-background-start}*/, #396b9e /*{b-bup-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient( #5f9cc5 /*{b-bup-background-start}*/, #396b9e /*{b-bup-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient( #5f9cc5 /*{b-bup-background-start}*/, #396b9e /*{b-bup-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient( #5f9cc5 /*{b-bup-background-start}*/, #396b9e /*{b-bup-background-end}*/); } .ui-btn-up-b a.ui-link-inherit { color: #fff /*{b-bup-color}*/; } .ui-btn-hover-b { - border: 1px solid #00516e /*{b-bhover-border}*/; + border: 1px solid #00415e /*{b-bhover-border}*/; background: #4b88b6 /*{b-bhover-background-color}*/; font-weight: bold; color: #fff /*{b-bhover-color}*/; - text-shadow: 0 /*{b-bhover-shadow-x}*/ -1px /*{b-bhover-shadow-y}*/ 1px /*{b-bhover-shadow-radius}*/ #014D68 /*{b-bhover-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #72b0d4 /*{b-bhover-background-start}*/), to( #4b88b6 /*{b-bhover-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient(#72b0d4 /*{b-bhover-background-start}*/, #4b88b6 /*{b-bhover-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient(#72b0d4 /*{b-bhover-background-start}*/, #4b88b6 /*{b-bhover-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient(#72b0d4 /*{b-bhover-background-start}*/, #4b88b6 /*{b-bhover-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient(#72b0d4 /*{b-bhover-background-start}*/, #4b88b6 /*{b-bhover-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient(#72b0d4 /*{b-bhover-background-start}*/, #4b88b6 /*{b-bhover-background-end}*/); + text-shadow: 0 /*{b-bhover-shadow-x}*/ 1px /*{b-bhover-shadow-y}*/ 1px /*{b-bhover-shadow-radius}*/ #194b7e /*{b-bhover-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from( #6facd5 /*{b-bhover-background-start}*/), to( #4272a4 /*{b-bhover-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient( #6facd5 /*{b-bhover-background-start}*/, #4272a4 /*{b-bhover-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient( #6facd5 /*{b-bhover-background-start}*/, #4272a4 /*{b-bhover-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient( #6facd5 /*{b-bhover-background-start}*/, #4272a4 /*{b-bhover-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient( #6facd5 /*{b-bhover-background-start}*/, #4272a4 /*{b-bhover-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient( #6facd5 /*{b-bhover-background-start}*/, #4272a4 /*{b-bhover-background-end}*/); } .ui-btn-hover-b a.ui-link-inherit { color: #fff /*{b-bhover-color}*/; @@ -271,13 +257,13 @@ background: #4e89c5 /*{b-bdown-background-color}*/; font-weight: bold; color: #fff /*{b-bdown-color}*/; - text-shadow: 0 /*{b-bdown-shadow-x}*/ -1px /*{b-bdown-shadow-y}*/ 1px /*{b-bdown-shadow-radius}*/ #225377 /*{b-bdown-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #396b9e /*{b-bdown-background-start}*/), to( #4e89c5 /*{b-bdown-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient(#396b9e /*{b-bdown-background-start}*/, #4e89c5 /*{b-bdown-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient(#396b9e /*{b-bdown-background-start}*/, #4e89c5 /*{b-bdown-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient(#396b9e /*{b-bdown-background-start}*/, #4e89c5 /*{b-bdown-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient(#396b9e /*{b-bdown-background-start}*/, #4e89c5 /*{b-bdown-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient(#396b9e /*{b-bdown-background-start}*/, #4e89c5 /*{b-bdown-background-end}*/); + text-shadow: 0 /*{b-bdown-shadow-x}*/ 1px /*{b-bdown-shadow-y}*/ 1px /*{b-bdown-shadow-radius}*/ #194b7e /*{b-bdown-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from( #295b8e /*{b-bdown-background-start}*/), to( #3e79b5 /*{b-bdown-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient( #295b8e /*{b-bdown-background-start}*/, #3e79b5 /*{b-bdown-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient( #295b8e /*{b-bdown-background-start}*/, #3e79b5 /*{b-bdown-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient( #295b8e /*{b-bdown-background-start}*/, #3e79b5 /*{b-bdown-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient( #295b8e /*{b-bdown-background-start}*/, #3e79b5 /*{b-bdown-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient( #295b8e /*{b-bdown-background-start}*/, #3e79b5 /*{b-bdown-background-end}*/); } .ui-btn-down-b a.ui-link-inherit { color: #fff /*{b-bdown-color}*/; @@ -288,25 +274,21 @@ font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/; text-decoration: none; } - - /* C -----------------------------------------------------------------------------------------------------------*/ - .ui-bar-c { border: 1px solid #B3B3B3 /*{c-bar-border}*/; - background: #e9eaeb /*{c-bar-background-color}*/; + background: #eeeeee /*{c-bar-background-color}*/; color: #3E3E3E /*{c-bar-color}*/; font-weight: bold; text-shadow: 0 /*{c-bar-shadow-x}*/ 1px /*{c-bar-shadow-y}*/ 1px /*{c-bar-shadow-radius}*/ #fff /*{c-bar-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #f0f0f0 /*{c-bar-background-start}*/), to( #e9eaeb /*{c-bar-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient(#f0f0f0 /*{c-bar-background-start}*/, #e9eaeb /*{c-bar-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient(#f0f0f0 /*{c-bar-background-start}*/, #e9eaeb /*{c-bar-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient(#f0f0f0 /*{c-bar-background-start}*/, #e9eaeb /*{c-bar-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient(#f0f0f0 /*{c-bar-background-start}*/, #e9eaeb /*{c-bar-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient(#f0f0f0 /*{c-bar-background-start}*/, #e9eaeb /*{c-bar-background-end}*/); + background-image: -webkit-gradient(linear, left top, left bottom, from( #f0f0f0 /*{c-bar-background-start}*/), to( #ddd /*{c-bar-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient( #f0f0f0 /*{c-bar-background-start}*/, #ddd /*{c-bar-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient( #f0f0f0 /*{c-bar-background-start}*/, #ddd /*{c-bar-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient( #f0f0f0 /*{c-bar-background-start}*/, #ddd /*{c-bar-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient( #f0f0f0 /*{c-bar-background-start}*/, #ddd /*{c-bar-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient( #f0f0f0 /*{c-bar-background-start}*/, #ddd /*{c-bar-background-end}*/); } - .ui-bar-c .ui-link-inherit { color: #3E3E3E /*{c-bar-color}*/; } @@ -314,19 +296,15 @@ color: #7cc4e7 /*{c-bar-link-color}*/; font-weight: bold; } - .ui-bar-c .ui-link:hover { color: #2489CE /*{c-bar-link-hover}*/; } - .ui-bar-c .ui-link:active { color: #2489CE /*{c-bar-link-active}*/; } - .ui-bar-c .ui-link:visited { color: #2489CE /*{c-bar-link-visited}*/; } - .ui-bar-c, .ui-bar-c input, .ui-bar-c select, @@ -335,17 +313,21 @@ font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/; } .ui-body-c, -.ui-dialog.ui-overlay-c { - border: 1px solid #B3B3B3 /*{c-body-border}*/; +.ui-overlay-c { + border: 1px solid #aaa /*{c-body-border}*/; color: #333333 /*{c-body-color}*/; text-shadow: 0 /*{c-body-shadow-x}*/ 1px /*{c-body-shadow-y}*/ 0 /*{c-body-shadow-radius}*/ #fff /*{c-body-shadow-color}*/; - background: #f0f0f0 /*{c-body-background-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #eee /*{c-body-background-start}*/), to( #ddd /*{c-body-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient(#eee /*{c-body-background-start}*/, #ddd /*{c-body-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient(#eee /*{c-body-background-start}*/, #ddd /*{c-body-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient(#eee /*{c-body-background-start}*/, #ddd /*{c-body-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient(#eee /*{c-body-background-start}*/, #ddd /*{c-body-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient(#eee /*{c-body-background-start}*/, #ddd /*{c-body-background-end}*/); + background: #f9f9f9 /*{c-body-background-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from( #f9f9f9 /*{c-body-background-start}*/), to( #eeeeee /*{c-body-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient( #f9f9f9 /*{c-body-background-start}*/, #eeeeee /*{c-body-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient( #f9f9f9 /*{c-body-background-start}*/, #eeeeee /*{c-body-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient( #f9f9f9 /*{c-body-background-start}*/, #eeeeee /*{c-body-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient( #f9f9f9 /*{c-body-background-start}*/, #eeeeee /*{c-body-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient( #f9f9f9 /*{c-body-background-start}*/, #eeeeee /*{c-body-background-end}*/); +} +.ui-overlay-c { + background-image: none; + border-width: 0; } .ui-body-c, .ui-body-c input, @@ -354,73 +336,66 @@ .ui-body-c button { font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/; } - .ui-body-c .ui-link-inherit { color: #333333 /*{c-body-color}*/; } - .ui-body-c .ui-link { color: #2489CE /*{c-body-link-color}*/; font-weight: bold; } - .ui-body-c .ui-link:hover { color: #2489CE /*{c-body-link-hover}*/; } - .ui-body-c .ui-link:active { color: #2489CE /*{c-body-link-active}*/; } - .ui-body-c .ui-link:visited { color: #2489CE /*{c-body-link-visited}*/; } - .ui-btn-up-c { border: 1px solid #ccc /*{c-bup-border}*/; background: #eee /*{c-bup-background-color}*/; font-weight: bold; - color: #444 /*{c-bup-color}*/; - text-shadow: 0 /*{c-bup-shadow-x}*/ 1px /*{c-bup-shadow-y}*/ 1px /*{c-bup-shadow-radius}*/ #f6f6f6 /*{c-bup-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #fdfdfd /*{c-bup-background-start}*/), to( #eee /*{c-bup-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient(#fdfdfd /*{c-bup-background-start}*/, #eee /*{c-bup-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient(#fdfdfd /*{c-bup-background-start}*/, #eee /*{c-bup-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient(#fdfdfd /*{c-bup-background-start}*/, #eee /*{c-bup-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient(#fdfdfd /*{c-bup-background-start}*/, #eee /*{c-bup-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient(#fdfdfd /*{c-bup-background-start}*/, #eee /*{c-bup-background-end}*/); + color: #222 /*{c-bup-color}*/; + text-shadow: 0 /*{c-bup-shadow-x}*/ 1px /*{c-bup-shadow-y}*/ 0 /*{c-bup-shadow-radius}*/ #ffffff /*{c-bup-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from( #ffffff /*{c-bup-background-start}*/), to( #f1f1f1 /*{c-bup-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient( #ffffff /*{c-bup-background-start}*/, #f1f1f1 /*{c-bup-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient( #ffffff /*{c-bup-background-start}*/, #f1f1f1 /*{c-bup-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient( #ffffff /*{c-bup-background-start}*/, #f1f1f1 /*{c-bup-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient( #ffffff /*{c-bup-background-start}*/, #f1f1f1 /*{c-bup-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient( #ffffff /*{c-bup-background-start}*/, #f1f1f1 /*{c-bup-background-end}*/); } .ui-btn-up-c a.ui-link-inherit { color: #2F3E46 /*{c-bup-color}*/; } - .ui-btn-hover-c { - border: 1px solid #bbbbbb /*{c-bhover-border}*/; - background: #dadada /*{c-bhover-background-color}*/; + border: 1px solid #bbb /*{c-bhover-border}*/; + background: #dfdfdf /*{c-bhover-background-color}*/; font-weight: bold; - color: #101010 /*{c-bhover-color}*/; - text-shadow: 0 /*{c-bhover-shadow-x}*/ 1px /*{c-bhover-shadow-y}*/ 1px /*{c-bhover-shadow-radius}*/ #fff /*{c-bhover-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #ededed /*{c-bhover-background-start}*/), to( #dadada /*{c-bhover-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient(#ededed /*{c-bhover-background-start}*/, #dadada /*{c-bhover-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient(#ededed /*{c-bhover-background-start}*/, #dadada /*{c-bhover-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient(#ededed /*{c-bhover-background-start}*/, #dadada /*{c-bhover-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient(#ededed /*{c-bhover-background-start}*/, #dadada /*{c-bhover-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient(#ededed /*{c-bhover-background-start}*/, #dadada /*{c-bhover-background-end}*/); + color: #222 /*{c-bhover-color}*/; + text-shadow: 0 /*{c-bhover-shadow-x}*/ 1px /*{c-bhover-shadow-y}*/ 0 /*{c-bhover-shadow-radius}*/ #ffffff /*{c-bhover-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from( #f6f6f6 /*{c-bhover-background-start}*/), to( #e0e0e0 /*{c-bhover-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient( #f9f9f9 /*{c-bhover-background-start}*/, #e0e0e0 /*{c-bhover-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient( #f6f6f6 /*{c-bhover-background-start}*/, #e0e0e0 /*{c-bhover-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient( #f6f6f6 /*{c-bhover-background-start}*/, #e0e0e0 /*{c-bhover-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient( #f6f6f6 /*{c-bhover-background-start}*/, #e0e0e0 /*{c-bhover-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient( #f6f6f6 /*{c-bhover-background-start}*/, #e0e0e0 /*{c-bhover-background-end}*/); } .ui-btn-hover-c a.ui-link-inherit { color: #2F3E46 /*{c-bhover-color}*/; } .ui-btn-down-c { - border: 1px solid #808080 /*{c-bdown-border}*/; - background: #fdfdfd /*{c-bdown-background-color}*/; + border: 1px solid #bbb /*{c-bdown-border}*/; + background: #d6d6d6 /*{c-bdown-background-color}*/; font-weight: bold; - color: #111111 /*{c-bdown-color}*/; - text-shadow: 0 /*{c-bdown-shadow-x}*/ 1px /*{c-bdown-shadow-y}*/ 1px /*{c-bdown-shadow-radius}*/ #ffffff /*{c-bdown-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #eee /*{c-bdown-background-start}*/), to( #fdfdfd /*{c-bdown-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient(#eee /*{c-bdown-background-start}*/, #fdfdfd /*{c-bdown-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient(#eee /*{c-bdown-background-start}*/, #fdfdfd /*{c-bdown-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient(#eee /*{c-bdown-background-start}*/, #fdfdfd /*{c-bdown-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient(#eee /*{c-bdown-background-start}*/, #fdfdfd /*{c-bdown-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient(#eee /*{c-bdown-background-start}*/, #fdfdfd /*{c-bdown-background-end}*/); + color: #222 /*{c-bdown-color}*/; + text-shadow: 0 /*{c-bdown-shadow-x}*/ 1px /*{c-bdown-shadow-y}*/ 0 /*{c-bdown-shadow-radius}*/ #ffffff /*{c-bdown-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from( #d0d0d0 /*{c-bdown-background-start}*/), to( #dfdfdf /*{c-bdown-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient( #d0d0d0 /*{c-bdown-background-start}*/, #dfdfdf /*{c-bdown-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient( #d0d0d0 /*{c-bdown-background-start}*/, #dfdfdf /*{c-bdown-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient( #d0d0d0 /*{c-bdown-background-start}*/, #dfdfdf /*{c-bdown-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient( #d0d0d0 /*{c-bdown-background-start}*/, #dfdfdf /*{c-bdown-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient( #d0d0d0 /*{c-bdown-background-start}*/, #dfdfdf /*{c-bdown-background-end}*/); } .ui-btn-down-c a.ui-link-inherit { color: #2F3E46 /*{c-bdown-color}*/; @@ -431,22 +406,19 @@ font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/; text-decoration: none; } - - /* D -----------------------------------------------------------------------------------------------------------*/ - .ui-bar-d { - border: 1px solid #ccc /*{d-bar-border}*/; + border: 1px solid #bbb /*{d-bar-border}*/; background: #bbb /*{d-bar-background-color}*/; color: #333 /*{d-bar-color}*/; text-shadow: 0 /*{d-bar-shadow-x}*/ 1px /*{d-bar-shadow-y}*/ 0 /*{d-bar-shadow-radius}*/ #eee /*{d-bar-shadow-color}*/; background-image: -webkit-gradient(linear, left top, left bottom, from( #ddd /*{d-bar-background-start}*/), to( #bbb /*{d-bar-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient(#ddd /*{d-bar-background-start}*/, #bbb /*{d-bar-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient(#ddd /*{d-bar-background-start}*/, #bbb /*{d-bar-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient(#ddd /*{d-bar-background-start}*/, #bbb /*{d-bar-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient(#ddd /*{d-bar-background-start}*/, #bbb /*{d-bar-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient(#ddd /*{d-bar-background-start}*/, #bbb /*{d-bar-background-end}*/); + background-image: -webkit-linear-gradient( #ddd /*{d-bar-background-start}*/, #bbb /*{d-bar-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient( #ddd /*{d-bar-background-start}*/, #bbb /*{d-bar-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient( #ddd /*{d-bar-background-start}*/, #bbb /*{d-bar-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient( #ddd /*{d-bar-background-start}*/, #bbb /*{d-bar-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient( #ddd /*{d-bar-background-start}*/, #bbb /*{d-bar-background-end}*/); } .ui-bar-d, .ui-bar-d input, @@ -455,7 +427,6 @@ .ui-bar-d button { font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/; } - .ui-bar-d .ui-link-inherit { color: #333333 /*{d-bar-color}*/; } @@ -463,31 +434,31 @@ color: #2489CE /*{d-bar-link-color}*/; font-weight: bold; } - .ui-bar-d .ui-link:hover { color: #2489CE /*{d-bar-link-hover}*/; } - .ui-bar-d .ui-link:active { color: #2489CE /*{d-bar-link-active}*/; } - .ui-bar-d .ui-link:visited { color: #2489CE /*{d-bar-link-visited}*/; } - .ui-body-d, -.ui-dialog.ui-overlay-d { - border: 1px solid #ccc /*{d-body-border}*/; +.ui-overlay-d { + border: 1px solid #bbb /*{d-body-border}*/; color: #333333 /*{d-body-color}*/; text-shadow: 0 /*{d-body-shadow-x}*/ 1px /*{d-body-shadow-y}*/ 0 /*{d-body-shadow-radius}*/ #fff /*{d-body-shadow-color}*/; background: #ffffff /*{d-body-background-color}*/; background-image: -webkit-gradient(linear, left top, left bottom, from( #fff), to( #fff /*{d-body-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient(#fff /*{d-body-background-start}*/, #fff /*{d-body-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient(#fff /*{d-body-background-start}*/, #fff /*{d-body-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient(#fff /*{d-body-background-start}*/, #fff /*{d-body-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient(#fff /*{d-body-background-start}*/, #fff /*{d-body-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient(#fff /*{d-body-background-start}*/, #fff /*{d-body-background-end}*/); + background-image: -webkit-linear-gradient( #fff /*{d-body-background-start}*/, #fff /*{d-body-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient( #fff /*{d-body-background-start}*/, #fff /*{d-body-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient( #fff /*{d-body-background-start}*/, #fff /*{d-body-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient( #fff /*{d-body-background-start}*/, #fff /*{d-body-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient( #fff /*{d-body-background-start}*/, #fff /*{d-body-background-end}*/); +} +.ui-overlay-d { + background-image: none; + border-width: 0; } .ui-body-d, .ui-body-d input, @@ -496,40 +467,34 @@ .ui-body-d button { font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/; } - .ui-body-d .ui-link-inherit { color: #333333 /*{d-body-color}*/; } - .ui-body-d .ui-link { color: #2489CE /*{d-body-link-color}*/; font-weight: bold; } - .ui-body-d .ui-link:hover { color: #2489CE /*{d-body-link-hover}*/; } - .ui-body-d .ui-link:active { color: #2489CE /*{d-body-link-active}*/; } - .ui-body-d .ui-link:visited { color: #2489CE /*{d-body-link-visited}*/; } - .ui-btn-up-d { - border: 1px solid #ccc /*{d-bup-border}*/; + border: 1px solid #bbb /*{d-bup-border}*/; background: #fff /*{d-bup-background-color}*/; font-weight: bold; - color: #444 /*{d-bup-color}*/; - text-shadow: 0 /*{d-bup-shadow-x}*/ 1px /*{d-bup-shadow-y}*/ 1px /*{d-bup-shadow-radius}*/ #fff /*{d-bup-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #fff), to( #fff /*{d-bup-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient(#fff /*{d-bup-background-start}*/, #fff /*{d-bup-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient(#fff /*{d-bup-background-start}*/, #fff /*{d-bup-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient(#fff /*{d-bup-background-start}*/, #fff /*{d-bup-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient(#fff /*{d-bup-background-start}*/, #fff /*{d-bup-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient(#fff /*{d-bup-background-start}*/, #fff /*{d-bup-background-end}*/); + color: #333 /*{d-bup-color}*/; + text-shadow: 0 /*{d-bup-shadow-x}*/ 1px /*{d-bup-shadow-y}*/ 0 /*{d-bup-shadow-radius}*/ #fff /*{d-bup-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from( #fafafa), to( #f6f6f6 /*{d-bup-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient( #fafafa /*{d-bup-background-start}*/, #f6f6f6 /*{d-bup-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient( #fafafa /*{d-bup-background-start}*/, #f6f6f6 /*{d-bup-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient( #fafafa /*{d-bup-background-start}*/, #f6f6f6 /*{d-bup-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient( #fafafa /*{d-bup-background-start}*/, #f6f6f6 /*{d-bup-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient( #fafafa /*{d-bup-background-start}*/, #f6f6f6 /*{d-bup-background-end}*/); } .ui-btn-up-d a.ui-link-inherit { color: #333 /*{d-bup-color}*/; @@ -538,34 +503,34 @@ border: 1px solid #aaa /*{d-bhover-border}*/; background: #eeeeee /*{d-bhover-background-color}*/; font-weight: bold; - color: #222 /*{d-bhover-color}*/; + color: #333 /*{d-bhover-color}*/; cursor: pointer; - text-shadow: 0 /*{d-bhover-shadow-x}*/ 1px /*{d-bhover-shadow-y}*/ 1px /*{d-bhover-shadow-radius}*/ #fff /*{d-bhover-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #fdfdfd), to( #eee /*{d-bhover-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient(#fdfdfd /*{d-bhover-background-start}*/, #eee /*{d-bhover-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient(#fdfdfd /*{d-bhover-background-start}*/, #eee /*{d-bhover-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient(#fdfdfd /*{d-bhover-background-start}*/, #eee /*{d-bhover-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient(#fdfdfd /*{d-bhover-background-start}*/, #eee /*{d-bhover-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient(#fdfdfd /*{d-bhover-background-start}*/, #eee /*{d-bhover-background-end}*/); + text-shadow: 0 /*{d-bhover-shadow-x}*/ 1px /*{d-bhover-shadow-y}*/ 0 /*{d-bhover-shadow-radius}*/ #fff /*{d-bhover-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from( #eee), to( #fff /*{d-bhover-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient( #eee /*{d-bhover-background-start}*/, #fff /*{d-bhover-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient( #eee /*{d-bhover-background-start}*/, #fff /*{d-bhover-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient( #eee /*{d-bhover-background-start}*/, #fff /*{d-bhover-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient( #eee /*{d-bhover-background-start}*/, #fff /*{d-bhover-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient( #eee /*{d-bhover-background-start}*/, #fff /*{d-bhover-background-end}*/); } .ui-btn-hover-d a.ui-link-inherit { - color: #222 /*{d-bhover-color}*/; + color: #333 /*{d-bhover-color}*/; } .ui-btn-down-d { - border: 1px solid #aaaaaa /*{d-bdown-border}*/; - background: #ffffff /*{d-bdown-background-color}*/; + border: 1px solid #aaa /*{d-bdown-border}*/; + background: #eee /*{d-bdown-background-color}*/; font-weight: bold; - color: #111 /*{d-bdown-color}*/; - text-shadow: 0 /*{d-bdown-shadow-x}*/ 1px /*{d-bdown-shadow-y}*/ 1px /*{d-bdown-shadow-radius}*/ #ffffff /*{d-bdown-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #eee /*{d-bdown-background-start}*/), to( #fff /*{d-bdown-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient(#eee /*{d-bdown-background-start}*/, #fff /*{d-bdown-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient(#eee /*{d-bdown-background-start}*/, #fff /*{d-bdown-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient(#eee /*{d-bdown-background-start}*/, #fff /*{d-bdown-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient(#eee /*{d-bdown-background-start}*/, #fff /*{d-bdown-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient(#eee /*{d-bdown-background-start}*/, #fff /*{d-bdown-background-end}*/); + color: #333 /*{d-bdown-color}*/; + text-shadow: 0 /*{d-bdown-shadow-x}*/ 1px /*{d-bdown-shadow-y}*/ 0 /*{d-bdown-shadow-radius}*/ #ffffff /*{d-bdown-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from( #e5e5e5 /*{d-bdown-background-start}*/), to( #f2f2f2 /*{d-bdown-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient( #e5e5e5 /*{d-bdown-background-start}*/, #f2f2f2 /*{d-bdown-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient( #e5e5e5 /*{d-bdown-background-start}*/, #f2f2f2 /*{d-bdown-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient( #e5e5e5 /*{d-bdown-background-start}*/, #f2f2f2 /*{d-bdown-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient( #e5e5e5 /*{d-bdown-background-start}*/, #f2f2f2 /*{d-bdown-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient( #e5e5e5 /*{d-bdown-background-start}*/, #f2f2f2 /*{d-bdown-background-end}*/); } .ui-btn-down-d a.ui-link-inherit { - color: #111 /*{d-bdown-color}*/; + color: #333 /*{d-bdown-color}*/; } .ui-btn-up-d, .ui-btn-hover-d, @@ -573,22 +538,19 @@ font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/; text-decoration: none; } - - /* E -----------------------------------------------------------------------------------------------------------*/ - .ui-bar-e { border: 1px solid #F7C942 /*{e-bar-border}*/; background: #fadb4e /*{e-bar-background-color}*/; color: #333 /*{e-bar-color}*/; text-shadow: 0 /*{e-bar-shadow-x}*/ 1px /*{e-bar-shadow-y}*/ 0 /*{e-bar-shadow-radius}*/ #fff /*{e-bar-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #fceda7 /*{e-bar-background-start}*/), to( #fadb4e /*{e-bar-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient(#fceda7 /*{e-bar-background-start}*/, #fadb4e /*{e-bar-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient(#fceda7 /*{e-bar-background-start}*/, #fadb4e /*{e-bar-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient(#fceda7 /*{e-bar-background-start}*/, #fadb4e /*{e-bar-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient(#fceda7 /*{e-bar-background-start}*/, #fadb4e /*{e-bar-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient(#fceda7 /*{e-bar-background-start}*/, #fadb4e /*{e-bar-background-end}*/); + background-image: -webkit-gradient(linear, left top, left bottom, from( #fceda7 /*{e-bar-background-start}*/), to( #fbef7e /*{e-bar-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient( #fceda7 /*{e-bar-background-start}*/, #fbef7e /*{e-bar-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient( #fceda7 /*{e-bar-background-start}*/, #fbef7e /*{e-bar-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient( #fceda7 /*{e-bar-background-start}*/, #fbef7e /*{e-bar-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient( #fceda7 /*{e-bar-background-start}*/, #fbef7e /*{e-bar-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient( #fceda7 /*{e-bar-background-start}*/, #fbef7e /*{e-bar-background-end}*/); } .ui-bar-e, .ui-bar-e input, @@ -604,31 +566,31 @@ color: #2489CE /*{e-bar-link-color}*/; font-weight: bold; } - .ui-bar-e .ui-link:hover { color: #2489CE /*{e-bar-link-hover}*/; } - .ui-bar-e .ui-link:active { color: #2489CE /*{e-bar-link-active}*/; } - .ui-bar-e .ui-link:visited { color: #2489CE /*{e-bar-link-visited}*/; } - .ui-body-e, -.ui-dialog.ui-overlay-e { +.ui-overlay-e { border: 1px solid #F7C942 /*{e-body-border}*/; - color: #333333 /*{e-body-color}*/; + color: #222222 /*{e-body-color}*/; text-shadow: 0 /*{e-body-shadow-x}*/ 1px /*{e-body-shadow-y}*/ 0 /*{e-body-shadow-radius}*/ #fff /*{e-body-shadow-color}*/; - background: #faeb9e /*{e-body-background-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #fff /*{e-body-background-start}*/), to( #faeb9e /*{e-body-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient(#fff /*{e-body-background-start}*/, #faeb9e /*{e-body-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient(#fff /*{e-body-background-start}*/, #faeb9e /*{e-body-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient(#fff /*{e-body-background-start}*/, #faeb9e /*{e-body-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient(#fff /*{e-body-background-start}*/, #faeb9e /*{e-body-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient(#fff /*{e-body-background-start}*/, #faeb9e /*{e-body-background-end}*/); + background: #fff9df /*{e-body-background-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from( #fffadf /*{e-body-background-start}*/), to( #fff3a5 /*{e-body-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient( #fffadf /*{e-body-background-start}*/, #fff3a5 /*{e-body-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient( #fffadf /*{e-body-background-start}*/, #fff3a5 /*{e-body-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient( #fffadf /*{e-body-background-start}*/, #fff3a5 /*{e-body-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient( #fffadf /*{e-body-background-start}*/, #fff3a5 /*{e-body-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient( #fffadf /*{e-body-background-start}*/, #fff3a5 /*{e-body-background-end}*/); +} +.ui-overlay-e { + background-image: none; + border-width: 0; } .ui-body-e, .ui-body-e input, @@ -640,69 +602,63 @@ .ui-body-e .ui-link-inherit { color: #333333 /*{e-body-color}*/; } - .ui-body-e .ui-link { color: #2489CE /*{e-body-link-color}*/; font-weight: bold; } - .ui-body-e .ui-link:hover { color: #2489CE /*{e-body-link-hover}*/; } - .ui-body-e .ui-link:active { color: #2489CE /*{e-body-link-active}*/; } - .ui-body-e .ui-link:visited { color: #2489CE /*{e-body-link-visited}*/; } - .ui-btn-up-e { - border: 1px solid #F7C942 /*{e-bup-border}*/; + border: 1px solid #F4C63f /*{e-bup-border}*/; background: #fadb4e /*{e-bup-background-color}*/; font-weight: bold; - color: #333 /*{e-bup-color}*/; + color: #222 /*{e-bup-color}*/; text-shadow: 0 /*{e-bup-shadow-x}*/ 1px /*{e-bup-shadow-y}*/ 0 /*{e-bup-shadow-radius}*/ #fff /*{e-bup-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #fceda7 /*{e-bup-background-start}*/), to( #fadb4e /*{e-bup-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient(#fceda7 /*{e-bup-background-start}*/, #fadb4e /*{e-bup-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient(#fceda7 /*{e-bup-background-start}*/, #fadb4e /*{e-bup-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient(#fceda7 /*{e-bup-background-start}*/, #fadb4e /*{e-bup-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient(#fceda7 /*{e-bup-background-start}*/, #fadb4e /*{e-bup-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient(#fceda7 /*{e-bup-background-start}*/, #fadb4e /*{e-bup-background-end}*/); + background-image: -webkit-gradient(linear, left top, left bottom, from( #ffefaa /*{e-bup-background-start}*/), to( #ffe155 /*{e-bup-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient( #ffefaa /*{e-bup-background-start}*/, #ffe155 /*{e-bup-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient( #ffefaa /*{e-bup-background-start}*/, #ffe155 /*{e-bup-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient( #ffefaa /*{e-bup-background-start}*/, #ffe155 /*{e-bup-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient( #ffefaa /*{e-bup-background-start}*/, #ffe155 /*{e-bup-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient( #ffefaa /*{e-bup-background-start}*/, #ffe155 /*{e-bup-background-end}*/); } .ui-btn-up-e a.ui-link-inherit { - color: #333 /*{e-bup-color}*/; + color: #222 /*{e-bup-color}*/; } .ui-btn-hover-e { - border: 1px solid #e79952 /*{e-bhover-border}*/; + border: 1px solid #F2C43d /*{e-bhover-border}*/; background: #fbe26f /*{e-bhover-background-color}*/; font-weight: bold; color: #111 /*{e-bhover-color}*/; - text-shadow: 0 /*{e-bhover-shadow-x}*/ 1px /*{e-bhover-shadow-y}*/ 1px /*{e-bhover-shadow-radius}*/ #fff /*{e-bhover-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #fcf0b5 /*{e-bhover-background-start}*/), to( #fbe26f /*{e-bhover-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient(#fcf0b5 /*{e-bhover-background-start}*/, #fbe26f /*{e-bhover-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient(#fcf0b5 /*{e-bhover-background-start}*/, #fbe26f /*{e-bhover-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient(#fcf0b5 /*{e-bhover-background-start}*/, #fbe26f /*{e-bhover-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient(#fcf0b5 /*{e-bhover-background-start}*/, #fbe26f /*{e-bhover-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient(#fcf0b5 /*{e-bhover-background-start}*/, #fbe26f /*{e-bhover-background-end}*/); + text-shadow: 0 /*{e-bhover-shadow-x}*/ 1px /*{e-bhover-shadow-y}*/ 0 /*{e-bhover-shadow-radius}*/ #fff /*{e-bhover-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from( #fff5ba /*{e-bhover-background-start}*/), to( #fbdd52 /*{e-bhover-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient( #fff5ba /*{e-bhover-background-start}*/, #fbdd52 /*{e-bhover-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient( #fff5ba /*{e-bhover-background-start}*/, #fbdd52 /*{e-bhover-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient( #fff5ba /*{e-bhover-background-start}*/, #fbdd52 /*{e-bhover-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient( #fff5ba /*{e-bhover-background-start}*/, #fbdd52 /*{e-bhover-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient( #fff5ba /*{e-bhover-background-start}*/, #fbdd52 /*{e-bhover-background-end}*/); } - .ui-btn-hover-e a.ui-link-inherit { color: #333 /*{e-bhover-color}*/; } .ui-btn-down-e { - border: 1px solid #F7C942 /*{e-bdown-border}*/; + border: 1px solid #F2C43d /*{e-bdown-border}*/; background: #fceda7 /*{e-bdown-background-color}*/; font-weight: bold; color: #111 /*{e-bdown-color}*/; - text-shadow: 0 /*{e-bdown-shadow-x}*/ 1px /*{e-bdown-shadow-y}*/ 1px /*{e-bdown-shadow-radius}*/ #ffffff /*{e-bdown-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #fadb4e /*{e-bdown-background-start}*/), to( #fceda7 /*{e-bdown-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient(#fadb4e /*{e-bdown-background-start}*/, #fceda7 /*{e-bdown-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient(#fadb4e /*{e-bdown-background-start}*/, #fceda7 /*{e-bdown-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient(#fadb4e /*{e-bdown-background-start}*/, #fceda7 /*{e-bdown-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient(#fadb4e /*{e-bdown-background-start}*/, #fceda7 /*{e-bdown-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient(#fadb4e /*{e-bdown-background-start}*/, #fceda7 /*{e-bdown-background-end}*/); + text-shadow: 0 /*{e-bdown-shadow-x}*/ 1px /*{e-bdown-shadow-y}*/ 0 /*{e-bdown-shadow-radius}*/ #ffffff /*{e-bdown-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from( #f8d94c /*{e-bdown-background-start}*/), to( #fadb4e /*{e-bdown-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient( #f8d94c /*{e-bdown-background-start}*/, #fadb4e /*{e-bdown-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient( #f8d94c /*{e-bdown-background-start}*/, #fadb4e /*{e-bdown-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient( #f8d94c /*{e-bdown-background-start}*/, #fadb4e /*{e-bdown-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient( #f8d94c /*{e-bdown-background-start}*/, #fadb4e /*{e-bdown-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient( #f8d94c /*{e-bdown-background-start}*/, #fadb4e /*{e-bdown-background-end}*/); } .ui-btn-down-e a.ui-link-inherit { color: #333 /*{e-bdown-color}*/; @@ -713,53 +669,41 @@ font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/; text-decoration: none; } - /* Structure */ - /* links within "buttons" -----------------------------------------------------------------------------------------------------------*/ - a.ui-link-inherit { text-decoration: none !important; } - - /* Active class used as the "on" state across all themes -----------------------------------------------------------------------------------------------------------*/ - .ui-btn-active { - border: 1px solid #155678 /*{global-active-border}*/; - background: #4596ce /*{global-active-background-color}*/; + border: 1px solid #2373a5 /*{global-active-border}*/; + background: #5393c5 /*{global-active-background-color}*/; font-weight: bold; color: #fff /*{global-active-color}*/; cursor: pointer; - text-shadow: 0 /*{global-active-shadow-x}*/ -1px /*{global-active-shadow-y}*/ 1px /*{global-active-shadow-radius}*/ #145072 /*{global-active-shadow-color}*/; + text-shadow: 0 /*{global-active-shadow-x}*/ 1px /*{global-active-shadow-y}*/ 1px /*{global-active-shadow-radius}*/ #3373a5 /*{global-active-shadow-color}*/; text-decoration: none; - background-image: -webkit-gradient(linear, left top, left bottom, from( #85bae4 /*{global-active-background-start}*/), to( #5393c5 /*{global-active-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient(#85bae4 /*{global-active-background-start}*/, #5393c5 /*{global-active-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient(#85bae4 /*{global-active-background-start}*/, #5393c5 /*{global-active-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient(#85bae4 /*{global-active-background-start}*/, #5393c5 /*{global-active-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient(#85bae4 /*{global-active-background-start}*/, #5393c5 /*{global-active-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient(#85bae4 /*{global-active-background-start}*/, #5393c5 /*{global-active-background-end}*/); + background-image: -webkit-gradient(linear, left top, left bottom, from( #5393c5 /*{global-active-background-start}*/), to( #6facd5 /*{global-active-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient( #5393c5 /*{global-active-background-start}*/, #6facd5 /*{global-active-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient( #5393c5 /*{global-active-background-start}*/, #6facd5 /*{global-active-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient( #5393c5 /*{global-active-background-start}*/, #6facd5 /*{global-active-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient( #5393c5 /*{global-active-background-start}*/, #6facd5 /*{global-active-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient( #5393c5 /*{global-active-background-start}*/, #6facd5 /*{global-active-background-end}*/); font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/; } .ui-btn-active a.ui-link-inherit { color: #fff /*{global-active-color}*/; } - - /* button inner top highlight -----------------------------------------------------------------------------------------------------------*/ - .ui-btn-inner { border-top: 1px solid #fff; border-color: rgba(255,255,255,.3); } - - /* corner rounding classes -----------------------------------------------------------------------------------------------------------*/ - .ui-corner-tl { -moz-border-radius-topleft: .6em /*{global-radii-blocks}*/; -webkit-border-top-left-radius: .6em /*{global-radii-blocks}*/; @@ -822,7 +766,6 @@ a.ui-link-inherit { -webkit-border-radius: 0; border-radius: 0; } - /* Form field separator -----------------------------------------------------------------------------------------------------------*/ .ui-br { @@ -831,7 +774,6 @@ a.ui-link-inherit { border-bottom-width: 1px; border-bottom-style: solid; } - /* Interaction cues -----------------------------------------------------------------------------------------------------------*/ .ui-disabled { @@ -839,13 +781,16 @@ a.ui-link-inherit { } .ui-disabled, .ui-disabled a { + cursor: default !important; pointer-events: none; - cursor: default; } - +.ui-disabled .ui-btn-text { + -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=30)"; + filter: alpha(opacity=30); + zoom: 1; +} /* Icons -----------------------------------------------------------------------------------------------------------*/ - .ui-icon, .ui-icon-searchfield:after { background: #666 /*{global-icon-color}*/; @@ -856,25 +801,20 @@ a.ui-link-inherit { -webkit-border-radius: 9px; border-radius: 9px; } - - /* Alt icon color -----------------------------------------------------------------------------------------------------------*/ - .ui-icon-alt { background: #fff; background: rgba(255,255,255,.3); background-image: url([[pix:theme|icons-18-black]]); background-repeat: no-repeat; } - /* HD/"retina" sprite -----------------------------------------------------------------------------------------------------------*/ - @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (min-resolution: 240dpi) { - + .ui-icon-plus, .ui-icon-minus, .ui-icon-delete, .ui-icon-arrow-r, .ui-icon-arrow-l, .ui-icon-arrow-u, .ui-icon-arrow-d, .ui-icon-check, .ui-icon-gear, .ui-icon-refresh, .ui-icon-forward, .ui-icon-back, @@ -890,7 +830,6 @@ a.ui-link-inherit { background-image: url([[pix:theme|icons-36-black]]); } } - /* plus minus */ .ui-icon-plus { background-position: -0 50%; @@ -898,12 +837,10 @@ a.ui-link-inherit { .ui-icon-minus { background-position: -36px 50%; } - /* delete/close */ .ui-icon-delete { background-position: -72px 50%; } - /* arrows */ .ui-icon-arrow-r { background-position: -108px 50%; @@ -917,7 +854,6 @@ a.ui-link-inherit { .ui-icon-arrow-d { background-position: -216px 50%; } - /* misc */ .ui-icon-check { background-position: -252px 50%; @@ -965,8 +901,6 @@ a.ui-link-inherit { .ui-icon-radio-on { background-position: -720px 50%; } - - /* checks,radios */ .ui-checkbox .ui-icon { -moz-border-radius: 3px; @@ -975,28 +909,19 @@ a.ui-link-inherit { } .ui-icon-checkbox-off, .ui-icon-radio-off { - background-color: transparent; + background-color: transparent; } .ui-checkbox-on .ui-icon, .ui-radio-on .ui-icon { background-color: #4596ce /*{global-active-background-color}*/; /* NOTE: this hex should match the active state color. It's repeated here for cascade */ } - /* loading icon */ .ui-icon-loading { - background-image: url([[pix:theme|ajax-loader]]); - width: 40px; - height: 40px; - -moz-border-radius: 20px; - -webkit-border-radius: 20px; - border-radius: 20px; - background-size: 35px 35px; + background: url([[pix:theme|ajax-loader2]]); + background-size: 46px 46px; } - - /* Button corner classes -----------------------------------------------------------------------------------------------------------*/ - .ui-btn-corner-tl { -moz-border-radius-topleft: 1em /*{global-radii-buttons}*/; -webkit-border-top-left-radius: 1em /*{global-radii-buttons}*/; @@ -1054,7 +979,6 @@ a.ui-link-inherit { -webkit-border-radius: 1em /*{global-radii-buttons}*/; border-radius: 1em /*{global-radii-buttons}*/; } - /* radius clip workaround for cleaning up corner trapping */ .ui-corner-tl, .ui-corner-tr, @@ -1078,10 +1002,8 @@ a.ui-link-inherit { -moz-background-clip: padding; background-clip: padding-box; } - /* Overlay / modal -----------------------------------------------------------------------------------------------------------*/ - .ui-overlay { background: #666; opacity: .5; @@ -1113,51 +1035,48 @@ a.ui-link-inherit { box-shadow: inset 0px 1px 4px rgba(0,0,0,.2); } .ui-icon-shadow { - -moz-box-shadow: 0px 1px 0 rgba(255,255,255,.4); - -webkit-box-shadow: 0px 1px 0 rgba(255,255,255,.4); - box-shadow: 0px 1px 0 rgba(255,255,255,.4); + -moz-box-shadow: 0px 1px 0 rgba(255,255,255,.4) /*{global-icon-shadow}*/; + -webkit-box-shadow: 0px 1px 0 rgba(255,255,255,.4) /*{global-icon-shadow}*/; + box-shadow: 0px 1px 0 rgba(255,255,255,.4) /*{global-icon-shadow}*/; } - -/* Focus state - set here for specificity +/* Focus state - set here for specificity (note: these classes are added by JavaScript) -----------------------------------------------------------------------------------------------------------*/ - -.ui-focus { +.ui-btn:focus { + outline: 0; +} +.ui-focus, +.ui-btn:focus { -moz-box-shadow: 0px 0px 12px #387bbe /*{global-active-background-color}*/; -webkit-box-shadow: 0px 0px 12px #387bbe /*{global-active-background-color}*/; box-shadow: 0px 0px 12px #387bbe /*{global-active-background-color}*/; } - /* unset box shadow in browsers that don't do it right -----------------------------------------------------------------------------------------------------------*/ - .ui-mobile-nosupport-boxshadow * { -moz-box-shadow: none !important; -webkit-box-shadow: none !important; box-shadow: none !important; } - /* ...and bring back focus */ -.ui-mobile-nosupport-boxshadow .ui-focus { - outline-width: 2px; +.ui-mobile-nosupport-boxshadow .ui-focus, +.ui-mobile-nosupport-boxshadow .ui-btn:focus { + outline-width: 1px; + outline-style: dotted; } /* some unsets - more probably needed */ -.ui-mobile, .ui-mobile body { height: 100%; } +.ui-mobile, .ui-mobile body { height: 99.9%; } .ui-mobile fieldset, .ui-page { padding: 0; margin: 0; } -.ui-mobile a img, .ui-mobile fieldset { border: 0; } - +.ui-mobile a img, .ui-mobile fieldset { border-width: 0; } /* responsive page widths */ .ui-mobile-viewport { margin: 0; overflow-x: visible; -webkit-text-size-adjust: none; -ms-text-size-adjust:none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } /* Issue #2066 */ body.ui-mobile-viewport, div.ui-mobile-viewport { overflow-x: hidden; } - /* "page" containers - full-screen views, one should always be in view post-pageload */ .ui-mobile [data-role=page], .ui-mobile [data-role=dialog], .ui-page { top: 0; left: 0; width: 100%; min-height: 100%; position: absolute; display: none; border: 0; } .ui-mobile .ui-page-active { display: block; overflow: visible; } - /* on ios4, setting focus on the page element causes flashing during transitions when there is an outline, so we turn off outlines */ .ui-page { outline: none; } - /*orientations from js are available */ @media screen and (orientation: portrait){ .ui-mobile, .ui-mobile .ui-page { min-height: 420px; } @@ -1165,249 +1084,351 @@ div.ui-mobile-viewport { overflow-x: hidden; } @media screen and (orientation: landscape){ .ui-mobile, .ui-mobile .ui-page { min-height: 300px; } } - -/* native overflow scrolling */ -.ui-page.ui-mobile-touch-overflow, -.ui-mobile-touch-overflow.ui-native-fixed .ui-content { - overflow: auto; - height: 100%; - -webkit-overflow-scrolling: touch; - -moz-overflow-scrolling: touch; - -o-overflow-scrolling: touch; - -ms-overflow-scrolling: touch; - overflow-scrolling: touch; -} -.ui-page.ui-mobile-touch-overflow, -.ui-page.ui-mobile-touch-overflow * { - /* some level of transform keeps elements from blinking out of visibility on iOS */ - -webkit-transform: rotateY(0); -} -.ui-page.ui-mobile-pre-transition { - display: block; -} - /* loading screen */ -.ui-loading .ui-mobile-viewport { overflow: hidden !important; } .ui-loading .ui-loader { display: block; } -.ui-loading .ui-page { overflow: hidden; } -.ui-loader { display: none; position: absolute; opacity: .85; z-index: 100; left: 50%; width: 200px; margin-left: -130px; margin-top: -35px; padding: 10px 30px; } -.ui-loader h1 { font-size: 15px; text-align: center; } -.ui-loader .ui-icon { position: static; display: block; opacity: .9; margin: 0 auto; width: 35px; height: 35px; background-color: transparent; } - +.ui-loader { display: none; z-index: 9999999; position: fixed; top: 50%; box-shadow: 0 1px 1px -1px #fff; left: 50%; border:0; } +.ui-loader-default { background: none; opacity: .18; width: 46px; height: 46px; margin-left: -23px; margin-top: -23px; } +.ui-loader-verbose { width: 200px; opacity: .88; height: auto; margin-left: -110px; margin-top: -43px; padding: 10px; } +.ui-loader-default h1 { font-size: 0; width: 0; height: 0; overflow: hidden; } +.ui-loader-verbose h1 { font-size: 16px; margin: 0; text-align: center; } +.ui-loader .ui-icon { background-color: #000; display: block; margin: 0; width: 44px; height: 44px; padding: 1px; -webkit-border-radius: 36px; -moz-border-radius: 36px; border-radius: 36px; } +.ui-loader-verbose .ui-icon { margin: 0 auto 10px; opacity: .75; } +.ui-loader-textonly { padding: 15px; margin-left: -115px; } +.ui-loader-textonly .ui-icon { display: none; } +.ui-loader-fakefix { position: absolute; } /*fouc*/ .ui-mobile-rendering > * { visibility: hidden; } - /*headers, content panels*/ .ui-bar, .ui-body { position: relative; padding: .4em 15px; overflow: hidden; display: block; clear:both; } .ui-bar { font-size: 16px; margin: 0; } .ui-bar h1, .ui-bar h2, .ui-bar h3, .ui-bar h4, .ui-bar h5, .ui-bar h6 { margin: 0; padding: 0; font-size: 16px; display: inline-block; } - -.ui-header, .ui-footer { display: block; } -.ui-page .ui-header, .ui-page .ui-footer { position: relative; } -.ui-header .ui-btn-left { position: absolute; left: 10px; top: .4em; } -.ui-header .ui-btn-right { position: absolute; right: 10px; top: .4em; } -.ui-header .ui-title, .ui-footer .ui-title { min-height: 1.1em; text-align: center; font-size: 16px; display: block; margin: .6em 90px .8em; padding: 0; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; outline: 0 !important; } +.ui-header, .ui-footer { position: relative; border-left-width: 0; border-right-width: 0; } +.ui-header .ui-btn-left, +.ui-header .ui-btn-right, +.ui-footer .ui-btn-left, +.ui-footer .ui-btn-right { position: absolute; top: 3px; } +.ui-header .ui-btn-left, +.ui-footer .ui-btn-left { left: 5px; } +.ui-header .ui-btn-right, +.ui-footer .ui-btn-right { right: 5px; } +.ui-footer .ui-btn-icon-notext, +.ui-header .ui-btn-icon-notext { top: 6px; } +.ui-header .ui-title, .ui-footer .ui-title { min-height: 1.1em; text-align: center; font-size: 16px; display: block; margin: .6em 30% .8em; padding: 0; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; outline: 0 !important; } .ui-footer .ui-title { margin: .6em 15px .8em; } - /*content area*/ .ui-content { border-width: 0; overflow: visible; overflow-x: hidden; padding: 15px; } -.ui-page-fullscreen .ui-content { padding:0; } - -/* native fixed headers and footers */ -.ui-mobile-touch-overflow.ui-page.ui-native-fixed, -.ui-mobile-touch-overflow.ui-page.ui-native-fullscreen { - overflow: visible; -} -.ui-mobile-touch-overflow.ui-native-fixed .ui-header, -.ui-mobile-touch-overflow.ui-native-fixed .ui-footer { - position: fixed; - left: 0; - right: 0; - top: 0; - z-index: 200; -} -.ui-mobile-touch-overflow.ui-page.ui-native-fixed .ui-footer { - top: auto; - bottom: 0; -} -.ui-mobile-touch-overflow.ui-native-fixed .ui-content { - padding-top: 2.5em; - padding-bottom: 3em; - top: 0; - bottom: 0; - height: auto; - position: absolute; -} -.ui-mobile-touch-overflow.ui-native-fullscreen .ui-content { - padding-top: 0; - padding-bottom: 0; -} -.ui-mobile-touch-overflow.ui-native-fullscreen .ui-header, -.ui-mobile-touch-overflow.ui-native-fullscreen .ui-footer { - opacity: .9; -} -.ui-native-bars-hidden { - display: none; -} - /* icons sizing */ .ui-icon { width: 18px; height: 18px; } - -/* fullscreen class on ui-content div */ -.ui-fullscreen { } -.ui-fullscreen img { max-width: 100%; } - /* non-js content hiding */ .ui-nojs { position: absolute; left: -9999px; } - /* accessible content hiding */ .ui-hide-label label, .ui-hidden-accessible { position: absolute !important; left: -9999px; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } -.spin { - -webkit-transform: rotate(360deg); - -webkit-animation-name: spin; - -webkit-animation-duration: 1s; - -webkit-animation-iteration-count: infinite; - -webkit-animation-timing-function: linear; +/* Transitions originally inspired by those from jQtouch, nice work, folks */ +.ui-mobile-viewport-transitioning, +.ui-mobile-viewport-transitioning .ui-page { + width: 100%; + height: 100%; + overflow: hidden; } -@-webkit-keyframes spin { - from {-webkit-transform: rotate(0deg);} - to {-webkit-transform: rotate(360deg);} -} - -/* Transitions from jQtouch (with small modifications): http://www.jqtouch.com/ -Built by David Kaneda and maintained by Jonathan Stark. -*/ -.in, .out { - -webkit-animation-timing-function: ease-in-out; +.in { + -webkit-animation-timing-function: ease-out; -webkit-animation-duration: 350ms; + -moz-animation-timing-function: ease-out; + -moz-animation-duration: 350ms; } - - -.slide.out { - -webkit-transform: translateX(-100%); - -webkit-animation-name: slideouttoleft; -} - -.slide.in { - -webkit-transform: translateX(0); - -webkit-animation-name: slideinfromright; -} - -.slide.out.reverse { - -webkit-transform: translateX(100%); - -webkit-animation-name: slideouttoright; -} - -.slide.in.reverse { - -webkit-transform: translateX(0); - -webkit-animation-name: slideinfromleft; -} - -.slideup.out { - -webkit-animation-name: dontmove; - z-index: 0; -} - -.slideup.in { - -webkit-transform: translateY(0); - -webkit-animation-name: slideinfrombottom; - z-index: 10; -} - -.slideup.in.reverse { - z-index: 0; - -webkit-animation-name: dontmove; -} - -.slideup.out.reverse { - -webkit-transform: translateY(100%); - z-index: 10; - -webkit-animation-name: slideouttobottom; -} - -.slidedown.out { - -webkit-animation-name: dontmove; - z-index: 0; -} - -.slidedown.in { - -webkit-transform: translateY(0); - -webkit-animation-name: slideinfromtop; - z-index: 10; -} - -.slidedown.in.reverse { - z-index: 0; - -webkit-animation-name: dontmove; -} - -.slidedown.out.reverse { - -webkit-transform: translateY(-100%); - z-index: 10; - -webkit-animation-name: slideouttotop; -} - -@-webkit-keyframes slideinfromright { - from { -webkit-transform: translateX(100%); } - to { -webkit-transform: translateX(0); } -} - -@-webkit-keyframes slideinfromleft { - from { -webkit-transform: translateX(-100%); } - to { -webkit-transform: translateX(0); } -} - -@-webkit-keyframes slideouttoleft { - from { -webkit-transform: translateX(0); } - to { -webkit-transform: translateX(-100%); } -} - -@-webkit-keyframes slideouttoright { - from { -webkit-transform: translateX(0); } - to { -webkit-transform: translateX(100%); } -} - -@-webkit-keyframes slideinfromtop { - from { -webkit-transform: translateY(-100%); } - to { -webkit-transform: translateY(0); } -} - -@-webkit-keyframes slideinfrombottom { - from { -webkit-transform: translateY(100%); } - to { -webkit-transform: translateY(0); } -} - -@-webkit-keyframes slideouttobottom { - from { -webkit-transform: translateY(0); } - to { -webkit-transform: translateY(100%); } -} - -@-webkit-keyframes slideouttotop { - from { -webkit-transform: translateY(0); } - to { -webkit-transform: translateY(-100%); } +.out { + -webkit-animation-timing-function: ease-in; + -webkit-animation-duration: 225ms; + -moz-animation-timing-function: ease-in; + -moz-animation-duration: 225; } @-webkit-keyframes fadein { from { opacity: 0; } to { opacity: 1; } } - +@-moz-keyframes fadein { + from { opacity: 0; } + to { opacity: 1; } +} @-webkit-keyframes fadeout { from { opacity: 1; } to { opacity: 0; } } - +@-moz-keyframes fadeout { + from { opacity: 1; } + to { opacity: 0; } +} .fade.out { - z-index: 0; + opacity: 0; + -webkit-animation-duration: 125ms; -webkit-animation-name: fadeout; + -moz-animation-duration: 125ms; + -moz-animation-name: fadeout; } - .fade.in { opacity: 1; - z-index: 10; + -webkit-animation-duration: 225ms; -webkit-animation-name: fadein; + -moz-animation-duration: 225ms; + -moz-animation-name: fadein; +} +.pop { + -webkit-transform-origin: 50% 50%; + -moz-transform-origin: 50% 50%; +} +.pop.in { + -webkit-transform: scale(1); + -moz-transform: scale(1); + opacity: 1; + -webkit-animation-name: popin; + -moz-animation-name: popin; + -webkit-animation-duration: 350ms; + -moz-animation-duration: 350ms; +} +.pop.out { + -webkit-animation-name: fadeout; + -moz-animation-name: fadeout; + opacity: 0; + -webkit-animation-duration: 100ms; + -moz-animation-duration: 100ms; +} +.pop.in.reverse { + -webkit-animation-name: fadein; + -moz-animation-name: fadein; +} +.pop.out.reverse { + -webkit-transform: scale(.8); + -moz-transform: scale(.8); + -webkit-animation-name: popout; + -moz-animation-name: popout; +} +@-webkit-keyframes popin { + from { + -webkit-transform: scale(.8); + opacity: 0; + } + to { + -webkit-transform: scale(1); + opacity: 1; + } +} +@-moz-keyframes popin { + from { + -moz-transform: scale(.8); + opacity: 0; + } + to { + -moz-transform: scale(1); + opacity: 1; + } +} +@-webkit-keyframes popout { + from { + -webkit-transform: scale(1); + opacity: 1; + } + to { + -webkit-transform: scale(.8); + opacity: 0; + } +} +@-moz-keyframes popout { + from { + -moz-transform: scale(1); + opacity: 1; + } + to { + -moz-transform: scale(.8); + opacity: 0; + } +} +/* keyframes for slidein from sides */ +@-webkit-keyframes slideinfromright { + from { -webkit-transform: translateX(100%); } + to { -webkit-transform: translateX(0); } +} +@-moz-keyframes slideinfromright { + from { -moz-transform: translateX(100%); } + to { -moz-transform: translateX(0); } +} +@-webkit-keyframes slideinfromleft { + from { -webkit-transform: translateX(-100%); } + to { -webkit-transform: translateX(0); } +} +@-moz-keyframes slideinfromleft { + from { -moz-transform: translateX(-100%); } + to { -moz-transform: translateX(0); } +} +/* keyframes for slideout to sides */ +@-webkit-keyframes slideouttoleft { + from { -webkit-transform: translateX(0); } + to { -webkit-transform: translateX(-100%); } +} +@-moz-keyframes slideouttoleft { + from { -moz-transform: translateX(0); } + to { -moz-transform: translateX(-100%); } +} +@-webkit-keyframes slideouttoright { + from { -webkit-transform: translateX(0); } + to { -webkit-transform: translateX(100%); } +} +@-moz-keyframes slideouttoright { + from { -moz-transform: translateX(0); } + to { -moz-transform: translateX(100%); } +} +.slide.out, .slide.in { + -webkit-animation-timing-function: ease-out; + -webkit-animation-duration: 350ms; + -moz-animation-timing-function: ease-out; + -moz-animation-duration: 350ms; +} +.slide.out { + -webkit-transform: translateX(-100%); + -webkit-animation-name: slideouttoleft; + -moz-transform: translateX(-100%); + -moz-animation-name: slideouttoleft; +} +.slide.in { + -webkit-transform: translateX(0); + -webkit-animation-name: slideinfromright; + -moz-transform: translateX(0); + -moz-animation-name: slideinfromright; +} +.slide.out.reverse { + -webkit-transform: translateX(100%); + -webkit-animation-name: slideouttoright; + -moz-transform: translateX(100%); + -moz-animation-name: slideouttoright; +} +.slide.in.reverse { + -webkit-transform: translateX(0); + -webkit-animation-name: slideinfromleft; + -moz-transform: translateX(0); + -moz-animation-name: slideinfromleft; +} +.slidefade.out { + -webkit-transform: translateX(-100%); + -webkit-animation-name: slideouttoleft; + -moz-transform: translateX(-100%); + -moz-animation-name: slideouttoleft; + -webkit-animation-duration: 225ms; + -moz-animation-duration: 225ms; +} +.slidefade.in { + -webkit-transform: translateX(0); + -webkit-animation-name: fadein; + -moz-transform: translateX(0); + -moz-animation-name: fadein; + -webkit-animation-duration: 200ms; + -moz-animation-duration: 200ms; +} +.slidefade.out.reverse { + -webkit-transform: translateX(100%); + -webkit-animation-name: slideouttoright; + -moz-transform: translateX(100%); + -moz-animation-name: slideouttoright; + -webkit-animation-duration: 200ms; + -moz-animation-duration: 200ms; +} +.slidefade.in.reverse { + -webkit-transform: translateX(0); + -webkit-animation-name: fadein; + -moz-transform: translateX(0); + -moz-animation-name: fadein; + -webkit-animation-duration: 200ms; + -moz-animation-duration: 200ms; +} +/* slide down */ +.slidedown.out { + -webkit-animation-name: fadeout; + -moz-animation-name: fadeout; + -webkit-animation-duration: 100ms; + -moz-animation-duration: 100ms; +} +.slidedown.in { + -webkit-transform: translateY(0); + -webkit-animation-name: slideinfromtop; + -moz-transform: translateY(0); + -moz-animation-name: slideinfromtop; + -webkit-animation-duration: 250ms; + -moz-animation-duration: 250ms; +} +.slidedown.in.reverse { + -webkit-animation-name: fadein; + -moz-animation-name: fadein; + -webkit-animation-duration: 150ms; + -moz-animation-duration: 150ms; +} +.slidedown.out.reverse { + -webkit-transform: translateY(-100%); + -moz-transform: translateY(-100%); + -webkit-animation-name: slideouttotop; + -moz-animation-name: slideouttotop; + -webkit-animation-duration: 200ms; + -moz-animation-duration: 200ms; +} +@-webkit-keyframes slideinfromtop { + from { -webkit-transform: translateY(-100%); } + to { -webkit-transform: translateY(0); } +} +@-moz-keyframes slideinfromtop { + from { -moz-transform: translateY(-100%); } + to { -moz-transform: translateY(0); } +} +@-webkit-keyframes slideouttotop { + from { -webkit-transform: translateY(0); } + to { -webkit-transform: translateY(-100%); } +} +@-moz-keyframes slideouttotop { + from { -moz-transform: translateY(0); } + to { -moz-transform: translateY(-100%); } +} +/* slide up */ +.slideup.out { + -webkit-animation-name: fadeout; + -moz-animation-name: fadeout; + -webkit-animation-duration: 100ms; + -moz-animation-duration: 100ms; +} +.slideup.in { + -webkit-transform: translateY(0); + -webkit-animation-name: slideinfrombottom; + -moz-transform: translateY(0); + -moz-animation-name: slideinfrombottom; + -webkit-animation-duration: 250ms; + -moz-animation-duration: 250ms; +} +.slideup.in.reverse { + -webkit-animation-name: fadein; + -moz-animation-name: fadein; + -webkit-animation-duration: 150ms; + -moz-animation-duration: 150ms; +} +.slideup.out.reverse { + -webkit-transform: translateY(100%); + -moz-transform: translateY(100%); + -webkit-animation-name: slideouttobottom; + -moz-animation-name: slideouttobottom; + -webkit-animation-duration: 200ms; + -moz-animation-duration: 200ms; +} +@-webkit-keyframes slideinfrombottom { + from { -webkit-transform: translateY(100%); } + to { -webkit-transform: translateY(0); } +} +@-moz-keyframes slideinfrombottom { + from { -moz-transform: translateY(100%); } + to { -moz-transform: translateY(0); } +} +@-webkit-keyframes slideouttobottom { + from { -webkit-transform: translateY(0); } + to { -webkit-transform: translateY(100%); } +} +@-moz-keyframes slideouttobottom { + from { -moz-transform: translateY(0); } + to { -moz-transform: translateY(100%); } } - /* The properties in this rule are only necessary for the 'flip' transition. * We need specify the perspective to create a projection matrix. This will add * some depth as the element flips. The depth number represents the distance of @@ -1416,151 +1437,292 @@ Built by David Kaneda and maintained by Jonathan Stark. */ .viewport-flip { -webkit-perspective: 1000; + -moz-perspective: 1000; position: absolute; } - -.ui-mobile-viewport-transitioning, -.ui-mobile-viewport-transitioning .ui-page { - width: 100%; - height: 100%; - overflow: hidden; -} - .flip { - -webkit-animation-duration: .65s; -webkit-backface-visibility:hidden; -webkit-transform:translateX(0); /* Needed to work around an iOS 3.1 bug that causes listview thumbs to disappear when -webkit-visibility:hidden is used. */ + -moz-backface-visibility:hidden; + -moz-transform:translateX(0); } - .flip.out { - -webkit-transform: rotateY(-180deg) scale(.8); + -webkit-transform: rotateY(-90deg) scale(.9); -webkit-animation-name: flipouttoleft; + -webkit-animation-duration: 175ms; + -moz-transform: rotateY(-90deg) scale(.9); + -moz-animation-name: flipouttoleft; + -moz-animation-duration: 175ms; } - .flip.in { - -webkit-transform: rotateY(0) scale(1); - -webkit-animation-name: flipinfromleft; + -webkit-animation-name: flipintoright; + -webkit-animation-duration: 225ms; + -moz-animation-name: flipintoright; + -moz-animation-duration: 225ms; } - -/* Shake it all about */ - .flip.out.reverse { - -webkit-transform: rotateY(180deg) scale(.8); + -webkit-transform: rotateY(90deg) scale(.9); -webkit-animation-name: flipouttoright; + -moz-transform: rotateY(90deg) scale(.9); + -moz-animation-name: flipouttoright; } - .flip.in.reverse { - -webkit-transform: rotateY(0) scale(1); - -webkit-animation-name: flipinfromright; + -webkit-animation-name: flipintoleft; + -moz-animation-name: flipintoleft; } - -@-webkit-keyframes flipinfromright { - from { -webkit-transform: rotateY(-180deg) scale(.8); } - to { -webkit-transform: rotateY(0) scale(1); } -} - -@-webkit-keyframes flipinfromleft { - from { -webkit-transform: rotateY(180deg) scale(.8); } - to { -webkit-transform: rotateY(0) scale(1); } -} - @-webkit-keyframes flipouttoleft { - from { -webkit-transform: rotateY(0) scale(1); } - to { -webkit-transform: rotateY(-180deg) scale(.8); } + from { -webkit-transform: rotateY(0); } + to { -webkit-transform: rotateY(-90deg) scale(.9); } +} +@-moz-keyframes flipouttoleft { + from { -moz-transform: rotateY(0); } + to { -moz-transform: rotateY(-90deg) scale(.9); } } - @-webkit-keyframes flipouttoright { - from { -webkit-transform: rotateY(0) scale(1); } - to { -webkit-transform: rotateY(180deg) scale(.8); } + from { -webkit-transform: rotateY(0) ; } + to { -webkit-transform: rotateY(90deg) scale(.9); } } - - -/* Hackish, but reliable. */ - -@-webkit-keyframes dontmove { - from { opacity: 1; } - to { opacity: 1; } +@-moz-keyframes flipouttoright { + from { -moz-transform: rotateY(0); } + to { -moz-transform: rotateY(90deg) scale(.9); } } - -.pop { - -webkit-transform-origin: 50% 50%; +@-webkit-keyframes flipintoleft { + from { -webkit-transform: rotateY(-90deg) scale(.9); } + to { -webkit-transform: rotateY(0); } } - -.pop.in { - -webkit-transform: scale(1); - opacity: 1; - -webkit-animation-name: popin; - z-index: 10; +@-moz-keyframes flipintoleft { + from { -moz-transform: rotateY(-90deg) scale(.9); } + to { -moz-transform: rotateY(0); } } - -.pop.in.reverse { - z-index: 0; - -webkit-animation-name: dontmove; +@-webkit-keyframes flipintoright { + from { -webkit-transform: rotateY(90deg) scale(.9); } + to { -webkit-transform: rotateY(0); } } - -.pop.out.reverse { - -webkit-transform: scale(.2); - opacity: 0; - -webkit-animation-name: popout; - z-index: 10; +@-moz-keyframes flipintoright { + from { -moz-transform: rotateY(90deg) scale(.9); } + to { -moz-transform: rotateY(0); } } - -@-webkit-keyframes popin { - from { - -webkit-transform: scale(.2); - opacity: 0; - } - to { - -webkit-transform: scale(1); - opacity: 1; - } +/* The properties in this rule are only necessary for the 'flip' transition. + * We need specify the perspective to create a projection matrix. This will add + * some depth as the element flips. The depth number represents the distance of + * the viewer from the z-plane. According to the CSS3 spec, 1000 is a moderate + * value. + */ +.viewport-turn { + -webkit-perspective: 1000; + -moz-perspective: 1000; + position: absolute; } - -@-webkit-keyframes popout { - from { - -webkit-transform: scale(1); - opacity: 1; - } - to { - -webkit-transform: scale(.2); - opacity: 0; - } -}/* content configurations. */ +.turn { + -webkit-backface-visibility:hidden; + -webkit-transform:translateX(0); /* Needed to work around an iOS 3.1 bug that causes listview thumbs to disappear when -webkit-visibility:hidden is used. */ + -webkit-transform-origin: 0; + -moz-backface-visibility:hidden; + -moz-transform:translateX(0); /* Needed to work around an iOS 3.1 bug that causes listview thumbs to disappear when -webkit-visibility:hidden is used. */ + -moz-transform-origin: 0; +} +.turn.out { + -webkit-transform: rotateY(-90deg) scale(.9); + -webkit-animation-name: flipouttoleft; + -moz-transform: rotateY(-90deg) scale(.9); + -moz-animation-name: flipouttoleft; + -webkit-animation-duration: 125ms; + -moz-animation-duration: 125ms; +} +.turn.in { + -webkit-animation-name: flipintoright; + -moz-animation-name: flipintoright; + -webkit-animation-duration: 250ms; + -moz-animation-duration: 250ms; +} +.turn.out.reverse { + -webkit-transform: rotateY(90deg) scale(.9); + -webkit-animation-name: flipouttoright; + -moz-transform: rotateY(90deg) scale(.9); + -moz-animation-name: flipouttoright; +} +.turn.in.reverse { + -webkit-animation-name: flipintoleft; + -moz-animation-name: flipintoleft; +} +@-webkit-keyframes flipouttoleft { + from { -webkit-transform: rotateY(0); } + to { -webkit-transform: rotateY(-90deg) scale(.9); } +} +@-moz-keyframes flipouttoleft { + from { -moz-transform: rotateY(0); } + to { -moz-transform: rotateY(-90deg) scale(.9); } +} +@-webkit-keyframes flipouttoright { + from { -webkit-transform: rotateY(0) ; } + to { -webkit-transform: rotateY(90deg) scale(.9); } +} +@-moz-keyframes flipouttoright { + from { -moz-transform: rotateY(0); } + to { -moz-transform: rotateY(90deg) scale(.9); } +} +@-webkit-keyframes flipintoleft { + from { -webkit-transform: rotateY(-90deg) scale(.9); } + to { -webkit-transform: rotateY(0); } +} +@-moz-keyframes flipintoleft { + from { -moz-transform: rotateY(-90deg) scale(.9); } + to { -moz-transform: rotateY(0); } +} +@-webkit-keyframes flipintoright { + from { -webkit-transform: rotateY(90deg) scale(.9); } + to { -webkit-transform: rotateY(0); } +} +@-moz-keyframes flipintoright { + from { -moz-transform: rotateY(90deg) scale(.9); } + to { -moz-transform: rotateY(0); } +} +/* flow transition */ +.flow { + -webkit-transform-origin: 50% 30%; + -moz-transform-origin: 50% 30%; + -webkit-box-shadow: 0 0 20px rgba(0,0,0,.4); + -moz-box-shadow: 0 0 20px rgba(0,0,0,.4); +} +.ui-dialog.flow { + -webkit-transform-origin: none; + -moz-transform-origin: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; +} +.flow.out { + -webkit-transform: translateX(-100%) scale(.7); + -webkit-animation-name: flowouttoleft; + -webkit-animation-timing-function: ease; + -webkit-animation-duration: 350ms; + -moz-transform: translateX(-100%) scale(.7); + -moz-animation-name: flowouttoleft; + -moz-animation-timing-function: ease; + -moz-animation-duration: 350ms; +} +.flow.in { + -webkit-transform: translateX(0) scale(1); + -webkit-animation-name: flowinfromright; + -webkit-animation-timing-function: ease; + -webkit-animation-duration: 350ms; + -moz-transform: translateX(0) scale(1); + -moz-animation-name: flowinfromright; + -moz-animation-timing-function: ease; + -moz-animation-duration: 350ms; +} +.flow.out.reverse { + -webkit-transform: translateX(100%); + -webkit-animation-name: flowouttoright; + -moz-transform: translateX(100%); + -moz-animation-name: flowouttoright; +} +.flow.in.reverse { + -webkit-animation-name: flowinfromleft; + -moz-animation-name: flowinfromleft; +} +@-webkit-keyframes flowouttoleft { + 0% { -webkit-transform: translateX(0) scale(1); } + 60%, 70% { -webkit-transform: translateX(0) scale(.7); } + 100% { -webkit-transform: translateX(-100%) scale(.7); } +} +@-moz-keyframes flowouttoleft { + 0% { -moz-transform: translateX(0) scale(1); } + 60%, 70% { -moz-transform: translateX(0) scale(.7); } + 100% { -moz-transform: translateX(-100%) scale(.7); } +} +@-webkit-keyframes flowouttoright { + 0% { -webkit-transform: translateX(0) scale(1); } + 60%, 70% { -webkit-transform: translateX(0) scale(.7); } + 100% { -webkit-transform: translateX(100%) scale(.7); } +} +@-moz-keyframes flowouttoright { + 0% { -moz-transform: translateX(0) scale(1); } + 60%, 70% { -moz-transform: translateX(0) scale(.7); } + 100% { -moz-transform: translateX(100%) scale(.7); } +} +@-webkit-keyframes flowinfromleft { + 0% { -webkit-transform: translateX(-100%) scale(.7); } + 30%, 40% { -webkit-transform: translateX(0) scale(.7); } + 100% { -webkit-transform: translateX(0) scale(1); } +} +@-moz-keyframes flowinfromleft { + 0% { -moz-transform: translateX(-100%) scale(.7); } + 30%, 40% { -moz-transform: translateX(0) scale(.7); } + 100% { -moz-transform: translateX(0) scale(1); } +} +@-webkit-keyframes flowinfromright { + 0% { -webkit-transform: translateX(100%) scale(.7); } + 30%, 40% { -webkit-transform: translateX(0) scale(.7); } + 100% { -webkit-transform: translateX(0) scale(1); } +} +@-moz-keyframes flowinfromright { + 0% { -moz-transform: translateX(100%) scale(.7); } + 30%, 40% { -moz-transform: translateX(0) scale(.7); } + 100% { -moz-transform: translateX(0) scale(1); } +} +/* content configurations. */ .ui-grid-a, .ui-grid-b, .ui-grid-c, .ui-grid-d { overflow: hidden; } .ui-block-a, .ui-block-b, .ui-block-c, .ui-block-d, .ui-block-e { margin: 0; padding: 0; border: 0; float: left; min-height:1px;} - /* grid solo: 100 - single item fallback */ .ui-grid-solo .ui-block-a { width: 100%; float: none; } - /* grid a: 50/50 */ .ui-grid-a .ui-block-a, .ui-grid-a .ui-block-b { width: 50%; } .ui-grid-a .ui-block-a { clear: left; } - /* grid b: 33/33/33 */ .ui-grid-b .ui-block-a, .ui-grid-b .ui-block-b, .ui-grid-b .ui-block-c { width: 33.333%; } .ui-grid-b .ui-block-a { clear: left; } - /* grid c: 25/25/25/25 */ .ui-grid-c .ui-block-a, .ui-grid-c .ui-block-b, .ui-grid-c .ui-block-c, .ui-grid-c .ui-block-d { width: 25%; } .ui-grid-c .ui-block-a { clear: left; } - /* grid d: 20/20/20/20/20 */ .ui-grid-d .ui-block-a, .ui-grid-d .ui-block-b, .ui-grid-d .ui-block-c, .ui-grid-d .ui-block-d, .ui-grid-d .ui-block-e { width: 20%; } .ui-grid-d .ui-block-a { clear: left; } /* fixed page header & footer configuration */ -.ui-header, .ui-footer, .ui-page-fullscreen .ui-header, .ui-page-fullscreen .ui-footer { position: absolute; overflow: hidden; width: 100%; border-left-width: 0; border-right-width: 0; } -.ui-header-fixed, .ui-footer-fixed { +.ui-header-fixed, +.ui-footer-fixed { + left: 0; + right: 0; + width: 100%; + position: fixed; z-index: 1000; - -webkit-transform: translateZ(0); /* Force header/footer rendering to go through the same rendering pipeline as native page scrolling. */ } -.ui-footer-duplicate, .ui-page-fullscreen .ui-fixed-inline { display: none; } -.ui-page-fullscreen .ui-header, .ui-page-fullscreen .ui-footer { opacity: .9; } +.ui-header-fixed { + top: 0; +} +.ui-footer-fixed { + bottom: 0; +} +.ui-header-fullscreen, +.ui-footer-fullscreen { + opacity: .9; +} +.ui-page-header-fixed { + padding-top: 2.5em; +} +.ui-page-footer-fixed { + padding-bottom: 3em; +} +.ui-page-header-fullscreen .ui-content, +.ui-page-footer-fullscreen .ui-content { + padding: 0; +} +.ui-fixed-hidden { + position: absolute; +} +.ui-page-header-fullscreen .ui-fixed-hidden, +.ui-page-footer-fullscreen .ui-fixed-hidden { + left: -99999em; +} +.ui-header-fixed .ui-btn, +.ui-footer-fixed .ui-btn { + z-index: 10; +} .ui-navbar { overflow: hidden; } .ui-navbar ul, .ui-navbar-expanded ul { list-style:none; padding: 0; margin: 0; position: relative; display: block; border: 0;} .ui-navbar-collapsed ul { float: left; width: 75%; margin-right: -2px; } .ui-navbar-collapsed .ui-navbar-toggle { float: left; width: 25%; } .ui-navbar li.ui-navbar-truncate { position: absolute; left: -9999px; top: -9999px; } -.ui-navbar li .ui-btn, .ui-navbar .ui-navbar-toggle .ui-btn { display: block; font-size: 12px; text-align: center; margin: 0; border-right-width: 0; } +.ui-navbar li .ui-btn, .ui-navbar .ui-navbar-toggle .ui-btn { display: block; font-size: 12px; text-align: center; margin: 0; border-right-width: 0; max-width: 100%; } .ui-navbar li .ui-btn { margin-right: -1px; } .ui-navbar li .ui-btn:last-child { margin-right: 0; } .ui-header .ui-navbar li .ui-btn, .ui-header .ui-navbar .ui-navbar-toggle .ui-btn, @@ -1577,59 +1739,73 @@ Built by David Kaneda and maintained by Jonathan Stark. .ui-navbar-expanded li .ui-btn .ui-btn-inner { min-height: 2.5em; } .ui-navbar-expanded .ui-navbar-noicons .ui-btn .ui-btn-inner { padding-top: 1.8em; padding-bottom: 1.9em; } .ui-btn { display: block; text-align: center; cursor:pointer; position: relative; margin: .5em 5px; padding: 0; } -.ui-header .ui-btn, .ui-footer .ui-btn, .ui-bar .ui-btn { display: inline-block; font-size: 13px; margin: 0; } -.ui-btn-inline { display: inline-block; } -.ui-btn-inner { padding: .6em 25px; display: block; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; position: relative; zoom: 1; } +.ui-mini { margin: .25em 5px; } +.ui-btn-inner { padding: .6em 20px; min-width: .75em; display: block; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; position: relative; zoom: 1; } .ui-btn input, .ui-btn button { z-index: 2; } -.ui-header .ui-btn-inner, .ui-footer .ui-btn-inner, .ui-bar .ui-btn-inner { padding: .4em 8px .5em; } +.ui-btn-left, .ui-btn-right, .ui-btn-inline { display: inline-block; } +.ui-btn-block { display: block; } +.ui-header .ui-btn, +.ui-footer .ui-btn { display: inline-block; margin: 0; } +.ui-header .ui-btn-inner, +.ui-footer .ui-btn-inner, +.ui-mini .ui-btn-inner { font-size: 12.5px; padding: .55em 11px .5em; } +.ui-header .ui-fullsize .ui-btn-inner, +.ui-footer .ui-fullsize .ui-btn-inner { font-size: 16px; padding: .6em 25px; } .ui-btn-icon-notext { width: 24px; height: 24px; } -.ui-btn-icon-notext .ui-btn-inner { padding: 2px 1px 2px 3px; } -.ui-btn-text { position: relative; z-index: 1; } +.ui-btn-icon-notext .ui-btn-inner { padding: 0; height: 100%; } +.ui-btn-icon-notext .ui-btn-inner .ui-icon { margin: 2px 1px 2px 3px; } +.ui-btn-text { position: relative; z-index: 1; width: 100%; } .ui-btn-icon-notext .ui-btn-text { position: absolute; left: -9999px; } -.ui-btn-icon-left .ui-btn-inner { padding-left: 33px; } +.ui-btn-icon-left .ui-btn-inner { padding-left: 40px; } +.ui-btn-icon-right .ui-btn-inner { padding-right: 40px; } +.ui-btn-icon-top .ui-btn-inner { padding-top: 40px; } +.ui-btn-icon-bottom .ui-btn-inner { padding-bottom: 40px; } .ui-header .ui-btn-icon-left .ui-btn-inner, .ui-footer .ui-btn-icon-left .ui-btn-inner, -.ui-bar .ui-btn-icon-left .ui-btn-inner { padding-left: 27px; } -.ui-btn-icon-right .ui-btn-inner { padding-right: 33px; } +.ui-mini .ui-btn-icon-left .ui-btn-inner { padding-left: 30px; } .ui-header .ui-btn-icon-right .ui-btn-inner, .ui-footer .ui-btn-icon-right .ui-btn-inner, -.ui-bar .ui-btn-icon-right .ui-btn-inner { padding-right: 27px; } -.ui-btn-icon-top .ui-btn-inner { padding-top: 33px; } +.ui-mini .ui-btn-icon-right .ui-btn-inner { padding-right: 30px; } .ui-header .ui-btn-icon-top .ui-btn-inner, .ui-footer .ui-btn-icon-top .ui-btn-inner, -.ui-bar .ui-btn-icon-top .ui-btn-inner { padding-top: 27px; } -.ui-btn-icon-bottom .ui-btn-inner { padding-bottom: 33px; } +.ui-mini .ui-btn-icon-top .ui-btn-inner { padding: 30px 3px .5em 3px; } .ui-header .ui-btn-icon-bottom .ui-btn-inner, .ui-footer .ui-btn-icon-bottom .ui-btn-inner, -.ui-bar .ui-btn-icon-bottom .ui-btn-inner { padding-bottom: 27px; } - +.ui-mini .ui-btn-icon-bottom .ui-btn-inner { padding: .55em 3px 30px 3px; } /*btn icon positioning*/ .ui-btn-icon-notext .ui-icon { display: block; z-index: 0;} -.ui-btn-icon-left .ui-icon, .ui-btn-icon-right .ui-icon { position: absolute; top: 50%; margin-top: -9px; } -.ui-btn-icon-top .ui-icon, .ui-btn-icon-bottom .ui-icon { position: absolute; left: 50%; margin-left: -9px; } +.ui-btn-icon-left .ui-btn-inner .ui-icon, .ui-btn-icon-right .ui-btn-inner .ui-icon { position: absolute; top: 50%; margin-top: -9px; } +.ui-btn-icon-top .ui-btn-inner .ui-icon, .ui-btn-icon-bottom .ui-btn-inner .ui-icon { position: absolute; left: 50%; margin-left: -9px; } .ui-btn-icon-left .ui-icon { left: 10px; } .ui-btn-icon-right .ui-icon { right: 10px; } .ui-btn-icon-top .ui-icon { top: 10px; } -.ui-btn-icon-bottom .ui-icon { bottom: 10px; } +.ui-btn-icon-bottom .ui-icon { top: auto; bottom: 10px; } .ui-header .ui-btn-icon-left .ui-icon, .ui-footer .ui-btn-icon-left .ui-icon, -.ui-bar .ui-btn-icon-left .ui-icon { left: 4px; } +.ui-mini.ui-btn-icon-left .ui-icon, +.ui-mini .ui-btn-icon-left .ui-icon { left: 5px; } .ui-header .ui-btn-icon-right .ui-icon, .ui-footer .ui-btn-icon-right .ui-icon, -.ui-bar .ui-btn-icon-right .ui-icon { right: 4px; } +.ui-mini.ui-btn-icon-right .ui-icon, +.ui-mini .ui-btn-icon-right .ui-icon { right: 5px; } .ui-header .ui-btn-icon-top .ui-icon, .ui-footer .ui-btn-icon-top .ui-icon, -.ui-bar .ui-btn-icon-top .ui-icon { top: 4px; } +.ui-mini.ui-btn-icon-top .ui-icon, +.ui-mini .ui-btn-icon-top .ui-icon { top: 5px; } .ui-header .ui-btn-icon-bottom .ui-icon, .ui-footer .ui-btn-icon-bottom .ui-icon, -.ui-bar .ui-btn-icon-bottom .ui-icon { bottom: 4px; } - +.ui-mini.ui-btn-icon-bottom .ui-icon, +.ui-mini .ui-btn-icon-bottom .ui-icon { bottom: 5px; } /*hiding native button,inputs */ -.ui-btn-hidden { position: absolute; top: 0; left: 0; width: 100%; height: 100%; -webkit-appearance: button; opacity: .1; cursor: pointer; background: #fff; background: rgba(255,255,255,0); filter: Alpha(Opacity=.0001); font-size: 1px; border: none; line-height: 999px; } +.ui-btn-hidden { position: absolute; top: 0; left: 0; width: 100%; height: 100%; -webkit-appearance: button; opacity: .1; cursor: pointer; background: #fff; background: rgba(255,255,255,0); filter: Alpha(Opacity=.0001); font-size: 1px; border: none; text-indent: -9999px; } .ui-collapsible { margin: .5em 0; } .ui-collapsible-heading { font-size: 16px; display: block; margin: 0 -8px; padding: 0; border-width: 0 0 1px 0; position: relative; } .ui-collapsible-heading a { text-align: left; margin: 0; } -.ui-collapsible-heading a .ui-btn-inner { padding-left: 40px; } +.ui-collapsible-heading .ui-btn-inner, +.ui-collapsible-heading .ui-btn-icon-left .ui-btn-inner { padding-left: 40px; } +.ui-collapsible-heading .ui-btn-icon-right .ui-btn-inner { padding-left: 12px; padding-right: 40px; } +.ui-collapsible-heading .ui-btn-icon-top .ui-btn-inner, +.ui-collapsible-heading .ui-btn-icon-bottom .ui-btn-inner { padding-right: 40px; text-align: center; } .ui-collapsible-heading a span.ui-btn { position: absolute; left: 6px; top: 50%; margin: -12px 0 0 0; width: 20px; height: 20px; padding: 1px 0px 1px 2px; text-indent: -9999px; } .ui-collapsible-heading a span.ui-btn .ui-btn-inner { padding: 10px 0; } .ui-collapsible-heading a span.ui-btn .ui-icon { left: 0; margin-top: -10px; } @@ -1643,22 +1819,21 @@ Built by David Kaneda and maintained by Jonathan Stark. font-weight: normal; /* Overrides ui-btn-up-* */ } .ui-collapsible-content-collapsed { display: none; } - .ui-collapsible-set { margin: .5em 0; } .ui-collapsible-set .ui-collapsible { margin: -1px 0 0; } -.ui-controlgroup, fieldset.ui-controlgroup { padding: 0; margin: .5em 0 1em; } +.ui-controlgroup, fieldset.ui-controlgroup { padding: 0; margin: 0em 0 .5em; zoom: 1; } .ui-bar .ui-controlgroup { margin: 0 .3em; } -.ui-controlgroup-label { font-size: 16px; line-height: 1.4; font-weight: normal; margin: 0 0 .3em; } +.ui-controlgroup-label { font-size: 16px; line-height: 1.4; font-weight: normal; margin: 0 0 .4em; } .ui-controlgroup-controls { display: block; width: 100%;} .ui-controlgroup li { list-style: none; } .ui-controlgroup-vertical .ui-btn, .ui-controlgroup-vertical .ui-checkbox, .ui-controlgroup-vertical .ui-radio { margin: 0; border-bottom-width: 0; } .ui-controlgroup-controls label.ui-select { position: absolute; left: -9999px; } - .ui-controlgroup-vertical .ui-controlgroup-last { border-bottom-width: 1px; } .ui-controlgroup-horizontal { padding: 0; } -.ui-controlgroup-horizontal .ui-btn, .ui-controlgroup-horizontal .ui-select { display: inline-block; margin: 0 -5px 0 0; } -.ui-controlgroup-horizontal .ui-checkbox, .ui-controlgroup-horizontal .ui-radio { float: left; margin: 0 -1px 0 0; } +.ui-controlgroup-horizontal .ui-btn-inner { text-align:center; } +.ui-controlgroup-horizontal .ui-btn, .ui-controlgroup-horizontal .ui-select { display: inline-block; margin: 0 -6px 0 0; } +.ui-controlgroup-horizontal .ui-checkbox, .ui-controlgroup-horizontal .ui-radio { float: left; clear: none; margin: 0 -1px 0 0; } .ui-controlgroup-horizontal .ui-checkbox .ui-btn, .ui-controlgroup-horizontal .ui-radio .ui-btn, .ui-controlgroup-horizontal .ui-checkbox:last-child, .ui-controlgroup-horizontal .ui-radio:last-child { margin-right: 0; } .ui-controlgroup-horizontal .ui-controlgroup-last { margin-right: 0; } @@ -1667,71 +1842,96 @@ Built by David Kaneda and maintained by Jonathan Stark. .ui-controlgroup .ui-btn-icon-notext { width: 30px; height: 30px; text-indent: -9999px; } .ui-controlgroup .ui-btn-icon-notext .ui-btn-inner { padding: 5px 6px 5px 5px; } */ - @media all and (min-width: 450px){ .ui-field-contain .ui-controlgroup-label { vertical-align: top; display: inline-block; width: 20%; margin: 0 2% 0 0; } .ui-field-contain .ui-controlgroup-controls { width: 60%; display: inline-block; } .ui-field-contain .ui-controlgroup .ui-select { width: 100%; } .ui-field-contain .ui-controlgroup-horizontal .ui-select { width: auto; } -} .ui-dialog { min-height: 480px; } +} +.ui-dialog { + background: none !important; /* this is to ensure that dialog theming does not apply (by default at least) on the page div */ +} +.ui-dialog-contain { width: 92.5%; max-width: 500px; margin: 10% auto 15px auto; padding: 0; } +.ui-dialog .ui-header { + margin-top: 15%; + border: none; + overflow: hidden; +} .ui-dialog .ui-header, .ui-dialog .ui-content, .ui-dialog .ui-footer { - max-width: 500px; - margin: 10% auto 15px auto; - width: 85%; + display: block; position: relative; + width: auto; } .ui-dialog .ui-header, .ui-dialog .ui-footer { - padding: 0 15px; z-index: 10; + padding: 0; +} +.ui-dialog .ui-footer { + padding: 0 15px; } .ui-dialog .ui-content { padding: 15px; } -.ui-dialog .ui-content, -.ui-dialog .ui-footer { +.ui-dialog { margin-top: -15px; } -.ui-checkbox, .ui-radio { position:relative; margin: .2em 0 .5em; z-index: 1; } +.ui-checkbox, .ui-radio { position: relative; clear: both; margin: .2em 0 .5em; z-index: 1; } .ui-checkbox .ui-btn, .ui-radio .ui-btn { margin: 0; text-align: left; z-index: 2; } .ui-checkbox .ui-btn-inner, .ui-radio .ui-btn-inner { white-space: normal; } .ui-checkbox .ui-btn-icon-left .ui-btn-inner,.ui-radio .ui-btn-icon-left .ui-btn-inner { padding-left: 45px; } +.ui-checkbox .ui-mini.ui-btn-icon-left .ui-btn-inner,.ui-radio .ui-mini.ui-btn-icon-left .ui-btn-inner { padding-left: 36px; } .ui-checkbox .ui-btn-icon-right .ui-btn-inner, .ui-radio .ui-btn-icon-right .ui-btn-inner { padding-right: 45px; } +.ui-checkbox .ui-mini.ui-btn-icon-right .ui-btn-inner, .ui-radio .ui-mini.ui-btn-icon-right .ui-btn-inner { padding-right: 36px; } +.ui-checkbox .ui-btn-icon-top .ui-btn-inner,.ui-radio .ui-btn-icon-top .ui-btn-inner { padding-right: 0; padding-left: 0; text-align: center; } +.ui-checkbox .ui-btn-icon-bottom .ui-btn-inner, .ui-radio .ui-btn-icon-bottom .ui-btn-inner { padding-right: 0; padding-left: 0; text-align: center; } .ui-checkbox .ui-icon, .ui-radio .ui-icon { top: 1.1em; } -.ui-checkbox .ui-btn-icon-left .ui-icon, .ui-radio .ui-btn-icon-left .ui-icon {left: 15px; } -.ui-checkbox .ui-btn-icon-right .ui-icon, .ui-radio .ui-btn-icon-right .ui-icon {right: 15px; } +.ui-checkbox .ui-btn-icon-left .ui-icon, .ui-radio .ui-btn-icon-left .ui-icon { left: 15px; } +.ui-checkbox .ui-mini.ui-btn-icon-left .ui-icon, .ui-radio .ui-mini.ui-btn-icon-left .ui-icon { left: 9px; } +.ui-checkbox .ui-btn-icon-right .ui-icon, .ui-radio .ui-btn-icon-right .ui-icon { right: 15px; } +.ui-checkbox .ui-mini.ui-btn-icon-right .ui-icon, .ui-radio .ui-mini.ui-btn-icon-right .ui-icon { right: 9px; } +.ui-checkbox .ui-btn-icon-top .ui-icon, .ui-radio .ui-btn-icon-top .ui-icon { top: 10px; } +.ui-checkbox .ui-btn-icon-bottom .ui-icon, .ui-radio .ui-btn-icon-bottom .ui-icon { top: auto; bottom: 10px; } +.ui-checkbox .ui-btn-icon-right .ui-icon, .ui-radio .ui-btn-icon-right .ui-icon { right: 15px; } +.ui-checkbox .ui-mini.ui-btn-icon-right .ui-icon, .ui-radio .ui-mini.ui-btn-icon-right .ui-icon { right: 9px; } /* input, label positioning */ -.ui-checkbox input,.ui-radio input { position:absolute; left:20px; top:50%; width: 10px; height: 10px; margin:-5px 0 0 0; outline: 0 !important; z-index: 1; }.ui-field-contain { padding: 1.5em 0; margin: 0; border-bottom-width: 1px; overflow: visible; } +.ui-checkbox input,.ui-radio input { position:absolute; left:20px; top:50%; width: 10px; height: 10px; margin:-5px 0 0 0; outline: 0 !important; z-index: 1; } +.ui-field-contain, fieldset.ui-field-contain { padding: .8em 0; margin: 0; border-width: 0 0 1px 0; overflow: visible; } .ui-field-contain:first-child { border-top-width: 0; } +.ui-header .ui-field-contain-left, +.ui-header .ui-field-contain-right { + position: absolute; + top: 0; + width: 25%; +} +.ui-header .ui-field-contain-left { + left: 1em; +} +.ui-header .ui-field-contain-right { + right: 1em; +} @media all and (min-width: 450px){ - .ui-field-contain { border-width: 0; padding: 0; margin: 1em 0; } -} .ui-select { display: block; position: relative; } + .ui-field-contain, .ui-mobile fieldset.ui-field-contain { border-width: 0; padding: 0; margin: 1em 0; } +} +.ui-select { display: block; position: relative; } .ui-select select { position: absolute; left: -9999px; top: -9999px; } -.ui-select .ui-btn { overflow: hidden; } - - -.ui-select .ui-btn { opacity: 1; } - +.ui-select .ui-btn { overflow: hidden; opacity: 1; margin: 0; } /* Fixes #2588 — When Windows Phone 7.5 (Mango) tries to calculate a numeric opacity for a select—including “inherit”—without explicitly specifying an opacity on the parent to give it context, a bug appears where clicking elsewhere on the page after opening the select will open the select again. */ .ui-select .ui-btn select { cursor: pointer; -webkit-appearance: button; left: 0; top:0; width: 100%; min-height: 1.5em; min-height: 100%; height: 3em; max-height: 100%; opacity: 0; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter: alpha(opacity=0); z-index: 2; } - .ui-select .ui-disabled { opacity: .3; } - @-moz-document url-prefix() {.ui-select .ui-btn select { opacity: 0.0001; }} .ui-select .ui-btn select.ui-select-nativeonly { opacity: 1; text-indent: 0; } - .ui-select .ui-btn-icon-right .ui-btn-inner { padding-right: 45px; } .ui-select .ui-btn-icon-right .ui-icon { right: 15px; } - +.ui-select .ui-mini.ui-btn-icon-right .ui-icon { right: 7px; } /* labels */ label.ui-select { font-size: 16px; line-height: 1.4; font-weight: normal; margin: 0 0 .3em; display: block; } - /*listbox*/ -.ui-select .ui-btn-text, .ui-selectmenu .ui-btn-text { display: block; min-height: 1em; overflow: hidden; } +.ui-select .ui-btn-text, .ui-selectmenu .ui-btn-text { display: block; min-height: 1em; overflow: hidden !important; +/* This !important is required for iPad Safari specifically. See https://github.com/jquery/jquery-mobile/issues/2647 */ } .ui-select .ui-btn-text { text-overflow: ellipsis; } - .ui-selectmenu { position: absolute; padding: 0; z-index: 1100 !important; width: 80%; max-width: 350px; padding: 6px; } .ui-selectmenu .ui-listview { margin: 0; } .ui-selectmenu .ui-btn.ui-li-divider { cursor: default; } @@ -1741,23 +1941,26 @@ label.ui-select { font-size: 16px; line-height: 1.4; font-weight: normal; margi .ui-selectmenu-list .ui-li .ui-icon { display: block; } .ui-li.ui-selectmenu-placeholder { display: none; } .ui-selectmenu .ui-header .ui-title { margin: 0.6em 46px 0.8em; } - -@media all and (min-width: 450px){ +@media all and (min-width: 450px){ .ui-field-contain label.ui-select { vertical-align: top; display: inline-block; width: 20%; margin: 0 2% 0 0; } .ui-field-contain .ui-select { width: 60%; display: inline-block; } -} - +} /* when no placeholder is defined in a multiple select, the header height doesn't even extend past the close button. this shim's content in there */ -.ui-selectmenu .ui-header h1:after { content: '.'; visibility: hidden; }label.ui-input-text { font-size: 16px; line-height: 1.4; display: block; font-weight: normal; margin: 0 0 .3em; } -input.ui-input-text, textarea.ui-input-text { background-image: none; padding: .4em; line-height: 1.4; font-size: 16px; display: block; width: 97%; } -input.ui-input-text { -webkit-appearance: none; } +.ui-selectmenu .ui-header h1:after { content: '.'; visibility: hidden; } +label.ui-input-text { font-size: 16px; line-height: 1.4; display: block; font-weight: normal; margin: 0 0 .3em; } +input.ui-input-text, textarea.ui-input-text { background-image: none; padding: .4em; line-height: 1.4; font-size: 16px; display: block; width: 97%; outline: 0; } +.ui-header input.ui-input-text, +.ui-footer input.ui-input-text { margin-left: 1.25%; padding: .4em 1%; width: 95.5% } /* Note that padding left/right on text inputs is factored into how the element is displayed in Firefox, but does not actually pad the text inside it. */ + input.ui-input-text { -webkit-appearance: none; } textarea.ui-input-text { height: 50px; -webkit-transition: height 200ms linear; -moz-transition: height 200ms linear; -o-transition: height 200ms linear; transition: height 200ms linear; } .ui-input-search { padding: 0 30px; background-image: none; position: relative; } .ui-icon-searchfield:after { position: absolute; left: 7px; top: 50%; margin-top: -9px; content: ""; width: 18px; height: 18px; opacity: .5; } .ui-input-search input.ui-input-text { border: none; width: 98%; padding: .4em 0; margin: 0; display: block; background: transparent none; outline: 0 !important; } .ui-input-search .ui-input-clear { position: absolute; right: 0; top: 50%; margin-top: -13px; } +.ui-mini .ui-input-clear { right: -3px; } .ui-input-search .ui-input-clear-hidden { display: none; } - +input.ui-mini, .ui-mini input, textarea.ui-mini { font-size: 14px; } +textarea.ui-mini { height: 45px; } /* orientation adjustments - incomplete!*/ @media all and (min-width: 450px){ .ui-field-contain label.ui-input-text { vertical-align: top; display: inline-block; width: 20%; margin: 0 2% 0 0 } @@ -1769,7 +1972,8 @@ textarea.ui-input-text { height: 50px; -webkit-transition: height 200ms linear; .ui-hide-label textarea.ui-input-text, .ui-hide-label .ui-input-search { padding: .4em; width: 97%; } .ui-input-search input.ui-input-text { width: 98%; /*echos rule from above*/ } -}.ui-listview { margin: 0; counter-reset: listnumbering; } +} +.ui-listview { margin: 0; counter-reset: listnumbering; } .ui-content .ui-listview { margin: -15px; } .ui-content .ui-listview-inset { margin: 1em 0; } .ui-listview, .ui-li { list-style:none; padding:0; } @@ -1794,54 +1998,54 @@ ol.ui-listview .ui-li-jsnumbering:before { content: "" !important; } /* to avoid .ui-li-thumb, .ui-listview .ui-li-icon { position: absolute; left: 1px; top: 0; max-height: 80px; max-width: 80px; } .ui-listview .ui-li-icon { max-height: 40px; max-width: 40px; left: 10px; top: .9em; } .ui-li-thumb, .ui-listview .ui-li-icon, .ui-li-content { float: left; margin-right: 10px; } - .ui-li-aside { float: right; width: 50%; text-align: right; margin: .3em 0; } @media all and (min-width: 480px){ .ui-li-aside { width: 45%; } } .ui-li-divider { cursor: default; } .ui-li-has-alt .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li-has-alt { padding-right: 95px; } -.ui-li-has-count .ui-li-count { position: absolute; font-size: 11px; font-weight: bold; padding: .2em .5em; top: 50%; margin-top: -.9em; right: 38px; } +.ui-li-has-count .ui-li-count { position: absolute; font-size: 11px; font-weight: bold; padding: .2em .5em; top: 50%; margin-top: -.9em; right: 48px; } .ui-li-divider .ui-li-count, .ui-li-static .ui-li-count { right: 10px; } .ui-li-has-alt .ui-li-count { right: 55px; } .ui-li-link-alt { position: absolute; width: 40px; height: 100%; border-width: 0; border-left-width: 1px; top: 0; right: 0; margin: 0; padding: 0; z-index: 2; } .ui-li-link-alt .ui-btn { overflow: hidden; position: absolute; right: 8px; top: 50%; margin: -11px 0 0 0; border-bottom-width: 1px; z-index: -1;} .ui-li-link-alt .ui-btn-inner { padding: 0; height: 100%; position: absolute; width: 100%; top: 0; left: 0;} .ui-li-link-alt .ui-btn .ui-icon { right: 50%; margin-right: -9px; } - .ui-listview * .ui-btn-inner > .ui-btn > .ui-btn-inner { border-top: 0px; } - .ui-listview-filter { border-width: 0; overflow: hidden; margin: -15px -15px 15px -15px } .ui-listview-filter .ui-input-search { margin: 5px; width: auto; display: block; } - .ui-listview-filter-inset { margin: -15px -5px -15px -5px; background: transparent; } .ui-li.ui-screen-hidden{display:none;} /* Odd iPad positioning issue. */ @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) { .ui-li .ui-btn-text { overflow: visible; } -}label.ui-slider { font-size: 16px; line-height: 1.4; font-weight: normal; margin: 0 0 .3em; display: block; } +} +label.ui-slider { font-size: 16px; line-height: 1.4; font-weight: normal; margin: 0 0 .3em; display: block; } input.ui-slider-input, .ui-field-contain input.ui-slider-input { display: inline-block; width: 50px; } select.ui-slider-switch { display: none; } -div.ui-slider { position: relative; display: inline-block; overflow: visible; height: 15px; padding: 0; margin: 0 2% 0 20px; top: 4px; width: 60%; } -div.ui-slider-switch { width: 99.8%; } -a.ui-slider-handle { position: absolute; z-index: 10; top: 50%; width: 28px; height: 28px; margin-top: -15px; margin-left: -15px; } -a.ui-slider-handle .ui-btn-inner { padding-left: 0; padding-right: 0; } -@media all and (min-width: 480px){ - .ui-field-contain label.ui-slider { vertical-align: top; display: inline-block; width: 20%; margin: 0 2% 0 0; } +div.ui-slider { position: relative; display: inline-block; overflow: visible; height: 15px; padding: 0; margin: 0 2% 0 20px; top: 4px; width: 65%; } +div.ui-slider-mini { height: 12px; margin-left: 10px; } +div.ui-slider-bg { border: none; height: 100%; padding-right: 8px; } +.ui-controlgroup a.ui-slider-handle, a.ui-slider-handle { position: absolute; z-index: 1; top: 50%; width: 28px; height: 28px; margin-top: -15px; margin-left: -15px; outline: 0; } +a.ui-slider-handle .ui-btn-inner { padding: 0; height: 100%; } +div.ui-slider-mini a.ui-slider-handle { height: 14px; width: 14px; margin: -8px 0 0 -7px; } +div.ui-slider-mini a.ui-slider-handle .ui-btn-inner { height: 30px; width: 30px; padding: 0; margin: -9px 0 0 -9px; } +@media all and (min-width: 450px){ + .ui-field-contain label.ui-slider { vertical-align: top; display: inline-block; width: 20%; margin: 0 2% 0 0; } .ui-field-contain div.ui-slider { width: 43%; } -} - -div.ui-slider-switch { height: 32px; overflow: hidden; margin-left: 0; } -div.ui-slider-inneroffset { margin-left: 50%; position: absolute; top: 1px; height: 100%; width: 50%; } -a.ui-slider-handle-snapping { -webkit-transition: left 70ms linear; } -div.ui-slider-labelbg { position: absolute; top:0; margin: 0; border-width: 0; } -div.ui-slider-switch div.ui-slider-labelbg-a { width: 60%; height: 100%; left: 0; } -div.ui-slider-switch div.ui-slider-labelbg-b { width: 60%; height: 100%; right: 0; } -.ui-slider-switch-a div.ui-slider-labelbg-a, .ui-slider-switch-b div.ui-slider-labelbg-b { z-index: -1; } -.ui-slider-switch-a div.ui-slider-labelbg-b, .ui-slider-switch-b div.ui-slider-labelbg-a { z-index: 0; } - -div.ui-slider-switch a.ui-slider-handle { z-index: 20; width: 101%; height: 32px; margin-top: -18px; margin-left: -101%; } -span.ui-slider-label { width: 100%; position: absolute;height: 32px; font-size: 16px; text-align: center; line-height: 2; background: none; border-color: transparent; } -span.ui-slider-label-a { left: -100%; margin-right: -1px } -span.ui-slider-label-b { right: -100%; margin-left: -1px } + .ui-field-contain div.ui-slider-switch { width: 5.5em; } +} +div.ui-slider-switch { height: 32px; margin-left: 0; width: 5.8em; } +a.ui-slider-handle-snapping { -webkit-transition: left 70ms linear; -moz-transition: left 70ms linear; } +div.ui-slider-switch .ui-slider-handle { margin-top: 1px; } +.ui-slider-inneroffset { margin: 0 16px; position: relative; z-index: 1; } +div.ui-slider-switch.ui-slider-mini { width: 5em; height: 29px; } +div.ui-slider-switch.ui-slider-mini .ui-slider-inneroffset { margin: 0 15px 0 14px; } +div.ui-slider-switch.ui-slider-mini .ui-slider-handle { width: 25px; height: 25px; margin: 1px 0 0 -13px; } +div.ui-slider-switch.ui-slider-mini a.ui-slider-handle .ui-btn-inner { height: 30px; width: 30px; padding: 0; margin: 0; } +span.ui-slider-label { position: absolute; text-align: center; width: 100%; overflow: hidden; font-size: 16px; top: 0; line-height: 2; min-height: 100%; border-width: 0; white-space: nowrap; } +.ui-slider-mini span.ui-slider-label { font-size: 14px; } +span.ui-slider-label-a { z-index: 1; left: 0; text-indent: -1.5em; } +span.ui-slider-label-b { z-index: 0; right: 0; text-indent: 1.5em;} +.ui-slider-inline { width: 120px; display: inline-block; } diff --git a/theme/mymobile/style/media.css b/theme/mymobile/style/media.css index 151b1005c0b..0017ee768d0 100644 --- a/theme/mymobile/style/media.css +++ b/theme/mymobile/style/media.css @@ -41,6 +41,9 @@ .path-mod-forum div.subject { font-size: 100%; } + .path-mod-forum .indent { + margin-left: 0px; + } } @media all and (max-width: 650px){ .forumpost div.commands a { diff --git a/theme/mymobile/version.php b/theme/mymobile/version.php index df6198aa955..8fd712ed48a 100644 --- a/theme/mymobile/version.php +++ b/theme/mymobile/version.php @@ -26,7 +26,7 @@ defined('MOODLE_INTERNAL') || die; -$plugin->version = 2012061700; // The current module version (Date: YYYYMMDDXX) -$plugin->requires = 2012061700; // Requires this Moodle version +$plugin->version = 2012061901; // The current module version (Date: YYYYMMDDXX) +$plugin->requires = 2011070101; // Requires this Moodle version $plugin->component = 'theme_mymobile'; $plugin->maturity = MATURITY_STABLE; \ No newline at end of file diff --git a/theme/standard/style/question.css b/theme/standard/style/question.css index 2010021e07a..0a2daad679d 100644 --- a/theme/standard/style/question.css +++ b/theme/standard/style/question.css @@ -12,8 +12,6 @@ #chooseqtype .qtypename {font-weight: bold;} #qtypechoicecontainer #chooseqtype .qtypename {font-weight: normal;} -#qtypechoicecontainer #chooseqtype .qtypes {border-bottom-color: gray;} -#qtypechoicecontainer #chooseqtype .selected {background: #dddddd;} #qtypechoicecontainer #chooseqtype .instruction, #qtypechoicecontainer #chooseqtype .qtypesummary {border-left-color: gray;} diff --git a/user/edit.php b/user/edit.php index 6fa160819e9..ca52ed30746 100644 --- a/user/edit.php +++ b/user/edit.php @@ -153,7 +153,19 @@ $editoroptions = array( ); $user = file_prepare_standard_editor($user, 'description', $editoroptions, $personalcontext, 'user', 'profile', 0); -$userform = new user_edit_form(null, array('editoroptions'=>$editoroptions)); +// Prepare filemanager draft area. +$draftitemid = 0; +$filemanagercontext = $editoroptions['context']; +$filemanageroptions = array('maxbytes' => $CFG->maxbytes, + 'subdirs' => 0, + 'maxfiles' => 1, + 'accepted_types' => 'web_image'); +file_prepare_draft_area($draftitemid, $filemanagercontext->id, 'user', 'newicon', 0, $filemanageroptions); +$user->imagefile = $draftitemid; +//create form +$userform = new user_edit_form(null, array( + 'editoroptions' => $editoroptions, + 'filemanageroptions' => $filemanageroptions)); if (empty($user->country)) { // MDL-16308 - we must unset the value here so $CFG->country can be used as default one unset($user->country); @@ -211,7 +223,7 @@ if ($usernew = $userform->get_data()) { //update user picture if (!empty($CFG->gdversion) and empty($CFG->disableuserimages)) { - useredit_update_picture($usernew, $userform); + useredit_update_picture($usernew, $userform, $filemanageroptions); } // update mail bounces diff --git a/user/edit_form.php b/user/edit_form.php index 2fdfe1e596e..e53672fe7fa 100644 --- a/user/edit_form.php +++ b/user/edit_form.php @@ -18,6 +18,11 @@ class user_edit_form extends moodleform { } else { $editoroptions = null; } + if (is_array($this->_customdata) && array_key_exists('filemanageroptions', $this->_customdata)) { + $filemanageroptions = $this->_customdata['filemanageroptions']; + } else { + $filemanageroptions = null; + } //Accessibility: "Required" is bad legend text. $strgeneral = get_string('general'); $strrequired = get_string('required'); @@ -32,7 +37,7 @@ class user_edit_form extends moodleform { $mform->addElement('header', 'moodle', $strgeneral); /// shared fields - useredit_shared_definition($mform, $editoroptions); + useredit_shared_definition($mform, $editoroptions, $filemanageroptions); /// extra settigs if (!empty($CFG->gdversion) and !empty($CFG->disableuserimages)) { diff --git a/user/editadvanced.php b/user/editadvanced.php index 3c660d7f546..5226c0a54e9 100644 --- a/user/editadvanced.php +++ b/user/editadvanced.php @@ -134,8 +134,19 @@ if ($user->id !== -1) { ); } +// Prepare filemanager draft area. +$draftitemid = 0; +$filemanagercontext = $editoroptions['context']; +$filemanageroptions = array('maxbytes' => $CFG->maxbytes, + 'subdirs' => 0, + 'maxfiles' => 1, + 'accepted_types' => 'web_image'); +file_prepare_draft_area($draftitemid, $filemanagercontext->id, 'user', 'newicon', 0, $filemanageroptions); +$user->imagefile = $draftitemid; //create form -$userform = new user_editadvanced_form(null, array('editoroptions'=>$editoroptions)); +$userform = new user_editadvanced_form(null, array( + 'editoroptions' => $editoroptions, + 'filemanageroptions' => $filemanageroptions)); $userform->set_data($user); if ($usernew = $userform->get_data()) { @@ -203,7 +214,7 @@ if ($usernew = $userform->get_data()) { //update user picture if (!empty($CFG->gdversion) and empty($USER->newadminuser)) { - useredit_update_picture($usernew, $userform); + useredit_update_picture($usernew, $userform, $filemanageroptions); } // update mail bounces diff --git a/user/editadvanced_form.php b/user/editadvanced_form.php index 58ab2a0d0a0..7092f021a87 100644 --- a/user/editadvanced_form.php +++ b/user/editadvanced_form.php @@ -19,6 +19,11 @@ class user_editadvanced_form extends moodleform { } else { $editoroptions = null; } + if (is_array($this->_customdata) && array_key_exists('filemanageroptions', $this->_customdata)) { + $filemanageroptions = $this->_customdata['filemanageroptions']; + } else { + $filemanageroptions = null; + } //Accessibility: "Required" is bad legend text. $strgeneral = get_string('general'); @@ -58,7 +63,7 @@ class user_editadvanced_form extends moodleform { $mform->addElement('advcheckbox', 'preference_auth_forcepasswordchange', get_string('forcepasswordchange')); $mform->addHelpButton('preference_auth_forcepasswordchange', 'forcepasswordchange'); /// shared fields - useredit_shared_definition($mform, $editoroptions); + useredit_shared_definition($mform, $editoroptions, $filemanageroptions); /// Next the customisable profile fields profile_definition($mform); diff --git a/user/editlib.php b/user/editlib.php index 8110f61a898..f229a04509a 100644 --- a/user/editlib.php +++ b/user/editlib.php @@ -42,7 +42,7 @@ function useredit_update_user_preference($usernew) { * @param moodleform $userform The form that was submitted to edit the form * @return bool True if the user was updated, false if it stayed the same. */ -function useredit_update_picture(stdClass $usernew, moodleform $userform) { +function useredit_update_picture(stdClass $usernew, moodleform $userform, $filemanageroptions = array()) { global $CFG, $DB; require_once("$CFG->libdir/gdlib.php"); @@ -50,20 +50,40 @@ function useredit_update_picture(stdClass $usernew, moodleform $userform) { $user = $DB->get_record('user', array('id'=>$usernew->id), 'id, picture', MUST_EXIST); $newpicture = $user->picture; - + // Get file_storage to process files. + $fs = get_file_storage(); if (!empty($usernew->deletepicture)) { // The user has chosen to delete the selected users picture - $fs = get_file_storage(); $fs->delete_area_files($context->id, 'user', 'icon'); // drop all images in area $newpicture = 0; - } else if ($iconfile = $userform->save_temp_file('imagefile')) { - // There is a new image that has been uploaded - // Process the new image and set the user to make use of it. - // NOTE: Uploaded images always take over Gravatar - $newpicture = (int)process_new_icon($context, 'user', 'icon', 0, $iconfile); - // Delete the file that has now been processed - @unlink($iconfile); + } else { + // Save newly uploaded file, this will avoid context mismatch for newly created users. + file_save_draft_area_files($usernew->imagefile, $context->id, 'user', 'newicon', 0, $filemanageroptions); + if (($iconfiles = $fs->get_area_files($context->id, 'user', 'newicon')) && count($iconfiles) == 2) { + // Get file which was uploaded in draft area + foreach ($iconfiles as $file) { + if (!$file->is_directory()) { + break; + } + } + // Copy file to temporary location and the send it for processing icon + if ($iconfile = $file->copy_content_to_temp()) { + // There is a new image that has been uploaded + // Process the new image and set the user to make use of it. + // NOTE: Uploaded images always take over Gravatar + $newpicture = (int)process_new_icon($context, 'user', 'icon', 0, $iconfile); + // Delete temporary file + @unlink($iconfile); + // Remove uploaded file. + $fs->delete_area_files($context->id, 'user', 'newicon'); + } else { + // Something went wrong while creating temp file. + // Remove uploaded file. + $fs->delete_area_files($context->id, 'user', 'newicon'); + return false; + } + } } if ($newpicture != $user->picture) { @@ -101,7 +121,7 @@ function useredit_update_interests($user, $interests) { tag_set('user', $user->id, $interests); } -function useredit_shared_definition(&$mform, $editoroptions = null) { +function useredit_shared_definition(&$mform, $editoroptions = null, $filemanageroptions = null) { global $CFG, $USER, $DB; $user = $DB->get_record('user', array('id' => $USER->id)); @@ -196,16 +216,6 @@ function useredit_shared_definition(&$mform, $editoroptions = null) { $mform->setType('htmleditor', PARAM_INT); } - if (empty($CFG->enableajax)) { - $mform->addElement('static', 'ajaxdisabled', get_string('ajaxuse'), get_string('ajaxno')); - } else { - $choices = array(); - $choices['0'] = get_string('ajaxno'); - $choices['1'] = get_string('ajaxyes'); - $mform->addElement('select', 'ajax', get_string('ajaxuse'), $choices); - $mform->setDefault('ajax', 1); - } - $choices = array(); $choices['0'] = get_string('screenreaderno'); $choices['1'] = get_string('screenreaderyes'); @@ -268,7 +278,7 @@ function useredit_shared_definition(&$mform, $editoroptions = null) { $mform->addElement('checkbox', 'deletepicture', get_string('delete')); $mform->setDefault('deletepicture', 0); - $mform->addElement('filepicker', 'imagefile', get_string('newpicture'), '', array('maxbytes'=>get_max_upload_file_size($CFG->maxbytes))); + $mform->addElement('filemanager', 'imagefile', get_string('newpicture'), '', $filemanageroptions); $mform->addHelpButton('imagefile', 'newpicture'); $mform->addElement('text', 'imagealt', get_string('imagealt'), 'maxlength="100" size="30"'); diff --git a/version.php b/version.php index 2d8e83a16d2..390c8de75e2 100644 --- a/version.php +++ b/version.php @@ -30,11 +30,11 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2012061800.00; // YYYYMMDD = weekly release date of this DEV branch +$version = 2012062500.00; // YYYYMMDD = weekly release date of this DEV branch // RR = release increments - 00 in DEV branches // .XX = incremental changes -$release = '2.3beta (Build: 20120618)';// Human-friendly version name +$release = '2.4dev (Build: 20120625)'; // Human-friendly version name -$branch = '23'; // this version's branch -$maturity = MATURITY_BETA; // this version's maturity level +$branch = '24'; // this version's branch +$maturity = MATURITY_ALPHA; // this version's maturity level