Zeile 18 | Zeile 18 |
---|
require_once MYBB_ADMIN_DIR."inc/functions_themes.php";
$page->extra_header .= "
|
require_once MYBB_ADMIN_DIR."inc/functions_themes.php";
$page->extra_header .= "
|
<script language=\"Javascript\" type=\"text/javascript\">
| <script type=\"text/javascript\">
|
//<![CDATA[ var save_changes_lang_string = '{$lang->save_changes_js}'; var delete_lang_string = '{$lang->delete}';
| //<![CDATA[ var save_changes_lang_string = '{$lang->save_changes_js}'; var delete_lang_string = '{$lang->delete}';
|
Zeile 340 | Zeile 340 |
---|
$properties = unserialize($theme['properties']); $xml = "<?xml version=\"1.0\" encoding=\"{$lang->settings['charset']}\"?".">\r\n";
|
$properties = unserialize($theme['properties']); $xml = "<?xml version=\"1.0\" encoding=\"{$lang->settings['charset']}\"?".">\r\n";
|
$xml .= "<theme name=\"".$theme['name']."\" version=\"".$mybb->version_code."\">\r\n";
| $xml .= "<theme name=\"".htmlspecialchars_uni($theme['name'])."\" version=\"".$mybb->version_code."\">\r\n";
|
$xml .= "\t<properties>\r\n"; foreach($properties as $property => $value) {
| $xml .= "\t<properties>\r\n"; foreach($properties as $property => $value) {
|
Zeile 467 | Zeile 467 |
---|
$theme['name'] = rawurlencode($theme['name']); header("Content-disposition: attachment; filename=".$theme['name']."-theme.xml");
|
$theme['name'] = rawurlencode($theme['name']); header("Content-disposition: attachment; filename=".$theme['name']."-theme.xml");
|
header("Content-Length: ".my_strlen($xml));
| |
header("Content-type: application/octet-stream");
|
header("Content-type: application/octet-stream");
|
| header("Content-Length: ".my_strlen($xml));
|
header("Pragma: no-cache"); header("Expires: 0"); echo $xml;
| header("Pragma: no-cache"); header("Expires: 0"); echo $xml;
|
Zeile 1103 | Zeile 1103 |
---|
$stylesheets[basename($file)] = $stylesheet2; }
|
$stylesheets[basename($file)] = $stylesheet2; }
|
$this_stylesheet = $stylesheets[$stylesheet['cachefile']];
| if(!array_key_exists($stylesheet['cachefile'], $stylesheets) && array_key_exists("css.php?stylesheet=".$stylesheet['tid'], $stylesheets)) { $stylesheet['cachefile'] = "css.php?stylesheet=".$stylesheet['tid']; } $this_stylesheet = $stylesheets[$stylesheet['cachefile']];
|
unset($stylesheets); if($mybb->request_method == "post")
| unset($stylesheets); if($mybb->request_method == "post")
|
Zeile 1130 | Zeile 1135 |
---|
{ $actions_list = ""; $attached_to = $value;
|
{ $actions_list = ""; $attached_to = $value;
|
if(strpos($id, 'attached_') !== false) { // We have a custom attached file $attached_id = intval(str_replace('attached_', '', $id)); if($mybb->input['action_'.$attached_id] == 1) { // We have custom actions for attached files $actions_list = $mybb->input['action_list_'.$attached_id]; }
| if(strpos($id, 'attached_') !== false) { // We have a custom attached file $attached_id = intval(str_replace('attached_', '', $id)); if($mybb->input['action_'.$attached_id] == 1) { // We have custom actions for attached files $actions_list = $mybb->input['action_list_'.$attached_id]; }
|
if($actions_list) {
| if($actions_list) {
|
Zeile 1155 | Zeile 1160 |
---|
// Update Stylesheet $update_array = array( 'name' => $db->escape_string($mybb->input['name']),
|
// Update Stylesheet $update_array = array( 'name' => $db->escape_string($mybb->input['name']),
|
'attachedto' => $db->escape_string(implode('|', $attached)), 'lastmodified' => TIME_NOW
| 'attachedto' => $db->escape_string(implode('|', $attached))
|
);
|
);
|
if($stylesheet['name'] != $mybb->input['name'])
| if($stylesheet['name'] != $mybb->input['name'])
|
{ $update_array['cachefile'] = $db->escape_string(str_replace('/', '', $mybb->input['name']));
|
{ $update_array['cachefile'] = $db->escape_string(str_replace('/', '', $mybb->input['name']));
|
} $db->update_query("themestylesheets", $update_array, "sid='{$stylesheet['sid']}'", 1);
| } $db->update_query("themestylesheets", $update_array, "sid='{$stylesheet['sid']}'", 1);
|
// If the name changed, re-cache our stylesheet if($stylesheet['name'] != $mybb->input['name']) {
|
// If the name changed, re-cache our stylesheet if($stylesheet['name'] != $mybb->input['name']) {
|
| $db->update_query("themestylesheets", array('lastmodified' => TIME_NOW), "sid='{$stylesheet['sid']}'", 1);
|
if(!cache_stylesheet($theme['tid'], str_replace('/', '', $mybb->input['name']), $theme['stylesheet'])) { $db->update_query("themestylesheets", array('cachefile' => "css.php?stylesheet={$stylesheet['sid']}"), "sid='{$stylesheet['sid']}'", 1);
| if(!cache_stylesheet($theme['tid'], str_replace('/', '', $mybb->input['name']), $theme['stylesheet'])) { $db->update_query("themestylesheets", array('cachefile' => "css.php?stylesheet={$stylesheet['sid']}"), "sid='{$stylesheet['sid']}'", 1);
|
Zeile 1184 | Zeile 1189 |
---|
flash_message($lang->success_stylesheet_properties_updated, 'success'); admin_redirect("index.php?module=style/themes&action=stylesheet_properties&tid={$theme['tid']}&file=".htmlspecialchars_uni($mybb->input['file']));
|
flash_message($lang->success_stylesheet_properties_updated, 'success'); admin_redirect("index.php?module=style/themes&action=stylesheet_properties&tid={$theme['tid']}&file=".htmlspecialchars_uni($mybb->input['file']));
|
} }
| } }
|
$page->add_breadcrumb_item(htmlspecialchars_uni($theme['name']), "index.php?module=style/themes&action=edit&tid={$mybb->input['tid']}"); $page->add_breadcrumb_item(htmlspecialchars_uni($stylesheet['name'])." {$lang->properties}", "index.php?module=style/themes&action=edit_properties&tid={$mybb->input['tid']}");
| $page->add_breadcrumb_item(htmlspecialchars_uni($theme['name']), "index.php?module=style/themes&action=edit&tid={$mybb->input['tid']}"); $page->add_breadcrumb_item(htmlspecialchars_uni($stylesheet['name'])." {$lang->properties}", "index.php?module=style/themes&action=edit_properties&tid={$mybb->input['tid']}");
|
Zeile 1355 | Zeile 1360 |
---|
Event.observe(window, "load", function() { //<![CDATA[ new ThemeSelector(\''.$count.'\');
|
Event.observe(window, "load", function() { //<![CDATA[ new ThemeSelector(\''.$count.'\');
|
}); //]]> </script>'; $form->end(); $page->output_footer(); }
| }); //]]> </script>'; $form->end(); $page->output_footer(); }
|
// Shows the page where you can actually edit a particular selector or the whole stylesheet if($mybb->input['action'] == "edit_stylesheet" && (!$mybb->input['mode'] || $mybb->input['mode'] == "simple")) {
| // Shows the page where you can actually edit a particular selector or the whole stylesheet if($mybb->input['action'] == "edit_stylesheet" && (!$mybb->input['mode'] || $mybb->input['mode'] == "simple")) {
|
Zeile 1777 | Zeile 1782 |
---|
$this_stylesheet = $stylesheets[$stylesheet['name']]; unset($stylesheets);
|
$this_stylesheet = $stylesheets[$stylesheet['name']]; unset($stylesheets);
|
$page->extra_header .= '
| if($admin_options['codepress'] != 0) { $page->extra_header .= '
|
<link type="text/css" href="./jscripts/codepress/languages/codepress-css.css" rel="stylesheet" id="cp-lang-style" /> <script type="text/javascript" src="./jscripts/codepress/codepress.js"></script> <script type="text/javascript"> CodePress.language = \'css\'; </script>';
|
<link type="text/css" href="./jscripts/codepress/languages/codepress-css.css" rel="stylesheet" id="cp-lang-style" /> <script type="text/javascript" src="./jscripts/codepress/codepress.js"></script> <script type="text/javascript"> CodePress.language = \'css\'; </script>';
|
| }
|
$page->add_breadcrumb_item(htmlspecialchars_uni($theme['name']), "index.php?module=style/themes&action=edit&tid={$mybb->input['tid']}"); $page->add_breadcrumb_item("{$lang->editing} ".htmlspecialchars_uni($stylesheet['name']), "index.php?module=style/themes&action=edit_stylesheet&tid={$mybb->input['tid']}&file=".htmlspecialchars_uni($mybb->input['file'])."&mode=advanced");
| $page->add_breadcrumb_item(htmlspecialchars_uni($theme['name']), "index.php?module=style/themes&action=edit&tid={$mybb->input['tid']}"); $page->add_breadcrumb_item("{$lang->editing} ".htmlspecialchars_uni($stylesheet['name']), "index.php?module=style/themes&action=edit_stylesheet&tid={$mybb->input['tid']}&file=".htmlspecialchars_uni($mybb->input['file'])."&mode=advanced");
|
Zeile 1844 | Zeile 1852 |
---|
$form->end();
|
$form->end();
|
echo "<script language=\"Javascript\" type=\"text/javascript\">
| if($admin_options['codepress'] != 0) { echo "<script type=\"text/javascript\">
|
Event.observe('edit_stylesheet', 'submit', function()
|
Event.observe('edit_stylesheet', 'submit', function()
|
{
| {
|
if($('stylesheet_cp')) { var area = $('stylesheet_cp'); area.id = 'stylesheet';
| if($('stylesheet_cp')) { var area = $('stylesheet_cp'); area.id = 'stylesheet';
|
Zeile 1855 | Zeile 1865 |
---|
} }); </script>";
|
} }); </script>";
|
| }
|
$page->output_footer(); }
if($mybb->input['action'] == "delete_stylesheet")
|
$page->output_footer(); }
if($mybb->input['action'] == "delete_stylesheet")
|
{ // Fetch the theme we want to edit this stylesheet in $query = $db->simple_select("themes", "*", "tid='".intval($mybb->input['tid'])."'"); $theme = $db->fetch_array($query); if(!$theme['tid']) { flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style/themes");
| { // Fetch the theme we want to edit this stylesheet in $query = $db->simple_select("themes", "*", "tid='".intval($mybb->input['tid'])."'"); $theme = $db->fetch_array($query); if(!$theme['tid']) { flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style/themes");
|
} $parent_list = make_parent_theme_list($theme['tid']); $parent_list = implode(',', $parent_list); if(!$parent_list)
|
} $parent_list = make_parent_theme_list($theme['tid']); $parent_list = implode(',', $parent_list); if(!$parent_list)
|
{
| {
|
$parent_list = 1;
|
$parent_list = 1;
|
}
| }
|
$query = $db->simple_select("themestylesheets", "*", "name='".$db->escape_string($mybb->input['file'])."' AND tid IN ({$parent_list})", array('order_by' => 'tid', 'order_dir' => 'desc', 'limit' => 1)); $stylesheet = $db->fetch_array($query);
|
$query = $db->simple_select("themestylesheets", "*", "name='".$db->escape_string($mybb->input['file'])."' AND tid IN ({$parent_list})", array('order_by' => 'tid', 'order_dir' => 'desc', 'limit' => 1)); $stylesheet = $db->fetch_array($query);
|
|
|
// Does the theme not exist? or are we trying to delete the master? if(!$stylesheet['sid'] || $stylesheet['tid'] == 1) {
| // Does the theme not exist? or are we trying to delete the master? if(!$stylesheet['sid'] || $stylesheet['tid'] == 1) {
|
Zeile 1890 | Zeile 1901 |
---|
// User clicked no if($mybb->input['no'])
|
// User clicked no if($mybb->input['no'])
|
{ admin_redirect("index.php?module=style/themes"); }
| { admin_redirect("index.php?module=style/themes"); }
|
if($mybb->request_method == "post") {
| if($mybb->request_method == "post") {
|
Zeile 2012 | Zeile 2023 |
---|
$attached_id = intval(str_replace('attached_', '', $id)); if($mybb->input['action_'.$attached_id] == 1)
|
$attached_id = intval(str_replace('attached_', '', $id)); if($mybb->input['action_'.$attached_id] == 1)
|
{
| {
|
// We have custom actions for attached files $actions_list = $mybb->input['action_list_'.$attached_id];
|
// We have custom actions for attached files $actions_list = $mybb->input['action_list_'.$attached_id];
|
}
| }
|
if($actions_list) {
| if($actions_list) {
|
Zeile 2036 | Zeile 2047 |
---|
'cachefile' => $db->escape_string(str_replace('/', '', $mybb->input['name'])), 'lastmodified' => TIME_NOW );
|
'cachefile' => $db->escape_string(str_replace('/', '', $mybb->input['name'])), 'lastmodified' => TIME_NOW );
|
|
|
$sid = $db->insert_query("themestylesheets", $insert_array); if(!cache_stylesheet($theme['tid'], str_replace('/', '', $mybb->input['name']), $stylesheet)) { $db->update_query("themestylesheets", array('cachefile' => "css.php?stylesheet={$sid}"), "sid='{$sid}'", 1); }
|
$sid = $db->insert_query("themestylesheets", $insert_array); if(!cache_stylesheet($theme['tid'], str_replace('/', '', $mybb->input['name']), $stylesheet)) { $db->update_query("themestylesheets", array('cachefile' => "css.php?stylesheet={$sid}"), "sid='{$sid}'", 1); }
|
|
|
// Update the CSS file list for this theme update_theme_stylesheet_list($theme['tid']);
| // Update the CSS file list for this theme update_theme_stylesheet_list($theme['tid']);
|
Zeile 2053 | Zeile 2064 |
---|
flash_message($lang->success_stylesheet_added, 'success'); admin_redirect("index.php?module=style/themes&action=edit_stylesheet&tid={$mybb->input['tid']}&sid={$sid}&file=".urlencode($mybb->input['name'])); }
|
flash_message($lang->success_stylesheet_added, 'success'); admin_redirect("index.php?module=style/themes&action=edit_stylesheet&tid={$mybb->input['tid']}&sid={$sid}&file=".urlencode($mybb->input['name'])); }
|
} $page->extra_header .= '
| } if($admin_options['codepress'] != 0) { $page->extra_header .= '
|
<link type="text/css" href="./jscripts/codepress/languages/codepress-css.css" rel="stylesheet" id="cp-lang-style" /> <script type="text/javascript" src="./jscripts/codepress/codepress.js"></script> <script type="text/javascript"> CodePress.language = \'css\'; </script>';
|
<link type="text/css" href="./jscripts/codepress/languages/codepress-css.css" rel="stylesheet" id="cp-lang-style" /> <script type="text/javascript" src="./jscripts/codepress/codepress.js"></script> <script type="text/javascript"> CodePress.language = \'css\'; </script>';
|
| }
|
$page->add_breadcrumb_item(htmlspecialchars_uni($theme['name']), "index.php?module=style/themes&action=edit&tid={$mybb->input['tid']}");
|
$page->add_breadcrumb_item(htmlspecialchars_uni($theme['name']), "index.php?module=style/themes&action=edit&tid={$mybb->input['tid']}");
|
$page->add_breadcrumb_item("Add Stylesheet");
| $page->add_breadcrumb_item($lang->add_stylesheet);
|
$page->output_header("{$lang->themes} - {$lang->add_stylesheet}");
|
$page->output_header("{$lang->themes} - {$lang->add_stylesheet}");
|
|
|
$sub_tabs['edit_stylesheets'] = array( 'title' => $lang->edit_stylesheets, 'link' => "index.php?module=style/themes&action=edit&tid={$mybb->input['tid']}"
| $sub_tabs['edit_stylesheets'] = array( 'title' => $lang->edit_stylesheets, 'link' => "index.php?module=style/themes&action=edit&tid={$mybb->input['tid']}"
|
Zeile 2122 | Zeile 2136 |
---|
} $form = new Form("index.php?module=style/themes&action=add_stylesheet", "post", "add_stylesheet");
|
} $form = new Form("index.php?module=style/themes&action=add_stylesheet", "post", "add_stylesheet");
|
|
|
echo $form->generate_hidden_field("tid", $mybb->input['tid'])."\n"; $specific_files = "<div id=\"attach_1\" class=\"attachs\">";
| echo $form->generate_hidden_field("tid", $mybb->input['tid'])."\n"; $specific_files = "<div id=\"attach_1\" class=\"attachs\">";
|
Zeile 2252 | Zeile 2266 |
---|
$form->output_submit_wrapper($buttons);
|
$form->output_submit_wrapper($buttons);
|
echo "<script language=\"Javascript\" type=\"text/javascript\">
| if($admin_options['codepress'] != 0) { echo "<script type=\"text/javascript\">
|
Event.observe('add_stylesheet', 'submit', function() { if($('stylesheet_cp')) {
| Event.observe('add_stylesheet', 'submit', function() { if($('stylesheet_cp')) {
|
Zeile 2263 | Zeile 2279 |
---|
} }); </script>\n";
|
} }); </script>\n";
|
| }
|
echo '<script type="text/javascript" src="./jscripts/themes.js"></script>'; echo '<script type="text/javascript">
| echo '<script type="text/javascript" src="./jscripts/themes.js"></script>'; echo '<script type="text/javascript">
|