Zeile 6 | Zeile 6 |
---|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* $Id$
| * $Id: themes.php 5379 2011-02-21 11:06:42Z Tomm $
|
*/
// Disallow direct access to this file for security reasons
| */
// Disallow direct access to this file for security reasons
|
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 143 | Zeile 143 |
---|
break; case 3: // UPLOAD_ERR_PARTIAL $errors[] = $lang->error_uploadfailed_php3;
|
break; case 3: // UPLOAD_ERR_PARTIAL $errors[] = $lang->error_uploadfailed_php3;
|
break; case 4: // UPLOAD_ERR_NO_FILE $errors[] = $lang->error_uploadfailed_php4;
| |
break; case 6: // UPLOAD_ERR_NO_TMP_DIR $errors[] = $lang->error_uploadfailed_php6;
| break; case 6: // UPLOAD_ERR_NO_TMP_DIR $errors[] = $lang->error_uploadfailed_php6;
|
Zeile 160 | Zeile 157 |
---|
} if(!$errors)
|
} if(!$errors)
|
{
| {
|
// Was the temporary file found? if(!is_uploaded_file($_FILES['local_file']['tmp_name'])) { $errors[] = $lang->error_uploadfailed_lost;
|
// Was the temporary file found? if(!is_uploaded_file($_FILES['local_file']['tmp_name'])) { $errors[] = $lang->error_uploadfailed_lost;
|
}
| }
|
// Get the contents $contents = @file_get_contents($_FILES['local_file']['tmp_name']); // Delete the temporary file if possible
| // Get the contents $contents = @file_get_contents($_FILES['local_file']['tmp_name']); // Delete the temporary file if possible
|
Zeile 175 | Zeile 172 |
---|
{ $errors[] = $lang->error_uploadfailed_nocontents; }
|
{ $errors[] = $lang->error_uploadfailed_nocontents; }
|
}
| }
|
} else if(!empty($mybb->input['url'])) {
| } else if(!empty($mybb->input['url'])) {
|
Zeile 185 | Zeile 182 |
---|
{ $errors[] = $lang->error_local_file; }
|
{ $errors[] = $lang->error_local_file; }
|
| } else { // UPLOAD_ERR_NO_FILE $errors[] = $lang->error_uploadfailed_php4;
|
} if(!$errors)
| } if(!$errors)
|
Zeile 340 | Zeile 342 |
---|
$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 468 | Zeile 470 |
---|
$theme['name'] = rawurlencode($theme['name']); header("Content-disposition: attachment; filename=".$theme['name']."-theme.xml"); header("Content-type: application/octet-stream");
|
$theme['name'] = rawurlencode($theme['name']); header("Content-disposition: attachment; filename=".$theme['name']."-theme.xml"); header("Content-type: application/octet-stream");
|
header("Content-Length: ".my_strlen($xml));
| header("Content-Length: ".strlen($xml));
|
header("Pragma: no-cache"); header("Expires: 0"); echo $xml;
| header("Pragma: no-cache"); header("Expires: 0"); echo $xml;
|
Zeile 671 | Zeile 673 |
---|
}
if($mybb->input['action'] == "edit")
|
}
if($mybb->input['action'] == "edit")
|
{ $query = $db->simple_select("themes", "*", "tid='".intval($mybb->input['tid'])."'"); $theme = $db->fetch_array($query); // Does the theme not exist? if(!$theme['tid']) { flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style/themes");
| { $query = $db->simple_select("themes", "*", "tid='".intval($mybb->input['tid'])."'"); $theme = $db->fetch_array($query); // Does the theme not exist? if(!$theme['tid']) { flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style/themes");
|
} if($mybb->request_method == "post")
| } if($mybb->request_method == "post")
|
Zeile 692 | Zeile 694 |
---|
'tablespace' => intval($mybb->input['tablespace']), 'borderwidth' => intval($mybb->input['borderwidth']) );
|
'tablespace' => intval($mybb->input['tablespace']), 'borderwidth' => intval($mybb->input['borderwidth']) );
|
|
|
if($properties['templateset'] <= 0) { $errors[] = $lang->error_invalid_templateset;
|
if($properties['templateset'] <= 0) { $errors[] = $lang->error_invalid_templateset;
|
}
| }
|
$allowedgroups = array(); if(is_array($mybb->input['allowedgroups']))
| $allowedgroups = array(); if(is_array($mybb->input['allowedgroups']))
|
Zeile 713 | Zeile 715 |
---|
} } if(is_array($allowedgroups))
|
} } if(is_array($allowedgroups))
|
{
| {
|
$allowedgroups = implode(",", $allowedgroups); }
| $allowedgroups = implode(",", $allowedgroups); }
|
Zeile 779 | Zeile 781 |
---|
if($file == 'inherited') { continue;
|
if($file == 'inherited') { continue;
|
}
| }
|
foreach($action_stylesheet as $action => $style)
|
foreach($action_stylesheet as $action => $style)
|
{
| {
|
foreach($style as $stylesheet) { $stylesheets[$stylesheet]['applied_to'][$file][] = $action;
| foreach($style as $stylesheet) { $stylesheets[$stylesheet]['applied_to'][$file][] = $action;
|
Zeile 795 | Zeile 797 |
---|
} } }
|
} } }
|
} }
| } }
|
$inherited_load[] = $mybb->input['tid']; $inherited_load = array_unique($inherited_load);
| $inherited_load[] = $mybb->input['tid']; $inherited_load = array_unique($inherited_load);
|
Zeile 809 | Zeile 811 |
---|
while($inherited_theme = $db->fetch_array($query)) { $inherited_themes[$inherited_theme['tid']] = $inherited_theme['name'];
|
while($inherited_theme = $db->fetch_array($query)) { $inherited_themes[$inherited_theme['tid']] = $inherited_theme['name'];
|
} } $theme_stylesheets = array();
| } } $theme_stylesheets = array();
|
if(count($inherited_load) > 0) {
| if(count($inherited_load) > 0) {
|
Zeile 879 | Zeile 881 |
---|
foreach($style['inherited'] as $tid) { if($inherited_themes[$tid])
|
foreach($style['inherited'] as $tid) { if($inherited_themes[$tid])
|
{
| {
|
$inherited_ary[$tid] = $inherited_themes[$tid]; } }
| $inherited_ary[$tid] = $inherited_themes[$tid]; } }
|
Zeile 943 | Zeile 945 |
---|
else { $attached_to = "<small>{$lang->attached_to_all_pages}</small>";
|
else { $attached_to = "<small>{$lang->attached_to_all_pages}</small>";
|
} $popup = new PopupMenu("style_{$style['sid']}", $lang->options);
| } $popup = new PopupMenu("style_{$style['sid']}", $lang->options);
|
$popup->add_item($lang->edit_style, "index.php?module=style/themes&action=edit_stylesheet&file=".htmlspecialchars_uni($filename)."&tid={$theme['tid']}"); $popup->add_item($lang->properties, "index.php?module=style/themes&action=stylesheet_properties&file=".htmlspecialchars_uni($filename)."&tid={$theme['tid']}");
| $popup->add_item($lang->edit_style, "index.php?module=style/themes&action=edit_stylesheet&file=".htmlspecialchars_uni($filename)."&tid={$theme['tid']}"); $popup->add_item($lang->properties, "index.php?module=style/themes&action=stylesheet_properties&file=".htmlspecialchars_uni($filename)."&tid={$theme['tid']}");
|
Zeile 1009 | Zeile 1011 |
---|
continue; } $options[$dir] = ucfirst(str_replace('_', ' ', $dir));
|
continue; } $options[$dir] = ucfirst(str_replace('_', ' ', $dir));
|
} } $form_container->output_row($lang->editor_theme." <em>*</em>", $lang->editor_theme_desc, $form->generate_select_box('editortheme', $options, $properties['editortheme'], array('id' => 'editortheme')), 'editortheme');
| } } $form_container->output_row($lang->editor_theme." <em>*</em>", $lang->editor_theme_desc, $form->generate_select_box('editortheme', $options, $properties['editortheme'], array('id' => 'editortheme')), 'editortheme');
|
$form_container->output_row($lang->img_directory, $lang->img_directory_desc, $form->generate_text_box('imgdir', $properties['imgdir'], array('id' => 'imgdir')), 'imgdir'); $form_container->output_row($lang->logo, $lang->logo_desc, $form->generate_text_box('logo', $properties['logo'], array('id' => 'boardlogo')), 'logo');
| $form_container->output_row($lang->img_directory, $lang->img_directory_desc, $form->generate_text_box('imgdir', $properties['imgdir'], array('id' => 'imgdir')), 'imgdir'); $form_container->output_row($lang->logo, $lang->logo_desc, $form->generate_text_box('logo', $properties['logo'], array('id' => 'boardlogo')), 'logo');
|
Zeile 1033 | Zeile 1035 |
---|
// 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);
|
// 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');
| if(!$theme['tid']) { flash_message($lang->error_invalid_theme, 'error');
|
Zeile 1045 | Zeile 1047 |
---|
if(!$parent_list) { $parent_list = 1;
|
if(!$parent_list) { $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);
|
Zeile 1103 | Zeile 1105 |
---|
$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 1111 | Zeile 1118 |
---|
if(!$mybb->input['name']) { $errors[] = $lang->error_missing_stylesheet_name;
|
if(!$mybb->input['name']) { $errors[] = $lang->error_missing_stylesheet_name;
|
}
| }
|
if(!$errors) { // Theme & stylesheet theme ID do not match, editing inherited - we copy to local theme
| if(!$errors) { // Theme & stylesheet theme ID do not match, editing inherited - we copy to local theme
|
Zeile 1155 | Zeile 1162 |
---|
// 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'])
|
Zeile 1169 | Zeile 1175 |
---|
// 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 1211 | Zeile 1218 |
---|
} $applied_to = $this_stylesheet['applied_to'];
|
} $applied_to = $this_stylesheet['applied_to'];
|
unset($this_stylesheet);
| unset($this_stylesheet);
|
if($errors) { $page->output_inline_error($errors);
| if($errors) { $page->output_inline_error($errors);
|
Zeile 1402 | Zeile 1409 |
---|
if($theme['tid'] != $stylesheet['tid']) { $sid = copy_stylesheet_to_theme($stylesheet, $theme['tid']);
|
if($theme['tid'] != $stylesheet['tid']) { $sid = copy_stylesheet_to_theme($stylesheet, $theme['tid']);
|
}
| }
|
// Insert the modified CSS $new_stylesheet = $stylesheet['stylesheet'];
| // Insert the modified CSS $new_stylesheet = $stylesheet['stylesheet'];
|
Zeile 1435 | Zeile 1442 |
---|
// Now we have the new stylesheet, save it $updated_stylesheet = array(
|
// Now we have the new stylesheet, save it $updated_stylesheet = array(
|
| "cachefile" => $db->escape_string($stylesheet['name']),
|
"stylesheet" => $db->escape_string(unfix_css_urls($new_stylesheet)), "lastmodified" => TIME_NOW );
| "stylesheet" => $db->escape_string(unfix_css_urls($new_stylesheet)), "lastmodified" => TIME_NOW );
|
Zeile 1468 | Zeile 1476 |
---|
else { echo "1";
|
else { echo "1";
|
exit; } } // Has the file on the file system been modified? if(resync_stylesheet($stylesheet)) { // Need to refetch new stylesheet as it was modified $query = $db->simple_select("themestylesheets", "stylesheet", "sid='{$stylesheet['sid']}'"); $stylesheet['stylesheet'] = $db->fetch_field($query, 'stylesheet'); }
| exit; } } // Has the file on the file system been modified? if(resync_stylesheet($stylesheet)) { // Need to refetch new stylesheet as it was modified $query = $db->simple_select("themestylesheets", "stylesheet", "sid='{$stylesheet['sid']}'"); $stylesheet['stylesheet'] = $db->fetch_field($query, 'stylesheet'); }
|
$css_array = css_to_array($stylesheet['stylesheet']); $selector_list = get_selectors_as_options($css_array, $mybb->input['selector']);
|
$css_array = css_to_array($stylesheet['stylesheet']); $selector_list = get_selectors_as_options($css_array, $mybb->input['selector']);
|
|
|
// Do we not have any selectors? Send em to the full edit page if(!$selector_list)
|
// Do we not have any selectors? Send em to the full edit page if(!$selector_list)
|
{
| {
|
flash_message($lang->error_cannot_parse, 'error'); admin_redirect("index.php?module=style/themes&action=edit_stylesheet&tid={$theme['tid']}&file=".htmlspecialchars_uni($stylesheet['name'])."&mode=advanced"); exit;
|
flash_message($lang->error_cannot_parse, 'error'); admin_redirect("index.php?module=style/themes&action=edit_stylesheet&tid={$theme['tid']}&file=".htmlspecialchars_uni($stylesheet['name'])."&mode=advanced"); exit;
|
} // Fetch list of all of the stylesheets for this theme $file_stylesheets = unserialize($theme['stylesheets']); $stylesheets = array(); $inherited_load = array(); // Now we loop through the list of stylesheets for each file foreach($file_stylesheets as $file => $action_stylesheet) { if($file == 'inherited')
| } // Fetch list of all of the stylesheets for this theme $file_stylesheets = unserialize($theme['stylesheets']); $stylesheets = array(); $inherited_load = array(); // Now we loop through the list of stylesheets for each file foreach($file_stylesheets as $file => $action_stylesheet) { if($file == 'inherited')
|
{ continue; }
| { continue; }
|
Zeile 1508 | Zeile 1516 |
---|
foreach($action_stylesheet as $action => $style) { foreach($style as $stylesheet2)
|
foreach($action_stylesheet as $action => $style) { foreach($style as $stylesheet2)
|
{
| {
|
$stylesheets[$stylesheet2]['applied_to'][$file][] = $action; if(is_array($file_stylesheets['inherited'][$file."_".$action]) && in_array($stylesheet2, array_keys($file_stylesheets['inherited'][$file."_".$action]))) {
| $stylesheets[$stylesheet2]['applied_to'][$file][] = $action; if(is_array($file_stylesheets['inherited'][$file."_".$action]) && in_array($stylesheet2, array_keys($file_stylesheets['inherited'][$file."_".$action]))) {
|
Zeile 1531 | Zeile 1539 |
---|
$stylesheet2['inherited'][basename($inherited_file)] = $tid; unset($stylesheet2['inherited'][$inherited_file]); }
|
$stylesheet2['inherited'][basename($inherited_file)] = $tid; unset($stylesheet2['inherited'][$inherited_file]); }
|
}
| }
|
$stylesheets[basename($file)] = $stylesheet2; unset($stylesheets[$file]); }
|
$stylesheets[basename($file)] = $stylesheet2; unset($stylesheets[$file]); }
|
|
|
$this_stylesheet = $stylesheets[$stylesheet['name']]; unset($stylesheets);
| $this_stylesheet = $stylesheets[$stylesheet['name']]; unset($stylesheets);
|
Zeile 1544 | Zeile 1552 |
---|
<script type=\"text/javascript\"> var my_post_key = '".$mybb->post_code."'; </script>";
|
<script type=\"text/javascript\"> var my_post_key = '".$mybb->post_code."'; </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=simple");
| $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=simple");
|
Zeile 1564 | Zeile 1572 |
---|
else { $page->output_alert($lang->sprintf($lang->stylesheet_inherited, $stylesheet_parent), "ajax_alert");
|
else { $page->output_alert($lang->sprintf($lang->stylesheet_inherited, $stylesheet_parent), "ajax_alert");
|
}
| }
|
} $sub_tabs['edit_stylesheet'] = array(
| } $sub_tabs['edit_stylesheet'] = array(
|
Zeile 1699 | Zeile 1707 |
---|
// Now we have the new stylesheet, save it $updated_stylesheet = array(
|
// Now we have the new stylesheet, save it $updated_stylesheet = array(
|
| "cachefile" => $db->escape_string($stylesheet['name']),
|
"stylesheet" => $db->escape_string(unfix_css_urls($mybb->input['stylesheet'])), "lastmodified" => TIME_NOW );
| "stylesheet" => $db->escape_string(unfix_css_urls($mybb->input['stylesheet'])), "lastmodified" => TIME_NOW );
|
Zeile 1725 | Zeile 1734 |
---|
else { admin_redirect("index.php?module=style/themes&action=edit&tid={$theme['tid']}");
|
else { admin_redirect("index.php?module=style/themes&action=edit&tid={$theme['tid']}");
|
} } // Fetch list of all of the stylesheets for this theme $file_stylesheets = unserialize($theme['stylesheets']); $stylesheets = array(); $inherited_load = array(); // Now we loop through the list of stylesheets for each file foreach($file_stylesheets as $file => $action_stylesheet) { if($file == 'inherited') { continue; } foreach($action_stylesheet as $action => $style) { foreach($style as $stylesheet2)
| } } // Fetch list of all of the stylesheets for this theme $file_stylesheets = unserialize($theme['stylesheets']); $stylesheets = array(); $inherited_load = array(); // Now we loop through the list of stylesheets for each file foreach($file_stylesheets as $file => $action_stylesheet) { if($file == 'inherited') { continue; } foreach($action_stylesheet as $action => $style) { foreach($style as $stylesheet2)
|
{ $stylesheets[$stylesheet2]['applied_to'][$file][] = $action; if(is_array($file_stylesheets['inherited'][$file."_".$action]) && in_array($stylesheet2, array_keys($file_stylesheets['inherited'][$file."_".$action])))
| { $stylesheets[$stylesheet2]['applied_to'][$file][] = $action; if(is_array($file_stylesheets['inherited'][$file."_".$action]) && in_array($stylesheet2, array_keys($file_stylesheets['inherited'][$file."_".$action])))
|
Zeile 1755 | Zeile 1764 |
---|
$inherited_load[] = $value; } }
|
$inherited_load[] = $value; } }
|
} }
| } }
|
} foreach($stylesheets as $file => $stylesheet2)
|
} foreach($stylesheets as $file => $stylesheet2)
|
{
| {
|
if(is_array($stylesheet2['inherited'])) { foreach($stylesheet2['inherited'] as $inherited_file => $tid)
| if(is_array($stylesheet2['inherited'])) { foreach($stylesheet2['inherited'] as $inherited_file => $tid)
|
Zeile 1777 | Zeile 1786 |
---|
$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 1856 |
---|
$form->end();
|
$form->end();
|
echo "<script language=\"Javascript\" type=\"text/javascript\"> Event.observe('edit_stylesheet', 'submit', function()
| if($admin_options['codepress'] != 0) { echo "<script type=\"text/javascript\"> Event.observe('edit_stylesheet', 'submit', function()
|
{ if($('stylesheet_cp')) { var area = $('stylesheet_cp');
| { if($('stylesheet_cp')) { var area = $('stylesheet_cp');
|
Zeile 1855 | Zeile 1869 |
---|
} }); </script>";
|
} }); </script>";
|
| }
|
$page->output_footer(); }
| $page->output_footer(); }
|
Zeile 1946 | Zeile 1961 |
---|
{ $stylesheets[$stylesheet2]['applied_to'][$file][] = $action; if(is_array($file_stylesheets['inherited'][$file."_".$action]) && in_array($stylesheet2, array_keys($file_stylesheets['inherited'][$file."_".$action])))
|
{ $stylesheets[$stylesheet2]['applied_to'][$file][] = $action; if(is_array($file_stylesheets['inherited'][$file."_".$action]) && in_array($stylesheet2, array_keys($file_stylesheets['inherited'][$file."_".$action])))
|
{
| {
|
$stylesheets[$stylesheet2]['inherited'] = $file_stylesheets['inherited'][$file."_".$action]; foreach($file_stylesheets['inherited'][$file."_".$action] as $value) {
| $stylesheets[$stylesheet2]['inherited'] = $file_stylesheets['inherited'][$file."_".$action]; foreach($file_stylesheets['inherited'][$file."_".$action] as $value) {
|
Zeile 2012 | Zeile 2027 |
---|
$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]; }
|
Zeile 2025 | Zeile 2040 |
---|
$attached[] = $attached_to; } }
|
$attached[] = $attached_to; } }
|
}
| }
|
// Add Stylesheet $insert_array = array(
| // Add Stylesheet $insert_array = array(
|
Zeile 2038 | Zeile 2053 |
---|
); $sid = $db->insert_query("themestylesheets", $insert_array);
|
); $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);
| if(!cache_stylesheet($theme['tid'], str_replace('/', '', $mybb->input['name']), $stylesheet)) { $db->update_query("themestylesheets", array('cachefile' => "css.php?stylesheet={$sid}"), "sid='{$sid}'", 1);
|
Zeile 2046 | Zeile 2061 |
---|
// 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']);
|
|
|
// Log admin action log_admin_action($sid, $mybb->input['name'], $theme['tid'], $theme['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'])); }
|
// Log admin action log_admin_action($sid, $mybb->input['name'], $theme['tid'], $theme['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}");
|
Zeile 2114 | Zeile 2132 |
---|
{ $add_checked[2] = "checked=\"checked\""; $add_checked[1] = "";
|
{ $add_checked[2] = "checked=\"checked\""; $add_checked[1] = "";
|
}
| }
|
} else {
| } else {
|
Zeile 2179 | Zeile 2197 |
---|
$check_actions .= "\n\tcheckAction('action_{$count}');"; ++$count;
|
$check_actions .= "\n\tcheckAction('action_{$count}');"; ++$count;
|
} }
| } }
|
else { $global_checked[1] = "checked=\"checked\"";
| else { $global_checked[1] = "checked=\"checked\"";
|
Zeile 2252 | Zeile 2270 |
---|
$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 2283 |
---|
} }); </script>\n";
|
} }); </script>\n";
|
| }
|
echo '<script type="text/javascript" src="./jscripts/themes.js"></script>'; echo '<script type="text/javascript"> Event.observe(window, "load", function() {
| echo '<script type="text/javascript" src="./jscripts/themes.js"></script>'; echo '<script type="text/javascript"> Event.observe(window, "load", function() {
|
Zeile 2273 | Zeile 2294 |
---|
}); //]]> </script>';
|
}); //]]> </script>';
|
|
|
$form->end(); $page->output_footer();
| $form->end(); $page->output_footer();
|
Zeile 2281 | Zeile 2302 |
---|
if($mybb->input['action'] == "set_default") {
|
if($mybb->input['action'] == "set_default") {
|
| if(!verify_post_check($mybb->input['my_post_key'])) { flash_message($lang->invalid_post_verify_key2, 'error'); admin_redirect("index.php?module=style/themes"); }
|
$query = $db->simple_select("themes", "*", "tid='".intval($mybb->input['tid'])."'"); $theme = $db->fetch_array($query);
| $query = $db->simple_select("themes", "*", "tid='".intval($mybb->input['tid'])."'"); $theme = $db->fetch_array($query);
|