Example #1
0
/**
 * This function change the template used only in the session
 * @param string 	a valid template name
 */
function setTemplate($new_template)
{
    if (is_dir(_base_ . '/templates/' . $new_template)) {
        $_SESSION['template'] = $new_template;
    } else {
        $_SESSION['template'] = getDefaultTemplate();
    }
}
    $docgrp = implode(',', $_SESSION['mgrDocgroups']);
}
if (!empty($id)) {
    $access = "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0" . (!$docgrp ? '' : " OR dg.document_group IN ({$docgrp})");
    $rs = $modx->db->select('sc.*', "{$tbl_site_content} AS sc LEFT JOIN {$tbl_document_groups} AS dg ON dg.document=sc.id", "sc.id='{$id}' AND ({$access})");
    $content = $modx->db->getRow($rs);
    if (!$content) {
        $modx->webAlertAndQuit($_lang["access_permission_denied"]);
    }
    $_SESSION['itemname'] = $content['pagetitle'];
} else {
    $content = array();
    if (isset($_REQUEST['newtemplate'])) {
        $content['template'] = $_REQUEST['newtemplate'];
    } else {
        $content['template'] = getDefaultTemplate();
    }
    $_SESSION['itemname'] = $_lang["new_resource"];
}
// restore saved form
$formRestored = false;
if ($modx->manager->hasFormValues()) {
    $modx->manager->loadFormValues();
    $formRestored = true;
}
// retain form values if template was changed
// edited to convert pub_date and unpub_date
// sottwell 02-09-2006
if ($formRestored == true || isset($_REQUEST['newtemplate'])) {
    $content = array_merge($content, $_POST);
    $content['content'] = $_POST['ta'];
    if ($thisCategory != $currentCategory) {
        if ($closeOptGroup) {
            echo "\t\t\t\t\t</optgroup>\n";
        }
        echo "\t\t\t\t\t<optgroup label=\"{$thisCategory}\">\n";
        $closeOptGroup = true;
    } else {
        $closeOptGroup = false;
    }
    if (isset($_REQUEST['newtemplate'])) {
        $selectedtext = $row['id'] == $_REQUEST['newtemplate'] ? ' selected="selected"' : '';
    } else {
        if (isset($content['template'])) {
            $selectedtext = $row['id'] == $content['template'] ? ' selected="selected"' : '';
        } else {
            $default_template = getDefaultTemplate();
            $selectedtext = $row['id'] == $default_template ? ' selected="selected"' : '';
        }
    }
    echo "\t\t\t\t\t" . '<option value="' . $row['id'] . '"' . $selectedtext . '>' . $row['templatename'] . "</option>\n";
    $currentCategory = $thisCategory;
}
if ($thisCategory != '') {
    echo "\t\t\t\t\t</optgroup>\n";
}
?>
                </select> &nbsp;&nbsp;<img src="<?php 
