Example #1
0
            $template = $onetemplate->name;
            $orig_template = $onetemplate->name;
            $content = $onetemplate->content;
            $stylesheet = $onetemplate->stylesheet;
            $encoding = $onetemplate->encoding;
            $default = $onetemplate->default;
            $active = $onetemplate->active;
            $lastedited = $onetemplate->modified_date;
        }
    }
}
if (strlen($template) > 0) {
    $CMS_ADMIN_SUBTITLE = $template;
}
$addlScriptSubmit = '';
$modobj = cms_utils::get_syntax_highlighter_module();
if (is_object($modobj)) {
    $addlScriptSubmit = $modobj->SyntaxPageFormSubmit();
}
$closestr = cms_html_entity_decode(lang('close'));
$headtext = <<<EOSCRIPT
<script type="text/javascript">
// <![CDATA[
jQuery(document).ready(function(){
  jQuery('[name=apply]').live('click',function(){
    var data = jQuery('#Edit_Template').find('input:not([type=submit]), select, textarea').serializeArray();
    data.push({ 'name': 'ajax', 'value': 1});
    data.push({ 'name': 'apply', 'value': 1 });
    \$.post('{$_SERVER['REQUEST_URI']}',data,function(resultdata,text){
      var event = jQuery.Event('cms_ajax_apply');
      event.response = \$(resultdata).find('Response').text();
/**
 * A method to create a text area control
 *
 * @internal
 * @access private
 * @param boolean Wether the currently selected wysiwyg area should be enabled (depends on user, and site preferences
 * @param string  The contents of the text area
 * @param string  The name of the text area
 * @param string  An optional class name
 * @param string  An optional ID (HTML ID) value
 * @param string  The optional encoding
 * @param string  Optional style information
 * @param integer Width (the number of columns) (CSS can and will override this)
 * @param integer Hieght (the number of rows) (CSS can and will override this)
 * @param string  A flag to indicate that the wysiwyg should be forced to a different type independant of user settings
 * @param string  The name of the syntax hilighter to use (if empty it is assumed that a wysiwyg text area is requested instead of a syntax hiliter)
 * @param string  Optional additional text to include in the textarea tag
 * @return string
 */
function create_textarea($enablewysiwyg, $text, $name, $classname = '', $id = '', $encoding = '', $stylesheet = '', $width = '80', $height = '15', $forcewysiwyg = '', $wantedsyntax = '', $addtext = '')
{
    $gCms = cmsms();
    $result = '';
    $uid = get_userid(false);
    if ($enablewysiwyg == true) {
        $module = cms_utils::get_wysiwyg_module($forcewysiwyg);
        if ($module) {
            $result = $module->WYSIWYGTextArea($name, $width, $height, $encoding, $text, $stylesheet, $addtext);
        }
    }
    if (!$result && $wantedsyntax) {
        $module = cms_utils::get_syntax_highlighter_module();
        if ($module) {
            $result = $module->SyntaxTextArea($name, $wantedsyntax, $width, $height, $encoding, $text, $addtext);
        }
    }
    if ($result == '') {
        $result = '<textarea name="' . $name . '" cols="' . $width . '" rows="' . $height . '"';
        if ($classname != '') {
            $result .= ' class="' . $classname . '"';
        } else {
            $result .= ' class="cms_textarea"';
        }
        if ($id != '') {
            $result .= ' id="' . $id . '"';
        }
        if (!empty($addtext)) {
            $result .= ' ' . $addtext;
        }
        $result .= '>' . cms_htmlentities($text, ENT_NOQUOTES, get_encoding($encoding)) . '</textarea>';
    }
    return $result;
}