Skip to content

Commit

Permalink
Dev Theme editor now receives focus
Browse files Browse the repository at this point in the history
Dev REmoved obsolete function
  • Loading branch information
c-schmitz committed May 6, 2016
1 parent 3588b18 commit 8040aa0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 18 deletions.
8 changes: 0 additions & 8 deletions application/helpers/admin/template_helper.php
Expand Up @@ -38,14 +38,6 @@ function getListOfFiles($wh){
return $arr;
}

function textarea_encode($html_code)
{
$from = array('<', '>');
$to = array('&lt;', '&gt;');
$html_code = str_replace($from, $to, $html_code);
return $html_code;
}

/**
* Load this editfile
*
Expand Down
18 changes: 11 additions & 7 deletions application/views/admin/templates/templatesummary_view.php
Expand Up @@ -53,13 +53,17 @@
<input type='hidden' name='editfileindex' value='<?php echo $_GET['editfile']; ?>' />
<?php endif;?>
<?php echo CHtml::hiddenField('templatename', $templatename, array('class'=>'templatename'));
echo CHtml::hiddenField('screenname', $screenname, array('class'=>'screenname')); ?>
<input type='hidden' name='editfile' value='<?php echo $editindex; ?>' />
<input type='hidden' name='editfilename' 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>
echo CHtml::hiddenField('screenname', $screenname, array('class'=>'screenname'));
echo CHtml::hiddenField('editfile', $editindex);
echo CHtml::hiddenField('editfilename', $editfile);
echo CHtml::hiddenField('action', 'templatesavechanges');
echo CHtml::textArea('changes', isset($editfile)?filetext($templatename,$editfile,$templates):'',array('rows'=>'20',
'cols'=>'40',
'data-filetype'=>$sEditorFileType,
'class'=>'ace '.$sTemplateEditorMode,
'style'=>'width:100%'
));
?>
<p class='text-center'>
<br/>
<?php if (Permission::model()->hasGlobalPermission('templates','update')):?>
Expand Down
4 changes: 1 addition & 3 deletions scripts/admin/templates.js
Expand Up @@ -50,7 +50,5 @@ function createToolbar(element, editor)
{
editor.commands.exec('replace', editor);
});



editor.focus();
}

0 comments on commit 8040aa0

Please sign in to comment.