From 47a2c30b67311d469b46fdefb1a0cfb05b893ef9 Mon Sep 17 00:00:00 2001 From: scyrma Date: Thu, 19 Jun 2008 09:21:45 +0000 Subject: [PATCH] MDL-15310: removing unused variable, old commented code and adding a small adjustment to the tag code. --- blog/edit.php | 1 - blog/edit_form.php | 14 +++----------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/blog/edit.php b/blog/edit.php index a0f9d0a4ef..21b863d853 100755 --- a/blog/edit.php +++ b/blog/edit.php @@ -156,7 +156,6 @@ function do_delete($post) { global $returnurl, $DB; $status = $DB->delete_records('post', array('id'=>$post->id)); - //$status = $DB->delete_records('blog_tag_instance', array('entryid'=>$post->id)) and $status; tag_set('post', $post->id, array()); blog_delete_old_attachments($post); diff --git a/blog/edit_form.php b/blog/edit_form.php index 499f22ea88..4d47139b9f 100644 --- a/blog/edit_form.php +++ b/blog/edit_form.php @@ -37,15 +37,6 @@ class blog_edit_form extends moodleform { $mform->addElement('header', 'tagshdr', get_string('tags', 'tag')); $mform->createElement('select', 'otags', get_string('otags','tag')); - $js_escape = array( - "\r" => '\r', - "\n" => '\n', - "\t" => '\t', - "'" => "\\'", - '"' => '\"', - '\\' => '\\\\' - ); - $otagsselEl =& $mform->addElement('select', 'otags', get_string('otags', 'tag'), array(), 'size="5"'); $otagsselEl->setMultiple(true); $this->otags_select_setup(); @@ -75,16 +66,17 @@ class blog_edit_form extends moodleform { * */ function otags_select_setup(){ - global $CFG, $DB; + global $DB; $mform =& $this->_form; if ($otagsselect =& $mform->getElement('otags')) { $otagsselect->removeOptions(); } $namefield = empty($CFG->keeptagnamecase) ? 'name' : 'rawname'; - if ($otags = $DB->get_records_sql_menu("SELECT id, $namefield FROM {tag} WHERE tagtype='official' ORDER by name ASC")){ + if ($otags = $DB->get_records_sql_menu("SELECT id, $namefield FROM {tag} WHERE tagtype='official' ORDER by $namefield ASC")) { $otagsselect->loadArray($otags); } + } } -- 2.39.5