<br/><select size='8' name='cssfiles' onchange="javascript: window.open('<?php echo $this->createUrl("admin/templates/sa/fileredirect/templatename/".$templatename."/screenname/".urlencode($screenname)); ?>/editfile/'+escape(this.value), '_top')">
                <?php echo makeoptions($cssfiles, "name", "name", $editfile); ?>
            </select>
        </div>
    </div>
    <div class="col-lg-8 templateeditor">
        <?php echo CHtml::form(array('admin/templates/sa/templatesavechanges'), 'post', array('id'=>'editTemplate', 'name'=>'editTemplate')); ?>

        <input type='hidden' name='templatename' value='<?php echo $templatename; ?>' />
        <input type='hidden' name='screenname' value='<?php echo HTMLEscape($screenname); ?>' />
        <input type='hidden' name='editfile' value='<?php echo $editfile; ?>' />
        <input type='hidden' name='action' value='templatesavechanges' />

        <textarea name='changes' id='changes' rows='20' cols='40' data-filetype="<?php echo $sEditorFileType; ?>" class="ace <?php echo $sTemplateEditorMode; ?>" style='width:100%'>
            <?php if (isset($editfile)) {
            echo textarea_encode(filetext($templatename,$editfile,$templates));
        } ?>
        </textarea>
        <p>
            <br/>
            <?php if (Permission::model()->hasGlobalPermission('templates','update')):?>
                <?php if (is_writable($templates[$templatename])):?>
                    <input type='submit' class='btn btn-default' value='<?php eT("Save changes"); ?>'
                            <?php if (!is_template_editable($templatename)):?>
                                disabled='disabled' alt='<?php eT("Changes cannot be saved to a standard template."); ?>'
                            <?php endif; ?>             
                    />                
                <?php endif; ?>
            <?php endif; ?>
        </p>
        </form>
Beispiel #2
0
//CSS Firefox 2 transition fix
if ($subaction == 'templateupload') {
    $ZIPimportAction = " onclick='if (validatefilename(this.form,\"" . $clang->gT('Please select a file to import!', 'js') . "\")) {this.form.submit();}'";
    if (!function_exists("zip_open")) {
        $ZIPimportAction = " onclick='alert(\"" . $clang->gT("zip library not supported by PHP, Import ZIP Disabled", "js") . "\");'";
    }
    $templatesoutput .= "<div class='header ui-widget-header'>" . $clang->gT("Uploaded template file") . "</div>\n";
    $templatesoutput .= "\t<form enctype='multipart/form-data' id='importtemplate' name='importtemplate' action='{$scriptname}' method='post' onsubmit='return validatefilename(this,\"" . $clang->gT('Please select a file to import!', 'js') . "\");'>\n" . "\t<input type='hidden' name='lid' value='{$lid}' />\n" . "\t<input type='hidden' name='action' value='templateupload' />\n" . "\t<ul>\n" . "<li><label for='the_file'>" . $clang->gT("Select template ZIP file:") . "</label>\n" . "<input id='the_file' name='the_file' type=\"file\" size=\"50\" /></li>\n" . "<li><label>&nbsp;</label><input type='button' value='" . $clang->gT("Import template ZIP archive") . "' {$ZIPimportAction} /></li>\n" . "\t</ul></form>\n";
} elseif (isset($importtemplateoutput)) {
    $templatesoutput .= $importtemplateoutput;
} else {
    //FILE CONTROL DETAILS
    if (is_template_editable($templatename) == true) {
        $templatesoutput .= "\t<table class='templatecontrol'>\n" . "\t<tr>\n" . "<th colspan='3'>\n" . "\t<strong>" . sprintf($clang->gT("Editing template '%s' - File '%s'"), $templatename, $editfile) . "</strong>\n" . "</th>\n" . "\t</tr>\n" . "\t<tr><th class='subheader' width='150'>" . $clang->gT("Standard Files:") . "</th>" . "<td align='center' valign='top' rowspan='3'>\n" . "<form name='editTemplate' method='post' action='admin.php'>\n" . "\t<input type='hidden' name='templatename' value='{$templatename}' />\n" . "\t<input type='hidden' name='screenname' value='" . html_escape($screenname) . "' />\n" . "\t<input type='hidden' name='editfile' value='{$editfile}' />\n" . "\t<input type='hidden' name='action' value='templatesavechanges' />\n" . "<textarea name='changes' id='changes' rows='15' cols='40' class='codepress html'>";
        if ($editfile) {
            $templatesoutput .= textarea_encode(filetext($templatename, $editfile));
        }
        $templatesoutput .= "</textarea><br />\n";
        if (is_writable($templates[$templatename])) {
            $templatesoutput .= "<input align='right' type='submit' value='" . $clang->gT("Save Changes") . "'";
            if (!is_template_editable($templatename)) {
                $templatesoutput .= " disabled='disabled' alt='" . $clang->gT("Changes cannot be saved to a standard template.") . "'";
            }
            $templatesoutput .= " />";
        } else {
            $templatesoutput .= '<span class="flashmessage">' . $clang->gT("You can't save changes because the template directory is not writable.") . '</span>';
        }
        $templatesoutput .= "<br />\n" . "</form></td>";
        $templatesoutput .= "<th class='subheader' colspan='2' align='right' width='200'>" . $clang->gT("Other Files:") . "</th></tr>\n";
        $templatesoutput .= "<tr><td valign='top' rowspan='2' class='subheader'><select size='6' name='editfile' onchange='javascript: window.open(\"admin.php?action=templates&amp;templatename={$templatename}&amp;screenname=" . urlencode($screenname) . "&amp;editfile=\"+escape(this.value), \"_top\")'>\n" . makeoptions($files, "name", "name", $editfile) . "</select><br /><br/>\n" . $clang->gT("CSS & Javascript files:") . "<br/><select size='8' name='cssfiles' onchange='javascript: window.open(\"admin.php?action=templates&amp;templatename={$templatename}&amp;screenname=" . urlencode($screenname) . "&amp;editfile=\"+escape(this.value), \"_top\")'>\n" . makeoptions($cssfiles, "name", "name", $editfile) . "</select>\n" . "</td>\n" . "<td valign='top' align='right' width='20%'><form action='admin.php' method='post'>" . "<table width='90' align='left' border='0' cellpadding='0' cellspacing='0'>\n<tr><td></td></tr>" . "<tr><td><select size='11' style='min-width:130px;' name='otherfile' id='otherfile'>\n" . makeoptions($otherfiles, "name", "name", "") . "</select>" . "</td></tr>" . "<tr><td>" . "<input type='submit' value='" . $clang->gT("Delete") . "' onclick=\"javascript:return confirm('" . $clang->gT("Are you sure you want to delete this file?", "js") . "')\"";
        if (!is_template_editable($templatename)) {