Skip to content

Commit

Permalink
Fixed bug where content part template could not be switched to custom
Browse files Browse the repository at this point in the history
  • Loading branch information
slackero committed Mar 11, 2014
1 parent 16fd7d4 commit ddcb8ec
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion include/inc_lib/revision/revision.php
Expand Up @@ -9,7 +9,7 @@
*
**/
define('PHPWCMS_VERSION', '1.7.2');
define('PHPWCMS_RELEASE_DATE', '2014/03/06');
define('PHPWCMS_RELEASE_DATE', '2014/03/11');
define('PHPWCMS_REVISION', '537');

?>
26 changes: 13 additions & 13 deletions include/inc_tmpl/articlecontent.edit.tmpl.php
Expand Up @@ -250,28 +250,28 @@ function showEditArticleID(istuff) {

// Detect Template
if(!empty($content['article']['acat_template'])) {
$content['template'] = _dbGet('phpwcms_template', '*', 'template_trash=0 AND template_id='._dbEscape($content['article']['acat_template']), '', '', 1);
$content['current_template'] = _dbGet('phpwcms_template', '*', 'template_trash=0 AND template_id='._dbEscape($content['article']['acat_template']), '', '', 1);
}
if(!isset($content['template'][0])) {
$content['template'] = _dbGet('phpwcms_template', '*', 'template_trash=0 AND template_default=1', '', '', 1);
if(!isset($content['current_template'][0])) {
$content['current_template'] = _dbGet('phpwcms_template', '*', 'template_trash=0 AND template_default=1', '', '', 1);
}
if(!isset($content['template'][0])) {
$content['template'] = _dbGet('phpwcms_template', '*', 'template_trash=0', '', 'template_default DESC', 1);
if(!isset($content['current_template'][0])) {
$content['current_template'] = _dbGet('phpwcms_template', '*', 'template_trash=0', '', 'template_default DESC', 1);
}

$content['blocks'] = '';

if(isset($content['template'][0]['template_var'])) {
$content['template_name'] = html_specialchars($content['template'][0]['template_name']);
if($content['template'][0]['template_default']) {
if(isset($content['current_template'][0]['template_var'])) {
$content['template_name'] = html_specialchars($content['current_template'][0]['template_name']);
if($content['current_template'][0]['template_default']) {
$content['template_name'] .= ' ('.$BL['be_admin_tmpl_default'].')';
}
$content['template'] = unserialize($content['template'][0]['template_var']);
if(!empty($content['template']['customblock'])) {
$content['template'] = explode(',', $content['template']['customblock']);
if(count($content['template'])) {
$content['current_template'] = unserialize($content['current_template'][0]['template_var']);
if(!empty($content['current_template']['customblock'])) {
$content['current_template'] = explode(',', $content['current_template']['customblock']);
if(count($content['current_template'])) {
$content['blocks'] .= '<optgroup label="'.$BL['be_admin_page_blocks'].', '.$BL['be_admin_page_customblocks'].'">';
foreach($content['template'] as $value) {
foreach($content['current_template'] as $value) {
$value = trim($value);
if($value !== '') {
$valhtml = html_specialchars($value);
Expand Down
4 changes: 2 additions & 2 deletions include/inc_tmpl/content/cnt14.inc.php
Expand Up @@ -28,7 +28,7 @@
<td align="right" class="chatlist"><?php echo $BL['be_admin_struct_template']; ?>:&nbsp;</td>
<td><select name="template" id="template" class="f11b">
<?php

echo '<option value="">'.$BL['be_admin_tmpl_default'].'</option>'.LF;

$tmpllist = get_tmpl_files(PHPWCMS_TEMPLATE.'inc_cntpart/wysiwyg');
Expand All @@ -40,7 +40,7 @@
}
}

?>
?>
</select></td>
</tr>

Expand Down

0 comments on commit ddcb8ec

Please sign in to comment.