示例#1
0
文件: admin.php 项目: snenko/chechur
        if (!saveImage('image_preview')) {
            $error_template = 'зображення велике не завантажиломь';
        } else {
            $values['image_preview'] = $_FILES['image_preview']['name'];
        }
    }
    if ($_FILES['image_swatch']['name']) {
        if (!saveImage('image_swatch')) {
            $error_template = 'зображення мале не завантажився';
        } else {
            $values['image_swatch'] = $_FILES['image_swatch']['name'];
        }
    }
    $values = array_merge($values, $_POST);
    unset($values['save_template']);
    if (!edit_template($values)) {
        $error_template = "Помилка збереження: " . mysql_error();
    }
}
if ($_POST['remove_template']) {
    remote_template($_POST['template_id']);
    $error_template = mysql_error();
}
?>

<div class="table">
    <p class="error"><?php 
echo $error_template;
?>
</p>
    <?php 
示例#2
0
 @ob_end_clean();
 //print_r($strraw);
 ob_start();
 #carefully selected global order of execution for each core client
 #this is a seperated feature
 if (isset($_cfg['global']['ent_decode'])) {
     if ($_cfg['global']['ent_decode'] == "before_make_object" or $_cfg['global']['ent_decode'] == "on") {
         $strraw[0] = html_entity_decode($strraw[0]);
     }
 }
 #end
 if (function_exists("edit_content")) {
     $strraw[0] = edit_content($strraw[0], $_cfg['global']['default_request_folder']);
 }
 if (function_exists("edit_template")) {
     $strraw[1] = edit_template($strraw[1], $_cfg['global']['default_template']);
 }
 if ($_cfg['global']['make_object_on_strrm'] == "on" && isset($strrm)) {
     $strraw[0] = $strrm;
 }
 if (is_dir($__the_cwd . "/cache/" . $_cfg['global']['current_client'] . "/")) {
     chdir($__the_cwd . "/cache/" . $_cfg['global']['current_client'] . "/");
 }
 if (function_exists("make_object") && isset($cont_vars) && is_array($cont_vars)) {
     if ($_cfg['global']['var_dump'] == "on") {
         $dbg = true;
     }
     #this is a seperated feature
     if (isset($_cfg['global']['ent_decode'])) {
         if ($_cfg['global']['ent_decode'] == "before_extension_load" or $_cfg['global']['ent_decode'] == "on") {
             $strraw[0] = html_entity_decode($strraw[0]);
示例#3
0
      <input type="button" value="Cancel"
         onclick="javascript:window.location='emails.php';" />
      </td></tr>

      </table>
      </form>
<?php 
    }
}
/*______________________________________________________________________EDIT_*/
if ($action == 'edit') {
    $show_default = false;
    $show_form = true;
    if (isset($_POST['done']) && $_POST['done'] == 'yes') {
        if ($_POST['templatename'] && $_POST['subject'] && $_POST['content']) {
            $success = edit_template($_POST['id'], $_POST['templatename'], $_POST['subject'], $_POST['content']);
            if ($success) {
                $show_default = true;
                $show_form = false;
                echo '<p class="success">Template <i>' . $_POST['templatename'] . '</i> edited successfully.</p>';
            }
        } else {
            echo '<p class="error">All fields are required for email ' . 'templates.</p>';
        }
    }
    if ($show_form) {
        $info = get_template_info($_REQUEST['id']);
        ?>
      <p>You can edit the <i><?php 
        echo $info['templatename'];
        ?>
示例#4
0
/**
* Used for editing templates: Either shows show_templates(), edit_template(), save_template() or
* create_template()
*
* @see show_templates(), edit_template(), save_template(), create_template()
*/
function templates()
{
    global $Pivot_Vars;
    PageHeader(lang('adminbar', 'templates_title'), 1);
    PageAnkeiler(lang('userbar', 'admin') . ' &raquo; ' . lang('adminbar', 'templates_title'));
    // if there is an 'action' to do
    if (isset($Pivot_Vars['doaction'])) {
        files_action($Pivot_Vars['action'], $Pivot_Vars['check']);
    }
    if (isset($Pivot_Vars['edit']) && !isset($Pivot_Vars['template'])) {
        edit_template();
    } else {
        if (isset($Pivot_Vars['template'])) {
            save_template();
        } else {
            if (isset($Pivot_Vars['create'])) {
                create_template();
            } else {
                show_templates();
            }
        }
    }
}
示例#5
0
<?php

include "global.php";
$cp->header();
do_module_header('Template Editor', '<a href="templates.php">List Templates</a>');
switch ($_REQUEST["do"]) {
    case 'edit':
        edit_template($_REQUEST["title"]);
        break;
    case 'save':
        save_template($_REQUEST[title], $_REQUEST[html]);
        edit_template($_REQUEST[title]);
        break;
    default:
        list_templates();
        break;
}
$cp->footer();
function list_templates()
{
    do_table_header("Manage Templates");
    do_blank_row("<b>Default Template</b>");
    do_blank_row("\n    \n                  <ul><b>Global Templates</b>\n                    <li><a href=\"templates.php?do=edit&title=header\">header</a>\n                    <li><a href=\"templates.php?do=edit&title=footer\">footer</a>\n                    <li><a href='templates.php?do=edit&title=stylesheet'>stylesheet</a>\n                  </ul>\n                  <ul>\n                    <b>Cheats Templates</b>\n                    <li><a href='templates.php?do=edit&title=cheats_header'>cheats_header</a>\n                  </ul>\n                  <ul>\n                    <b>Company List Templates</b>\n                    <li><a href='templates.php?do=edit&title=company_list'>company_list</a>\n                  </ul>\n                  <ul>\n                    <b>Company Profile Templates</b>\n                    <li><a href='templates.php?do=edit&title=company_profile'>company_profile</a>\n                    <li><a href='templates.php?do=edit&title=company_profile_devlinks'>company_profile_devlinks</a>\n                    <li><a href='templates.php?do=edit&title=company_profile_publinks'>company_profile_publinks</a>\n                  </ul>\n                  <ul>\n                    <b>Downloads Module Templates</b>\n                    <li><a href='templates.php?do=edit&title=downloads_header'>downloads_header</a>\n                    <li><a href='templates.php?do=edit&title=downloads_footer'>downloads_footer</a>\n                  </ul>\n                  <ul>\n                    <b>Frontpage Templates</b>\n                    <li><a href='templates.php?do=edit&title=frontpage_latest_Mods'>frontpage_latest_Mods</a>\n                    <li><a href='templates.php?do=edit&title=frontpage_popular_Mods'>frontpage_popular_Mods</a>\n                  </ul>\n                  <ul>\n                    <b>Mod List Templates</b>\n                    <li><a href=\"templates.php?do=edit&title=Modlist_footer\">Modlist_footer</a>\n                    <li><a href='templates.php?do=edit&title=Modlist_header'>Modlist_header</a>\n                    <li><a href='templates.php?do=edit&title=Modlist_row'>Modlist_row</a>\n                  </ul>\n                  <ul>\n                    <b>Mod Profile Templates</b>\n                    <li><a href='templates.php?do=edit&title=Mod_profile'>Mod_profile</a>\n                  </ul>\n                  <ul><b>Menu Templates</b>\n                    <li><a href=\"templates.php?do=edit&title=log_in_box\">log_in_box</a>\n                    <li><a href=\"templates.php?do=edit&title=logged_in_box\">logged_in_box</a>\n                  </ul>\n                  ");
    do_table_footer();
}
function edit_template($title)
{
    global $db;
    do_table_header("Manage Templates");
    $result = $db->Execute("SELECT * FROM Obsedb_templates WHERE `title` = '{$title}';");
    do_form_header('templates.php');