本文整理汇总了PHP中OOCategory::getTemplates方法的典型用法代码示例。如果您正苦于以下问题:PHP OOCategory::getTemplates方法的具体用法?PHP OOCategory::getTemplates怎么用?PHP OOCategory::getTemplates使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OOCategory
的用法示例。
在下文中一共展示了OOCategory::getTemplates方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: stripslashes
// Zuweisungen für Wiederanzeige
$REX['MOD_REWRITE'] = $neu_modrewrite === 'TRUE';
// FŸr die Wiederanzeige Slashes strippen
$REX['ERROR_EMAIL'] = stripslashes($neu_error_emailaddress);
$REX['SERVER'] = stripslashes($neu_SERVER);
$REX['SERVERNAME'] = stripslashes($neu_SERVERNAME);
}
}
}
$sel_template = new rex_select();
$sel_template->setStyle('class="rex-form-select"');
$sel_template->setName('neu_defaulttemplateid');
$sel_template->setId('rex-form-default-template-id');
$sel_template->setSize(1);
$sel_template->setSelected($REX['DEFAULT_TEMPLATE_ID']);
$templates = OOCategory::getTemplates(0);
if (empty($templates)) {
$sel_template->addOption($I18N->msg('option_no_template'), 0);
} else {
$sel_template->addArrayOptions($templates);
}
$sel_lang = new rex_select();
$sel_lang->setStyle('class="rex-form-select"');
$sel_lang->setName('neu_lang');
$sel_lang->setId('rex-form-lang');
$sel_lang->setSize(1);
$sel_lang->setSelected($REX['LANG']);
foreach ($REX['LOCALES'] as $l) {
$sel_lang->addOption($l, $l);
}
$sel_mod_rewrite = new rex_select();
示例2: rex_editArticle
/**
* Bearbeitet einen Artikel
*
* @param int $article_id Id des Artikels der verändert werden soll
* @param int $clang Id der Sprache
* @param array $data Array mit den Daten des Artikels
*
* @return array Ein Array welches den status sowie eine Fehlermeldung beinhaltet
*/
function rex_editArticle($article_id, $clang, $data)
{
global $REX, $I18N;
$success = false;
$message = '';
if (!is_array($data)) {
trigger_error('Expecting $data to be an array!', E_USER_ERROR);
}
$templates = OOCategory::getTemplates($data['category_id']);
// Wenn Template nicht vorhanden, dann entweder erlaubtes nehmen
// oder leer setzen.
if (!isset($templates[$data['template_id']])) {
$data['template_id'] = 0;
if (count($templates) > 0) {
$data['template_id'] = key($templates);
}
}
// Artikel mit alten Daten selektieren
$thisArt = rex_sql::factory();
$thisArt->setQuery('select * from ' . $REX['TABLE_PREFIX'] . 'article where id=' . $article_id . ' and clang=' . $clang);
if (isset($data['prior'])) {
if ($data['prior'] <= 0) {
$data['prior'] = 1;
}
}
$EA = rex_sql::factory();
$EA->setTable($REX['TABLE_PREFIX'] . 'article');
$EA->setWhere("id='{$article_id}' and clang={$clang}");
$EA->setValue('name', $data['name']);
$EA->setValue('template_id', $data['template_id']);
$EA->setValue('prior', $data['prior']);
$EA->addGlobalUpdateFields();
if ($EA->update()) {
$message = $I18N->msg('article_updated');
// ----- PRIOR
rex_newArtPrio($data['category_id'], $clang, $data['prior'], $thisArt->getValue('prior'));
rex_deleteCacheArticle($article_id, $clang);
// ----- EXTENSION POINT
$message = rex_register_extension_point('ART_UPDATED', $message, array('id' => $article_id, 'article' => clone $EA, 'article_old' => clone $thisArt, 'status' => $thisArt->getValue('status'), 'name' => $data['name'], 'clang' => $clang, 're_id' => $data['category_id'], 'prior' => $data['prior'], 'path' => $data['path'], 'template_id' => $data['template_id'], 'data' => $data));
$success = true;
} else {
$message = $EA->getError();
}
return array($success, $message);
}
示例3: rex_select
</form>
</div>';
}
echo '
<!-- *** OUTPUT CATEGORIES - END *** -->
';
// --------------------------------------------- ARTIKEL LISTE
echo '
<!-- *** OUTPUT ARTICLES - START *** -->';
// --------------------- READ TEMPLATES
if ($category_id > 0 || $category_id == 0 && !$REX['USER']->hasMountpoints()) {
$template_select = new rex_select();
$template_select->setName('template_id');
$template_select->setId('rex-form-template');
$template_select->setSize(1);
$templates = OOCategory::getTemplates($category_id);
if (count($templates) > 0) {
foreach ($templates as $t_id => $t_name) {
$template_select->addOption(rex_translate($t_name, null, false), $t_id);
$TEMPLATE_NAME[$t_id] = rex_translate($t_name);
}
} else {
$template_select->addOption($I18N->msg('option_no_template'), '0');
$TEMPLATE_NAME[0] = $I18N->msg('template_default_name');
}
// --------------------- ARTIKEL LIST
$art_add_link = '';
if ($KATPERM && !$REX['USER']->hasPerm('editContentOnly[]')) {
$art_add_link = '<a class="rex-i-element rex-i-article-add" href="index.php?page=structure&category_id=' . $category_id . '&function=add_art&clang=' . $clang . '"' . rex_accesskey($I18N->msg('article_add'), $REX['ACKEY']['ADD_2']) . '><span class="rex-i-element-text">' . $I18N->msg('article_add') . '</span></a>';
}
$add_head = '';