Skip to content

Commit

Permalink
MDL-19690 - lots more $CFG->pixpath to $OUTPUT->old_icon_url
Browse files Browse the repository at this point in the history
  • Loading branch information
tjhunt committed Jul 2, 2009
1 parent 6b608f8 commit f2a1963
Show file tree
Hide file tree
Showing 38 changed files with 114 additions and 114 deletions.
8 changes: 4 additions & 4 deletions lib/adminlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -4917,7 +4917,7 @@ public function is_related($query) {
* @return string XHTML to display the control
*/
public function output_html($data, $query='') {
global $CFG;
global $CFG, $OUTPUT;

$output = print_box_start('generalbox','',true);

Expand All @@ -4944,10 +4944,10 @@ public function output_html($data, $query='') {

foreach ($instances as $i) {
$row = '';
$row .= '<a href="' . $this->baseurl . '&edit=' . $i->get('id') . '"><img src="' . $CFG->pixpath . '/t/edit.gif" alt="' . get_string('edit') . '" /></a>' . "\n";
$row .= '<a href="' . $this->baseurl . '&delete=' . $i->get('id') . '"><img src="' . $CFG->pixpath . '/t/delete.gif" alt="' . get_string('delete') . '" /></a>' . "\n";
$row .= '<a href="' . $this->baseurl . '&edit=' . $i->get('id') . '"><img src="' . $OUTPUT->old_icon_url('t/edit') . '" alt="' . get_string('edit') . '" /></a>' . "\n";
$row .= '<a href="' . $this->baseurl . '&delete=' . $i->get('id') . '"><img src="' . $OUTPUT->old_icon_url('t/delete') . '" alt="' . get_string('delete') . '" /></a>' . "\n";
if (array_key_exists($i->get('plugin'), $insane) || array_key_exists($i->get('id'), $insaneinstances)) {
$row .= '<img src="' . $CFG->pixpath . '/t/show.gif" alt="' . get_string('hidden', 'portfolio') . '" />' . "\n";
$row .= '<img src="' . $OUTPUT->old_icon_url('t/show') . '" alt="' . get_string('hidden', 'portfolio') . '" />' . "\n";
} else {
$row .= ' <a href="' . $this->baseurl . '&hide=' . $i->get('id') . '"><img src="' . $CFG->pixpath . '/t/'
. ($i->get('visible') ? 'hide' : 'show') . '.gif" alt="' . get_string($i->get('visible') ? 'hide' : 'show') . '" /></a>' . "\n";
Expand Down
10 changes: 5 additions & 5 deletions lib/portfoliolib.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public function to_html($format=null, $addstr=null) {
if ($this->alreadyexporting) {
return $this->already_exporting($format, $addstr);
}
global $CFG, $COURSE;
global $CFG, $COURSE, $OUTPUT;
if (!$this->is_renderable()) {
return;
}
Expand Down Expand Up @@ -268,11 +268,11 @@ public function to_html($format=null, $addstr=null) {
break;
case PORTFOLIO_ADD_ICON_FORM:
$formoutput .= $selectoutput;
$formoutput .= "\n" . '<input type="image" src="' . $CFG->pixpath . '/t/portfolio.gif" alt=' . $addstr .'" />';
$formoutput .= "\n" . '<input type="image" src="' . $OUTPUT->old_icon_url('t/portfolio') . '" alt=' . $addstr .'" />';
$formoutput .= "\n" . '</form>';
break;
case PORTFOLIO_ADD_ICON_LINK:
$linkoutput .= '"><img src="' . $CFG->pixpath . '/t/portfolio.gif" alt=' . $addstr .'" /></a>';
$linkoutput .= '"><img src="' . $OUTPUT->old_icon_url('t/portfolio') . '" alt=' . $addstr .'" /></a>';
break;
case PORTFOLIO_ADD_TEXT_LINK:
$linkoutput .= '">' . $addstr .'</a>';
Expand Down Expand Up @@ -338,9 +338,9 @@ public function get_callbackclass() {
}

private function already_exporting($format, $addstr) {
global $CFG;
global $CFG, $OUTPUT;
$url = $CFG->wwwroot . '/portfolio/already.php';
$icon = $CFG->pixpath . '/t/portfoliono.gif';
$icon = $OUTPUT->old_icon_url('t/portfoliono') . '';
$alt = get_string('alreadyalt', 'portfolio');
if (empty($format)) {
$format = PORTFOLIO_ADD_FULL_FORM;
Expand Down
10 changes: 5 additions & 5 deletions lib/rsslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*/
function rss_get_link($courseid, $userid, $modulename, $id, $tooltiptext='') {

global $CFG, $USER;
global $OUTPUT;

static $pixpath = '';
static $rsspath = '';
Expand All @@ -43,7 +43,7 @@ function rss_get_link($courseid, $userid, $modulename, $id, $tooltiptext='') {
}

$rsspath = rss_get_url($courseid, $userid, $modulename, $id);
$rsspix = $CFG->pixpath .'/i/rss.gif';
$rsspix = $OUTPUT->old_icon_url('i/rss');

return '<a href="'. $rsspath .'"><img src="'. $rsspix .'" title="'. strip_tags($tooltiptext) .'" alt="'.get_string('rss').'" /></a>';

Expand Down Expand Up @@ -415,7 +415,7 @@ function rss_full_tag($tag,$level=0,$endline=true,$content,$attributes=null) {
* @param object $context we need the context object to check what the user is allowed to do.
*/
function rss_display_feeds($courseid, $userid, $rssid='', $context) {
global $USER, $CFG, $DB;
global $USER, $CFG, $DB, $OUTPUT;
global $blogid; //hackish, but if there is a blogid it would be good to preserve it

require_once($CFG->libdir.'/tablelib.php');
Expand Down Expand Up @@ -461,11 +461,11 @@ function rss_display_feeds($courseid, $userid, $rssid='', $context) {
|| ($feed->shared && $managesharedfeeds) ) {

$feedicons = '<a href="'. $CFG->wwwroot .'/blocks/rss_client/block_rss_client_action.php?id='. $courseid .'&amp;act=rssedit&amp;rssid='. $feed->id .'&amp;shared='.$feed->shared.'&amp;blogid='. $blogid .'">'.
'<img src="'. $CFG->pixpath .'/t/edit.gif" alt="'. get_string('edit').'" title="'. get_string('edit') .'" /></a>&nbsp;'.
'<img src="'. $OUTPUT->old_icon_url('t/edit') . '" alt="'. get_string('edit').'" title="'. get_string('edit') .'" /></a>&nbsp;'.

'<a href="'. $CFG->wwwroot .'/blocks/rss_client/block_rss_client_action.php?id='. $courseid .'&amp;act=delfeed&amp;rssid='. $feed->id.'&amp;shared='.$feed->shared.'blogid='. $blogid .'"
onclick="return confirm(\''. get_string('deletefeedconfirm', 'block_rss_client') .'\');">'.
'<img src="'. $CFG->pixpath .'/t/delete.gif" alt="'. get_string('delete').'" title="'. get_string('delete') .'" /></a>';
'<img src="'. $OUTPUT->old_icon_url('t/delete') . '" alt="'. get_string('delete').'" title="'. get_string('delete') .'" /></a>';
}
else {
$feedicons = '';
Expand Down
18 changes: 9 additions & 9 deletions lib/tablelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,7 @@ function finish_html(){
* This function is not part of the public api.
*/
function print_headers(){
global $CFG;
global $CFG, $OUTPUT;

echo '<tr>';
foreach($this->columns as $column => $index) {
Expand All @@ -1018,11 +1018,11 @@ function print_headers(){
if($this->is_collapsible) {
if(!empty($this->sess->collapse[$column])) {
// some headers contain < br/> tags, do not include in title
$icon_hide = ' <a href="'.$this->baseurl.$this->request[TABLE_VAR_SHOW].'='.$column.'"><img src="'.$CFG->pixpath.'/t/switch_plus.gif" title="'.get_string('show').' '.strip_tags($this->headers[$index]).'" alt="'.get_string('show').'" /></a>';
$icon_hide = ' <a href="'.$this->baseurl.$this->request[TABLE_VAR_SHOW].'='.$column.'"><img src="'.$OUTPUT->old_icon_url('t/switch_plus') . '" title="'.get_string('show').' '.strip_tags($this->headers[$index]).'" alt="'.get_string('show').'" /></a>';
}
else if($this->headers[$index] !== NULL) {
// some headers contain < br/> tags, do not include in title
$icon_hide = ' <a href="'.$this->baseurl.$this->request[TABLE_VAR_HIDE].'='.$column.'"><img src="'.$CFG->pixpath.'/t/switch_minus.gif" title="'.get_string('hide').' '.strip_tags($this->headers[$index]).'" alt="'.get_string('hide').'" /></a>';
$icon_hide = ' <a href="'.$this->baseurl.$this->request[TABLE_VAR_HIDE].'='.$column.'"><img src="'.$OUTPUT->old_icon_url('t/switch_minus') . '" title="'.get_string('hide').' '.strip_tags($this->headers[$index]).'" alt="'.get_string('hide').'" /></a>';
}
}

Expand All @@ -1041,22 +1041,22 @@ function print_headers(){
if($primary_sort_column == 'firstname') {
$lsortorder = get_string('asc');
if($primary_sort_order == SORT_ASC) {
$icon_sort_first = ' <img src="'.$CFG->pixpath.'/t/down.gif" alt="'.get_string('asc').'" />';
$icon_sort_first = ' <img src="'.$OUTPUT->old_icon_url('t/down') . '" alt="'.get_string('asc').'" />';
$fsortorder = get_string('asc');
}
else {
$icon_sort_first = ' <img src="'.$CFG->pixpath.'/t/up.gif" alt="'.get_string('desc').'" />';
$icon_sort_first = ' <img src="'.$OUTPUT->old_icon_url('t/up') . '" alt="'.get_string('desc').'" />';
$fsortorder = get_string('desc');
}
}
else if($primary_sort_column == 'lastname') {
$fsortorder = get_string('asc');
if($primary_sort_order == SORT_ASC) {
$icon_sort_last = ' <img src="'.$CFG->pixpath.'/t/down.gif" alt="'.get_string('asc').'" />';
$icon_sort_last = ' <img src="'.$OUTPUT->old_icon_url('t/down') . '" alt="'.get_string('asc').'" />';
$lsortorder = get_string('asc');
}
else {
$icon_sort_last = ' <img src="'.$CFG->pixpath.'/t/up.gif" alt="'.get_string('desc').'" />';
$icon_sort_last = ' <img src="'.$OUTPUT->old_icon_url('t/up') . '" alt="'.get_string('desc').'" />';
$lsortorder = get_string('desc');
}
} else {
Expand All @@ -1076,11 +1076,11 @@ function print_headers(){
if($this->is_sortable($column)) {
if($primary_sort_column == $column) {
if($primary_sort_order == SORT_ASC) {
$icon_sort = ' <img src="'.$CFG->pixpath.'/t/down.gif" alt="'.get_string('asc').'" />';
$icon_sort = ' <img src="'.$OUTPUT->old_icon_url('t/down') . '" alt="'.get_string('asc').'" />';
$localsortorder = get_string('asc');
}
else {
$icon_sort = ' <img src="'.$CFG->pixpath.'/t/up.gif" alt="'.get_string('desc').'" />';
$icon_sort = ' <img src="'.$OUTPUT->old_icon_url('t/up') . '" alt="'.get_string('desc').'" />';
$localsortorder = get_string('desc');
}
} else {
Expand Down
4 changes: 2 additions & 2 deletions lib/upgradelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -795,11 +795,11 @@ function upgrade_setup_debug($starting) {
* @global object
*/
function print_upgrade_reload($url) {
global $CFG;
global $OUTPUT;

echo "<br />";
echo '<div class="continuebutton">';
echo '<a href="'.$url.'" title="'.get_string('reload').'" ><img src="'.$CFG->pixpath.'/i/reload.gif" alt="" /> '.get_string('reload').'</a>';
echo '<a href="'.$url.'" title="'.get_string('reload').'" ><img src="'.$OUTPUT->old_icon_url('i/reload') . '" alt="" /> '.get_string('reload').'</a>';
echo '</div><br />';
}

Expand Down
8 changes: 4 additions & 4 deletions lib/weblib.php
Original file line number Diff line number Diff line change
Expand Up @@ -4091,7 +4091,7 @@ function update_categories_search_button($search,$page,$perpage) {
* @return string
*/
function navmenu($course, $cm=NULL, $targetwindow='self') {
global $CFG, $THEME, $USER, $DB;
global $CFG, $THEME, $USER, $DB, $OUTPUT;
require_once($CFG->dirroot . '/course/lib.php'); // Required for get_fast_modinfo

if (empty($THEME->navmenuwidth)) {
Expand Down Expand Up @@ -4204,7 +4204,7 @@ function navmenu($course, $cm=NULL, $targetwindow='self') {
$CFG->frametarget.'onclick="this.target=\''.$CFG->framename.'\';"'.' href="'.
$CFG->wwwroot.'/course/report/log/index.php?chooselog=1&amp;user=0&amp;date=0&amp;id='.
$course->id.'&amp;modid='.$selectmod->id.'">'.
'<img class="icon log" src="'.$CFG->pixpath.'/i/log.gif" alt="'.$logstext.'" /></a>'."\n".'</li>';
'<img class="icon log" src="'.$OUTPUT->old_icon_url('i/log') . '" alt="'.$logstext.'" /></a>'."\n".'</li>';

}
if ($backmod) {
Expand Down Expand Up @@ -4737,11 +4737,11 @@ function helpbutton($page, $title, $module='moodle', $image=true, $linktext=fals
*/
function emoticonhelpbutton($form, $field, $return = false) {

global $CFG, $SESSION;
global $SESSION, $OUTPUT;

$SESSION->inserttextform = $form;
$SESSION->inserttextfield = $field;
$imagetext = '<img src="' . $CFG->pixpath . '/s/smiley.gif" alt="" class="emoticon" style="margin-left:3px; padding-right:1px;width:15px;height:15px;" />';
$imagetext = '<img src="' . $OUTPUT->old_icon_url('s/smiley') . '" alt="" class="emoticon" style="margin-left:3px; padding-right:1px;width:15px;height:15px;" />';
$help = helpbutton('emoticons2', get_string('helpemoticons'), 'moodle', true, true, '', true, $imagetext);
if (!$return){
echo $help;
Expand Down
6 changes: 3 additions & 3 deletions message/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ function message_contact_link($userid, $linktype='add', $return=false, $script="
}

function message_history_link($userid1, $userid2=0, $returnstr=false, $keywords='', $position='', $linktext='') {
global $USER, $CFG;
global $USER, $CFG, $OUTPUT;

static $strmessagehistory;

Expand All @@ -587,9 +587,9 @@ function message_history_link($userid1, $userid2=0, $returnstr=false, $keywords=
}

if ($linktext == 'icon') { // Icon only
$fulllink = '<img src="'.$CFG->pixpath.'/t/log.gif" class="iconsmall" alt="'.$strmessagehistory.'" />';
$fulllink = '<img src="'.$OUTPUT->old_icon_url('t/log') . '" class="iconsmall" alt="'.$strmessagehistory.'" />';
} else if ($linktext == 'both') { // Icon and standard name
$fulllink = '<img src="'.$CFG->pixpath.'/t/log.gif" class="iconsmall" alt="" />';
$fulllink = '<img src="'.$OUTPUT->old_icon_url('t/log') . '" class="iconsmall" alt="" />';
$fulllink .= '&nbsp;'.$strmessagehistory;
} else if ($linktext) { // Custom name
$fulllink = $linktext;
Expand Down
8 changes: 4 additions & 4 deletions mod/assignment/type/online/assignment.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,12 @@ function update_submission($data) {


function print_student_answer($userid, $return=false){
global $CFG;
global $OUTPUT;
if (!$submission = $this->get_submission($userid)) {
return '';
}
$output = '<div class="files">'.
'<img src="'.$CFG->pixpath.'/f/html.gif" class="icon" alt="html" />'.
'<img src="'.$OUTPUT->old_icon_url('f/html') . '" class="icon" alt="html" />'.
link_to_popup_window ('/mod/assignment/type/online/file.php?id='.$this->cm->id.'&amp;userid='.
$submission->userid, 'file'.$userid, shorten_text(trim(strip_tags(format_text($submission->data1,$submission->data2))), 15), 450, 580,
get_string('submission', 'assignment'), 'none', true).
Expand All @@ -196,14 +196,14 @@ function print_student_answer($userid, $return=false){
}

function print_user_files($userid, $return=false) {
global $CFG;
global $OUTPUT;

if (!$submission = $this->get_submission($userid)) {
return '';
}

$output = '<div class="files">'.
'<img align="middle" src="'.$CFG->pixpath.'/f/html.gif" height="16" width="16" alt="html" />'.
'<img align="middle" src="'.$OUTPUT->old_icon_url('f/html') . '" height="16" width="16" alt="html" />'.
link_to_popup_window ('/mod/assignment/type/online/file.php?id='.$this->cm->id.'&amp;userid='.
$submission->userid, 'file'.$userid, shorten_text(trim(strip_tags(format_text($submission->data1,$submission->data2))), 15), 450, 580,
get_string('submission', 'assignment'), 'none', true).
Expand Down
8 changes: 4 additions & 4 deletions mod/assignment/type/upload/assignment.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ function print_student_answer($userid, $return=false){
* @return string optional
*/
function print_user_files($userid=0, $return=false) {
global $CFG, $USER;
global $CFG, $USER, $OUTPUT;

$mode = optional_param('mode', '', PARAM_ALPHA);
$offset = optional_param('offset', 0, PARAM_INT);
Expand Down Expand Up @@ -354,7 +354,7 @@ function print_user_files($userid=0, $return=false) {
$delurl = "$CFG->wwwroot/mod/assignment/delete.php?id={$this->cm->id}&amp;file=".rawurlencode($filename)."&amp;userid={$submission->userid}&amp;mode=$mode&amp;offset=$offset";

$output .= '<a href="'.$delurl.'">&nbsp;'
.'<img title="'.$strdelete.'" src="'.$CFG->pixpath.'/t/delete.gif" class="iconsmall" alt="" /></a> ';
.'<img title="'.$strdelete.'" src="'.$OUTPUT->old_icon_url('t/delete') . '" class="iconsmall" alt="" /></a> ';
}

if (has_capability('mod/assignment:exportownsubmission', $this->context)) {
Expand Down Expand Up @@ -390,7 +390,7 @@ function print_user_files($userid=0, $return=false) {
}

function print_responsefiles($userid, $return=false) {
global $CFG, $USER;
global $CFG, $USER, $OUTPUT;

$mode = optional_param('mode', '', PARAM_ALPHA);
$offset = optional_param('offset', 0, PARAM_INT);
Expand All @@ -417,7 +417,7 @@ function print_responsefiles($userid, $return=false) {
$delurl = "$CFG->wwwroot/mod/assignment/delete.php?id={$this->cm->id}&amp;file=".rawurlencode($filename)."&amp;userid=$userid&amp;mode=$mode&amp;offset=$offset&amp;action=response";

$output .= '<a href="'.$delurl.'">&nbsp;'
.'<img title="'.$strdelete.'" src="'.$CFG->pixpath.'/t/delete.gif" class="iconsmall" alt=""/></a> ';
.'<img title="'.$strdelete.'" src="'.$OUTPUT->old_icon_url('t/delete') . '" class="iconsmall" alt=""/></a> ';
}

$output .= '&nbsp;';
Expand Down
4 changes: 2 additions & 2 deletions mod/data/field.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,10 @@
shorten_text($field->field->description, 30),

'<a href="field.php?d='.$data->id.'&amp;mode=display&amp;fid='.$field->field->id.'&amp;sesskey='.sesskey().'">'.
'<img src="'.$CFG->pixpath.'/t/edit.gif" class="iconsmall" alt="'.get_string('edit').'" title="'.get_string('edit').'" /></a>'.
'<img src="'.$OUTPUT->old_icon_url('t/edit') . '" class="iconsmall" alt="'.get_string('edit').'" title="'.get_string('edit').'" /></a>'.
'&nbsp;'.
'<a href="field.php?d='.$data->id.'&amp;mode=delete&amp;fid='.$field->field->id.'&amp;sesskey='.sesskey().'">'.
'<img src="'.$CFG->pixpath.'/t/delete.gif" class="iconsmall" alt="'.get_string('delete').'" title="'.get_string('delete').'" /></a>'
'<img src="'.$OUTPUT->old_icon_url('t/delete') . '" class="iconsmall" alt="'.get_string('delete').'" title="'.get_string('delete').'" /></a>'

);
}
Expand Down
Loading

0 comments on commit f2a1963

Please sign in to comment.