Zeile 6 | Zeile 6 |
---|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: templates.php 5150 2010-07-31 01:46:18Z RyanGordon $
| * $Id: templates.php 5380 2011-02-21 12:04:43Z Tomm $
|
*/
// Disallow direct access to this file for security reasons
| */
// Disallow direct access to this file for security reasons
|
Zeile 614 | Zeile 614 |
---|
// Select all templates with that search term $query = $db->query("
|
// Select all templates with that search term $query = $db->query("
|
SELECT t.tid, t.title, t.sid
| SELECT t.tid, t.title, t.sid, t.template
|
FROM ".TABLE_PREFIX."templates t LEFT JOIN ".TABLE_PREFIX."templatesets s ON (t.sid=s.sid) LEFT JOIN ".TABLE_PREFIX."templates t2 ON (t.title=t2.title AND t2.sid='1')
| FROM ".TABLE_PREFIX."templates t LEFT JOIN ".TABLE_PREFIX."templatesets s ON (t.sid=s.sid) LEFT JOIN ".TABLE_PREFIX."templates t2 ON (t.title=t2.title AND t2.sid='1')
|
Zeile 1045 | Zeile 1045 |
---|
{ $popup = new PopupMenu("template_{$template['tid']}", $lang->options); $popup->add_item($lang->full_edit, "index.php?module=style-templates&action=edit_template&title=".urlencode($template['title'])."&sid={$sid}&from=diff_report");
|
{ $popup = new PopupMenu("template_{$template['tid']}", $lang->options); $popup->add_item($lang->full_edit, "index.php?module=style-templates&action=edit_template&title=".urlencode($template['title'])."&sid={$sid}&from=diff_report");
|
$popup->add_item($lang->diff_report, "index.php?module=style-templates&action=diff_report&title=".urlencode($template['title'])."&sid1=".$template['sid']."&sid2=-2");
| $popup->add_item($lang->diff_report, "index.php?module=style-templates&action=diff_report&title=".urlencode($template['title'])."&sid1=".$template['sid']."&sid2=-2&from=diff_report");
|
$popup->add_item($lang->revert_to_orig, "index.php?module=style-templates&action=revert&title=".urlencode($template['title'])."&sid={$sid}&from=diff_report&my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_template_revertion}')"); $table->construct_cell("<a href=\"index.php?module=style-templates&action=edit_template&title=".urlencode($template['title'])."&sid={$sid}&from=diff_report\">{$template['title']}</a>", array('width' => '80%'));
| $popup->add_item($lang->revert_to_orig, "index.php?module=style-templates&action=revert&title=".urlencode($template['title'])."&sid={$sid}&from=diff_report&my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_template_revertion}')"); $table->construct_cell("<a href=\"index.php?module=style-templates&action=edit_template&title=".urlencode($template['title'])."&sid={$sid}&from=diff_report\">{$template['title']}</a>", array('width' => '80%'));
|
Zeile 1184 | Zeile 1184 |
---|
'title' => $lang->find_updated, 'link' => "index.php?module=style-templates&action=find_updated" );
|
'title' => $lang->find_updated, 'link' => "index.php?module=style-templates&action=find_updated" );
|
| }
if(!$mybb->input['from']) { $mybb->input['from'] = 0;
|
} $sub_tabs['diff_report'] = array( 'title' => $lang->diff_report,
|
} $sub_tabs['diff_report'] = array( 'title' => $lang->diff_report,
|
'link' => "index.php?module=style-templates&action=diff_report&title=".$db->escape_string($mybb->input['title'])."&sid1=".intval($mybb->input['sid1'])."&sid2=".intval($mybb->input['sid2']),
| 'link' => "index.php?module=style-templates&action=diff_report&title=".$db->escape_string($mybb->input['title'])."&from=".$mybb->input['from']."sid1=".intval($mybb->input['sid1'])."&sid2=".intval($mybb->input['sid2']),
|
'description' => $lang->diff_report_desc );
|
'description' => $lang->diff_report_desc );
|
|
|
$plugins->run_hooks("admin_style_templates_diff_report"); $query = $db->simple_select("templates", "*", "title='".$db->escape_string($mybb->input['title'])."' AND sid='".intval($mybb->input['sid1'])."'"); $template1 = $db->fetch_array($query);
|
$plugins->run_hooks("admin_style_templates_diff_report"); $query = $db->simple_select("templates", "*", "title='".$db->escape_string($mybb->input['title'])."' AND sid='".intval($mybb->input['sid1'])."'"); $template1 = $db->fetch_array($query);
|
|
|
$query = $db->simple_select("templates", "*", "title='".$db->escape_string($mybb->input['title'])."' AND sid='".intval($mybb->input['sid2'])."'"); $template2 = $db->fetch_array($query); if($mybb->input['sid2'] == -2)
|
$query = $db->simple_select("templates", "*", "title='".$db->escape_string($mybb->input['title'])."' AND sid='".intval($mybb->input['sid2'])."'"); $template2 = $db->fetch_array($query); if($mybb->input['sid2'] == -2)
|
{
| {
|
$sub_tabs['full_edit'] = array( 'title' => $lang->full_edit, 'link' => "index.php?module=style-templates&action=edit_template&title=".urlencode($template1['title'])."&sid=".intval($mybb->input['sid1'])."&from=diff_report", );
|
$sub_tabs['full_edit'] = array( 'title' => $lang->full_edit, 'link' => "index.php?module=style-templates&action=edit_template&title=".urlencode($template1['title'])."&sid=".intval($mybb->input['sid1'])."&from=diff_report", );
|
}
| }
|
if($template1['template'] == $template2['template']) {
| if($template1['template'] == $template2['template']) {
|
Zeile 1227 | Zeile 1232 |
---|
if($sid) { $page->add_breadcrumb_item($template_sets[$sid], "index.php?module=style-templates&sid={$sid}{$expand_str}");
|
if($sid) { $page->add_breadcrumb_item($template_sets[$sid], "index.php?module=style-templates&sid={$sid}{$expand_str}");
|
}
| }
|
if($mybb->input['sid2'] == -2) { $page->add_breadcrumb_item($lang->find_updated, "index.php?module=style-templates&action=find_updated");
|
if($mybb->input['sid2'] == -2) { $page->add_breadcrumb_item($lang->find_updated, "index.php?module=style-templates&action=find_updated");
|
} $page->add_breadcrumb_item($lang->diff_report.": ".$template1['title'], "index.php?module=style-templates&action=diff_report&title=".$db->escape_string($mybb->input['title'])."&sid1=".intval($mybb->input['sid1'])."&sid2=".intval($mybb->input['sid2']));
| } $page->add_breadcrumb_item($lang->diff_report.": ".$template1['title'], "index.php?module=style-templates&action=diff_report&title=".$db->escape_string($mybb->input['title'])."&from=".$mybb->input['from']."&sid1=".intval($mybb->input['sid1'])."&sid2=".intval($mybb->input['sid2']));
|
$page->output_header($lang->template_sets);
|
$page->output_header($lang->template_sets);
|
$page->output_nav_tabs($sub_tabs, 'diff_report');
| $page->output_nav_tabs($sub_tabs, 'diff_report');
|
$table = new Table;
|
$table = new Table;
|
$table->construct_header("<ins>".$lang->master_updated_ins."</ins><br /><del>".$lang->master_updated_del."</del>");
| if($mybb->input['from']) { $table->construct_header("<ins>".$lang->master_updated_ins."</ins><br /><del>".$lang->master_updated_del."</del>"); } else { $table->construct_header("<ins>".$lang->master_updated_del."</ins><br /><del>".$lang->master_updated_ins."</del>"); }
|
$table->construct_cell("<pre class=\"differential\">".$renderer->render($diff)."</pre>"); $table->construct_row();
| $table->construct_cell("<pre class=\"differential\">".$renderer->render($diff)."</pre>"); $table->construct_row();
|
Zeile 1255 | Zeile 1267 |
---|
if($mybb->input['action'] == "revert") { $plugins->run_hooks("admin_style_templates_revert");
|
if($mybb->input['action'] == "revert") { $plugins->run_hooks("admin_style_templates_revert");
|
|
|
$query = $db->query(" SELECT t.*, s.title as set_title FROM ".TABLE_PREFIX."templates t
| $query = $db->query(" SELECT t.*, s.title as set_title FROM ".TABLE_PREFIX."templates t
|
Zeile 1269 | Zeile 1281 |
---|
{ flash_message($lang->error_invalid_template, 'error'); admin_redirect("index.php?module=style-templates");
|
{ flash_message($lang->error_invalid_template, 'error'); admin_redirect("index.php?module=style-templates");
|
}
| }
|
// User clicked no if($mybb->input['no'])
|
// User clicked no if($mybb->input['no'])
|
{
| {
|
admin_redirect("index.php?module=style-templates&sid={$template['sid']}{$expand_str2}"); }
| admin_redirect("index.php?module=style-templates&sid={$template['sid']}{$expand_str2}"); }
|
Zeile 1283 | Zeile 1295 |
---|
$db->delete_query("templates", "tid='{$template['tid']}'"); $plugins->run_hooks("admin_style_templates_revert_commit");
|
$db->delete_query("templates", "tid='{$template['tid']}'"); $plugins->run_hooks("admin_style_templates_revert_commit");
|
|
|
// Log admin action log_admin_action($template['tid'], $template['sid'], $template['sid'], $template['set_title']);
| // Log admin action log_admin_action($template['tid'], $template['sid'], $template['sid'], $template['set_title']);
|
Zeile 1309 | Zeile 1321 |
---|
$plugins->run_hooks("admin_style_templates_set"); $table = new Table;
|
$plugins->run_hooks("admin_style_templates_set"); $table = new Table;
|
$page->extra_header .= '<script type="text/javascript"> Event.observe(document, "dom:loaded", function() { var lastelement = \'\'; link_preview_template_list = $$(\'a.preview_template_list\'); link_preview_template_list.each(function(element) { Event.observe(element, "mouseover", function(event) { if(lastelement != \'\') { $(lastelement).hide(); } listelement = Event.element(event); $(listelement.id.replace("preview_", "")).show(); lastelement = listelement.id.replace("preview_", ""); } ); Event.observe(element, "mouseout", function(event) { listelement = Event.element(event); $(listelement.id.replace("preview_", "")).hide(); lastelement = \'\'; } ); }); }); </script>';
| |
$page->add_breadcrumb_item($template_sets[$sid], "index.php?module=style-templates&sid={$sid}");
| $page->add_breadcrumb_item($template_sets[$sid], "index.php?module=style-templates&sid={$sid}");
|
Zeile 1401 | Zeile 1401 |
---|
if(isset($template_groups[$exploded[0]])) { $group = $exploded[0];
|
if(isset($template_groups[$exploded[0]])) { $group = $exploded[0];
|
} else
| } else
|
{ $group = -1; }
| { $group = -1; }
|
Zeile 1418 | Zeile 1418 |
---|
if($template['sid'] != -2) { $template['original'] = false;
|
if($template['sid'] != -2) { $template['original'] = false;
|
$template['modified'] = false;
| $template['modified'] = false;
|
$template_groups[$group]['templates'][$template['title']] = $template; } else if(!in_array($template['gid'], $expand_array) && !isset($expand_array[-1]))
| $template_groups[$group]['templates'][$template['title']] = $template; } else if(!in_array($template['gid'], $expand_array) && !isset($expand_array[-1]))
|
Zeile 1443 | Zeile 1443 |
---|
else if($template_groups[$group]['templates'][$template['title']]['template'] != $template['template'] && $template_groups[$group]['templates'][$template['title']]['sid'] != -2) { $template_groups[$group]['templates'][$template['title']]['modified'] = true;
|
else if($template_groups[$group]['templates'][$template['title']]['template'] != $template['template'] && $template_groups[$group]['templates'][$template['title']]['sid'] != -2) { $template_groups[$group]['templates'][$template['title']]['modified'] = true;
|
}
| }
|
// Save some memory! unset($template_groups[$group]['templates'][$template['title']]['template']);
| // Save some memory! unset($template_groups[$group]['templates'][$template['title']]['template']);
|
Zeile 1524 | Zeile 1524 |
---|
} else if(isset($group['templates']) && count($group['templates']) > 0) {
|
} else if(isset($group['templates']) && count($group['templates']) > 0) {
|
$table->construct_cell("<strong><a href=\"index.php?module=style-templates&sid={$sid}{$group['expand_str']}#group_{$group['gid']}\" class=\"preview_template_list\" id=\"preview_template_list_{$group['gid']}\">{$group['title']}</a></strong>"); $table->construct_cell("<a href=\"index.php?module=style-templates&sid={$sid}{$group['expand_str']}#group_{$group['gid']}\">{$expand}</a>", array("class" => "align_center")); $table->construct_row(array("class" => "alt_row", "id" => "group_".$group['gid'], "name" => "group_".$group['gid']));
| $table->construct_cell("<strong><a href=\"index.php?module=style-templates&sid={$sid}{$group['expand_str']}#group_{$group['gid']}\">{$group['title']}</a></strong>"); $table->construct_cell("<a href=\"index.php?module=style-templates&sid={$sid}{$group['expand_str']}#group_{$group['gid']}\">{$expand}</a>", array("class" => "align_center")); $table->construct_row(array("class" => "alt_row", "id" => "group_".$group['gid'], "name" => "group_".$group['gid']));
|
} }
| } }
|