echo $_style["icons_tooltip_over"];
?>
" onmouseover="this.src='<?php 
echo $_style["icons_tooltip"];
Example #4
0
 function _maskTemplateManager()
 {
     require_once _base_ . '/lib/lib.form.php';
     require_once $GLOBALS['where_framework'] . '/lib/lib.field.php';
     require_once _base_ . '/lib/lib.table.php';
     $lang =& DoceboLanguage::createInstance('configuration', 'framework');
     $field_man = new FieldList();
     $html = '';
     if (isset($_POST['save_and_refresh'])) {
         if (!sql_query("\r\n\t\t\tUPDATE " . $this->table . "\r\n\t\t\tSET param_value = '" . $_POST['templ_use_field'] . "'\r\n\t\t\tWHERE pack = 'main' AND param_name = 'templ_use_field'")) {
             $html .= getErrorUi('_ERROR_WHILE_SAVING_NEW_FIELD');
         } else {
             setTemplate($_POST['templ_use_field']);
         }
     }
     $drop_field = array();
     $drop_field = $field_man->getFlatAllFields(false, 'dropdown');
     $drop_field[0] = $lang->def('_NO');
     $html .= Form::getDropdown($lang->def('_TEMPL_USE_FIELD'), 'templ_use_field', 'templ_use_field', $drop_field, Get::sett('templ_use_field'));
     $html .= Form::getButton('save_and_refresh', 'save_and_refresh', $lang->def('_SAVE_AND_REFRESH'));
     if (Get::sett('templ_use_field') != 0) {
         $field_obj =& $field_man->getFieldInstance(Get::sett('templ_use_field'));
         if ($field_obj === NULL) {
             return $html . getErrorUi('_ERROR_WITH_THIS_FIELD');
         }
         $assignement = array();
         $query_template_assigned = "\r\n\t\t\tSELECT ref_id, template_code\r\n\t\t\tFROM " . $GLOBALS['prefix_fw'] . "_field_template\r\n\t\t\tWHERE id_common = '" . Get::sett('templ_use_field') . "'";
         $re_templ_assigned = sql_query($query_template_assigned);
         while (list($ref_id, $template_code) = sql_fetch_row($re_templ_assigned)) {
             $assignement[$ref_id] = $template_code;
         }
         $son_value = $field_obj->getAllSon();
         $template_list = getTemplateList(true);
         $default_template = getDefaultTemplate();
         $tb_son = new Table(0, $lang->def('_ASSIGN_DROPDOWN_VALUE_TEMPLATE'), $lang->def('_ASSIGN_DROPDOWN_VALUE_TEMPLATE_SUMMARY'));
         $cont_h = array($lang->def('_VALUE'), $lang->def('_TEMPLATE_VALUE'));
         $type_h = array('', '');
         $tb_son->setColsStyle($type_h);
         $tb_son->addHead($cont_h);
         while (list($id_son, $drop_son_name) = each($son_value)) {
             $cont = array('<label for="template_selected_' . $id_son . '">' . $drop_son_name . '</label>', Form::getInputDropdown('dropdown', 'template_selected_' . $id_son, 'template_selected[' . $id_son . ']', $template_list, isset($assignement[$id_son]) && isset($template_list[$assignement[$id_son]]) ? $assignement[$id_son] : $default_template, ''));
             $tb_son->addBody($cont);
         }
         $html .= $tb_son->getTable();
     }
     return $html;
 }
function getEasyDesignCss()
{
    return DIR_WS_TEMPLATES . getDefaultTemplate() . '/css/' . FILENAME_EASY_DESIGN_CSS;
}
            echo EASY_DESIGN_TAGLINE;
            ?>
</p>
<?php 
        }
        if ($category_depth == 'top') {
            ?>
<h1 id="logo"><?php 
            echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '"><img src="' . getLogoImage(getDefaultTemplate()) . '" alt="' . TITLE . '" title="' . TITLE . '"/></a>';
            ?>
</h1>
<?php 
        } else {
            ?>
<p id="logo"><?php 
            echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '"><img src="' . getLogoImage(getDefaultTemplate()) . '" alt="' . LINK_TO_HOME . '" title="' . LINK_TO_HOME . '"/></a>';
            ?>
</p>
<?php 
        }
    }
    ?>

<?php 
    // displays addon_modules layout blocks
    if ($header) {
        ?>
<div id="header-content">
<?php 
        echo $header;
        ?>
 public function addfolder_dialog()
 {
     //check permissions
     if (!$this->permissions['add_org']) {
         $output = array('success' => false, 'message' => $this->_getErrorMessage('no permission'));
         echo $this->json->encode($output);
         return;
     }
     $id_parent = Get::req('id', DOTY_INT, 0);
     if ($id_parent < 0) {
         $id_parent = 0;
     }
     $template = getDefaultTemplate();
     $template_arr = getTemplateList();
     $template_tmp_arr = array_flip($template_arr);
     $template_id = $template_tmp_arr[$template];
     unset($template_tmp_arr);
     $this->render('add_folder', array('id_parent' => $id_parent, 'title' => Lang::t('_ORGCHART_ADDNODE', 'organization_chart'), 'json' => $this->json, 'default_template' => $template_id));
 }
Example #8
0
                            $error .= "<br/>" . TEXT_UPDATE_FAILURE_LOGO_UNLINK;
                        }
                        if ($result == "DIR") {
                            $error .= "<br/>" . TEXT_UPDATE_FAILURE_LOGO_DIR;
                        }
                        if ($result == "PERMIT") {
                            $error .= "<br/>" . TEXT_UPDATE_FAILURE_LOGO_PERMIT;
                        }
                    }
                }
            }
        }
    }
}
// 全言語テンプレート情報取得
$selected_template = getDefaultTemplate();
$selected_index = 0;
for ($i = 0; $i < count($template_info); $i++) {
    if ($template_info[$i]['id'] == $selected_template) {
        $selected_index = $i;
        break;
    }
}
// 文言取得
$objection = getObjectionWords();
// ロゴ取得
$logo = getLogoImage($selected_template, true);
?>
<div class="messageStackSuccess"><?php 
echo $message;
?>