本文整理汇总了PHP中rex_article类的典型用法代码示例。如果您正苦于以下问题:PHP rex_article类的具体用法?PHP rex_article怎么用?PHP rex_article使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了rex_article类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: enterObject
function enterObject()
{
$article = new rex_article();
if ($article->setArticleId($this->getElement(1))) {
$this->params['form_output'][$this->getId()] = $this->parse('value.article.tpl.php', array('article' => $article));
}
}
开发者ID:Barnhiac,项目名称:MTW_REDAXO,代码行数:7,代码来源:class.xform.article.inc.php
示例2: rex_newsletter_sendmail
function rex_newsletter_sendmail($userinfo, $aid, $mail_reply, $mail_subject)
{
global $REX;
$tmp_redaxo = $REX['REDAXO'];
$REX['REDAXO'] = true;
// ***** HTML VERSION KOMPLETT
$REX_ARTICLE = new rex_article();
$REX_ARTICLE->setCLang(0);
$REX_ARTICLE->setArticleId($aid);
$REX_ARTICLE->getContentAsQuery(TRUE);
// $REX_ARTICLE->setTemplateId(xx);
$REX['ADDON']['NEWSLETTER_TEXT'] = FALSE;
$html_body = $REX_ARTICLE->getArticleTemplate();
// ***** TEXT VERSION
$REX_ARTICLE = new rex_article();
$REX_ARTICLE->setCLang(0);
$REX_ARTICLE->setArticleId($aid);
$REX_ARTICLE->getContentAsQuery(TRUE);
// $REX_ARTICLE->setTemplateId(xx);
$REX['ADDON']['NEWSLETTER_TEXT'] = TRUE;
// FILTERN VERSION KOMPLETT
$text_body = $REX_ARTICLE->getArticle();
$text_body = str_replace("<br />", "<br />", $text_body);
$text_body = str_replace("<p>", "\n\n</p>", $text_body);
$text_body = str_replace("<ul>", "\n\n</ul>", $text_body);
$text_body = preg_replace("#(\\<)(.*)(\\>)#imsU", "", $text_body);
$text_body = html_entity_decode($text_body);
$REX['REDAXO'] = true;
// ***** MAIL VERSAND
// Allgemeine Initialisierung
// $mail = new PHPMailer();
$mail = new rex_mailer();
$mail->AddAddress($userinfo["email"]);
$mail->From = $mail_reply;
$mail->FromName = $mail_reply;
$subject = $mail_subject;
// Subject
// Bodies
// html
foreach ($userinfo as $k => $v) {
$subject = str_replace("###" . $k . "###", $v, $subject);
$html_body = str_replace("###" . $k . "###", $v, $html_body);
$text_body = str_replace("###" . $k . "###", $v, $text_body);
$subject = str_replace("###" . strtoupper($k) . "###", $v, $subject);
$html_body = str_replace("###" . strtoupper($k) . "###", $v, $html_body);
$text_body = str_replace("###" . strtoupper($k) . "###", $v, $text_body);
}
// text
// echo "<pre>$text_body</pre>";
$mail->Subject = $subject;
$mail->AltBody = $text_body;
$mail->Body = $html_body;
$mail->Send();
$REX['REDAXO'] = $tmp_redaxo;
}
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:55,代码来源:config.inc.php
示例3: addNewstoSitemap
public static function addNewstoSitemap($params)
{
$mainArticle = rex_asd_news_config::getConfig('article');
$mainArticle = new rex_article($mainArticle);
foreach (rex_asd_news::getByWhere(array('clang' => null)) as $news) {
/** @var rex_asd_news $news */
$fragment = array('loc' => $news->getUrl(), 'lastmod' => $news->getPublishDate()->format('c'), 'changefreq' => self::calc_article_changefreq($news->getPublishDate()->getTimestamp()), 'priority' => self::calc_article_priority($mainArticle->getValue('id'), $mainArticle->getValue('clang'), $mainArticle->getValue('path') . '|' . $news->getValue('id')));
$params['subject'][rex_asd_news_config::getName()][] = $fragment;
}
return $params['subject'];
}
开发者ID:Sysix,项目名称:asd_news,代码行数:11,代码来源:rex_asd_news_sitemap.php
示例4: matchArticle
/**
* Wert für die Ausgabe
*/
function matchArticle($content)
{
$var = 'REX_ARTICLE';
$matches = $this->getArticleInputParams($content, $var);
foreach ($matches as $match) {
list($param_str, $article_id, $clang) = $match;
$article = new rex_article($article_id, $clang);
$content = str_replace($var . '[' . $param_str . ']', $article->getArticle(), $content);
}
return $content;
}
开发者ID:BackupTheBerlios,项目名称:redaxo,代码行数:14,代码来源:class.rex_var_article.inc.php
示例5: getListValue
static function getListValue($params)
{
if (intval($params['value']) < 1) {
return '-';
}
if ($art = new rex_article($params['value'])) {
return $art->getValue('name');
} else {
return 'article ' . $params['value'] . ' not found';
}
}
开发者ID:Barnhiac,项目名称:MTW_REDAXO,代码行数:11,代码来源:class.xform.be_link.inc.php
示例6: getCustomUrl
/**
* @param rex_article $art
* @param rex_yrewrite_domain $domain
*
* @return string|false
*/
public function getCustomUrl(rex_article $art, rex_yrewrite_domain $domain)
{
if ($domain->getStartId() == $art->getId()) {
if ($domain->getStartClang() == $art->getClang()) {
return '/';
}
return $this->getClang($art->getClang(), $domain) . '/';
}
if ($url = $art->getValue('yrewrite_url')) {
return $url;
}
return false;
}
开发者ID:tzfrs,项目名称:redaxo_yrewrite,代码行数:19,代码来源:scheme.php
示例7: rex_getUrl
/**
* Gibt eine Url zu einem Artikel zurück.
*
* @param string $_id
* @param int|string $_clang SprachId des Artikels
* @param array|string $_params Array von Parametern
* @param bool $escape Flag whether the argument separator "&" should be escaped (&)
*
* @return string
*
* @package redaxo\structure
*/
function rex_getUrl($_id = '', $_clang = '', $_params = '', $escape = true)
{
$id = (int) $_id;
$clang = (int) $_clang;
// ----- get id
if ($id == 0) {
$id = rex::getProperty('article_id');
}
// ----- get clang
// Wenn eine rexExtension vorhanden ist, immer die clang mitgeben!
// Die rexExtension muss selbst entscheiden was sie damit macht
if ($_clang === '' && (rex_clang::count() > 1 || rex_extension::isRegistered('URL_REWRITE'))) {
$clang = rex_clang::getCurrentId();
}
// ----- get params
$param_string = rex_param_string($_params, $escape ? '&' : '&');
$name = 'NoName';
if ($id != 0) {
$ooa = rex_article::get($id, $clang);
if ($ooa) {
$name = rex_parse_article_name($ooa->getName());
}
}
// ----- EXTENSION POINT
$url = rex_extension::registerPoint(new rex_extension_point('URL_REWRITE', '', ['id' => $id, 'name' => $name, 'clang' => $clang, 'params' => $param_string, 'escape' => $escape]));
if ($url == '') {
$_clang = '';
if (rex_clang::count() > 1) {
$_clang .= ($escape ? '&' : '&') . 'clang=' . $clang;
}
$url = rex_url::frontendController() . '?article_id=' . $id . $_clang . $param_string;
}
return $url;
}
开发者ID:skerbis,项目名称:redaxo,代码行数:46,代码来源:function_rex_url.php
示例8: getForward
public static function getForward($params)
{
// Url wurde von einer anderen Extension bereits gesetzt
if (isset($params['subject']) && $params['subject'] != '') {
return $params['subject'];
}
self::init();
$domain = $params['domain'];
if ($domain == 'undefined') {
$domain = '';
}
$url = $params['url'];
foreach (self::$paths as $p) {
if ($p['domain'] == $domain && ($p['url'] == $url || $p['url'] . '/' == $url)) {
$forward_url = '';
if ($p['type'] == 'article' && ($art = rex_article::get($p['article_id'], $p['clang']))) {
$forward_url = rex_getUrl($p['article_id'], $p['clang']);
} elseif ($p['type'] == 'media' && ($media = rex_media::get($p['media']))) {
$forward_url = '/files/' . $p['media'];
} elseif ($p['type'] == 'extern' && $p['extern'] != '') {
$forward_url = $p['extern'];
}
if ($forward_url != '') {
header('HTTP/1.1 ' . self::$movetypes[$p['movetype']]);
header('Location: ' . $forward_url);
exit;
}
}
}
return false;
}
开发者ID:tzfrs,项目名称:redaxo_yrewrite,代码行数:31,代码来源:forward.php
示例9: getWidget
public static function getWidget($id, $name, $value, array $args = [])
{
$art_name = '';
$art = rex_article::get($value);
$category = 0;
// Falls ein Artikel vorausgewählt ist, dessen Namen anzeigen und beim öffnen der Linkmap dessen Kategorie anzeigen
if ($art instanceof rex_article) {
$art_name = $art->getName();
$category = $art->getCategoryId();
}
$open_params = '&clang=' . rex_clang::getCurrentId();
if ($category || isset($args['category']) && ($category = (int) $args['category'])) {
$open_params .= '&category_id=' . $category;
}
$class = ' rex-disabled';
$open_func = '';
$delete_func = '';
if (rex::getUser()->getComplexPerm('structure')->hasStructurePerm()) {
$class = '';
$open_func = 'openLinkMap(\'REX_LINK_' . $id . '\', \'' . $open_params . '\');';
$delete_func = 'deleteREXLink(' . $id . ');';
}
$e = [];
$e['field'] = '<input class="form-control" type="text" name="REX_LINK_NAME[' . $id . ']" value="' . htmlspecialchars($art_name) . '" id="REX_LINK_' . $id . '_NAME" readonly="readonly" /><input type="hidden" name="' . $name . '" id="REX_LINK_' . $id . '" value="' . $value . '" />';
$e['functionButtons'] = '
<a href="#" class="btn btn-popup' . $class . '" onclick="' . $open_func . 'return false;" title="' . rex_i18n::msg('var_link_open') . '"><i class="rex-icon rex-icon-open-linkmap"></i></a>
<a href="#" class="btn btn-popup' . $class . '" onclick="' . $delete_func . 'return false;" title="' . rex_i18n::msg('var_link_delete') . '"><i class="rex-icon rex-icon-delete-link"></i></a>';
$fragment = new rex_fragment();
$fragment->setVar('elements', [$e], false);
$media = $fragment->parse('core/form/widget.php');
return $media;
}
开发者ID:DECAF,项目名称:redaxo,代码行数:32,代码来源:var_link.php
示例10: rex_getUrl
/**
* Gibt eine Url zu einem Artikel zurück.
*
* @param int|null $id
* @param int|null $clang SprachId des Artikels
* @param array $params Array von Parametern
* @param string $separator
*
* @return string
*
* @package redaxo\structure
*/
function rex_getUrl($id = null, $clang = null, array $params = [], $separator = '&')
{
$id = (int) $id;
$clang = (int) $clang;
// ----- get id
if ($id == 0) {
$id = rex_article::getCurrentId();
}
// ----- get clang
// Wenn eine rexExtension vorhanden ist, immer die clang mitgeben!
// Die rexExtension muss selbst entscheiden was sie damit macht
if (!rex_clang::exists($clang) && (rex_clang::count() > 1 || rex_extension::isRegistered('URL_REWRITE'))) {
$clang = rex_clang::getCurrentId();
}
// ----- EXTENSION POINT
$url = rex_extension::registerPoint(new rex_extension_point('URL_REWRITE', '', ['id' => $id, 'clang' => $clang, 'params' => $params, 'separator' => $separator]));
if ($url == '') {
if (rex_clang::count() > 1) {
$clang = $separator . 'clang=' . $clang;
} else {
$clang = '';
}
$params = rex_string::buildQuery($params, $separator);
$params = $params ? $separator . $params : '';
$url = rex_url::frontendController() . '?article_id=' . $id . $clang . $params;
}
return $url;
}
开发者ID:staabm,项目名称:redaxo,代码行数:40,代码来源:function_rex_url.php
示例11: replaceVars
static function replaceVars($template, $er = array())
{
$r = rex_extension::registerPoint(new rex_extension_point('YFORM_EMAIL_BEFORE_REPLACEVARS', ['template' => $template, 'search_replace' => $er, 'status' => false]));
$template = $r['template'];
$er = $r['search_replace'];
$status = $r['status'];
if ($status) {
return true;
}
$er['REX_SERVER'] = rex::getServer();
$er['REX_ERROR_EMAIL'] = rex::getErrorEmail();
$er['REX_SERVERNAME'] = rex::getServerName();
$er['REX_NOTFOUND_ARTICLE_ID'] = rex_article::getNotfoundArticleId();
$er['REX_ARTICLE_ID'] = rex_article::getCurrentId();
$template['body'] = rex_var::parse($template['body'], '', 'yform_email_template', $er);
$template['body_html'] = rex_var::parse($template['body_html'], '', 'yform_email_template', $er);
// rex_vars bug: sonst wird der Zeilenumbruch entfernt - wenn DATA_VAR am Ende einer Zeile
if (rex_string::versionCompare(rex::getVersion(), '5.0.1', '<')) {
$template['body'] = str_replace("?>\r", "?>\r\n\r", $template['body']);
$template['body'] = str_replace("?>\n", "?>\n\r\n", $template['body']);
$template['body_html'] = str_replace("?>\r", "?>\r\n\r", $template['body_html']);
$template['body_html'] = str_replace("?>\n", "?>\n\r\n", $template['body_html']);
}
$template['body'] = rex_file::getOutput(rex_stream::factory('yform/email/template/' . $template['name'] . '/body', $template['body']));
$template['body_html'] = rex_file::getOutput(rex_stream::factory('yform/email/template/' . $template['name'] . '/body_html', $template['body_html']));
return $template;
}
开发者ID:VIEWSION,项目名称:redaxo_yform,代码行数:27,代码来源:yform_email_template.php
示例12: isValid
public function isValid($value)
{
$article = rex_article::get($value);
if (!$article instanceof rex_article) {
return rex_i18n::msg('system_setting_' . $this->key . '_invalid');
}
return true;
}
开发者ID:skerbis,项目名称:redaxo,代码行数:8,代码来源:system_setting_article_id.php
示例13: getForm
public function getForm(array $params)
{
$OOArt = rex_article::get($params['id'], $params['clang']);
$params['activeItem'] = $params['article'];
// Hier die category_id setzen, damit beim klick auf den REX_LINK_BUTTON der Medienpool in der aktuellen Kategorie startet
$params['activeItem']->setValue('category_id', $OOArt->getCategoryId());
return parent::renderFormAndSave(self::PREFIX, $params);
}
开发者ID:skerbis,项目名称:redaxo,代码行数:8,代码来源:article_handler.php
示例14: getArticleValue
public static function getArticleValue($id, $field, $clang = null)
{
if ($clang === null) {
$clang = rex_clang::getCurrentId();
}
$article = rex_article::get($id, $clang);
return htmlspecialchars($article->getValue($field));
}
开发者ID:staabm,项目名称:redaxo,代码行数:8,代码来源:var_article.php
示例15: hasValue
public function hasValue($value)
{
// bc
if ($this->viasql) {
return parent::hasValue($value);
}
$value = $this->correctValue($value);
return rex_article::get($this->article_id, $this->clang)->hasValue($value);
}
开发者ID:staabm,项目名称:redaxo,代码行数:9,代码来源:article_content.php
示例16: setValue
public function setValue($value)
{
$value = (int) $value;
$article = rex_article::get($value);
if (!$article instanceof rex_article) {
return rex_i18n::msg('system_setting_' . $this->key . '_invalid');
}
rex_config::set('structure', $this->key, $value);
return true;
}
开发者ID:staabm,项目名称:redaxo,代码行数:10,代码来源:system_setting_article_id.php
示例17: deleteMeta
/**
* Löscht die gecachten Meta-Dateien eines Artikels. Wenn keine clang angegeben, wird
* der Artikel in allen Sprachen gelöscht.
*
* @param int $id ArtikelId des Artikels
* @param int $clang ClangId des Artikels
*
* @return bool True on success, False on errro
*/
public static function deleteMeta($id, $clang = null)
{
// sanity check
if ($id < 0) {
return false;
}
$cachePath = rex_path::addonCache('structure');
foreach (rex_clang::getAllIds() as $_clang) {
if ($clang !== null && $clang != $_clang) {
continue;
}
rex_file::delete($cachePath . $id . '.' . $_clang . '.article');
rex_article::clearInstance([$id, $_clang]);
rex_category::clearInstance([$id, $_clang]);
}
return true;
}
开发者ID:staabm,项目名称:redaxo,代码行数:26,代码来源:cache_article.php
示例18: getWidget
public static function getWidget($id, $name, $value, array $args = [])
{
$open_params = '&clang=' . rex_clang::getCurrentId();
if (isset($args['category']) && ($category = (int) $args['category'])) {
$open_params .= '&category_id=' . $category;
}
$options = '';
$linklistarray = explode(',', $value);
if (is_array($linklistarray)) {
foreach ($linklistarray as $link) {
if ($link != '') {
if ($article = rex_article::get($link)) {
$options .= '<option value="' . $link . '">' . htmlspecialchars($article->getName()) . '</option>';
}
}
}
}
$disabled = ' disabled';
$open_func = '';
$delete_func = '';
if (rex::getUser()->getComplexPerm('structure')->hasStructurePerm()) {
$disabled = '';
$open_func = 'openREXLinklist(' . $id . ', \'' . $open_params . '\');';
$delete_func = 'deleteREXLinklist(' . $id . ');';
}
$e = [];
$e['field'] = '
<select class="form-control" name="REX_LINKLIST_SELECT[' . $id . ']" id="REX_LINKLIST_SELECT_' . $id . '" size="10">
' . $options . '
</select>
<input type="hidden" name="' . $name . '" id="REX_LINKLIST_' . $id . '" value="' . $value . '" />';
$e['moveButtons'] = '
<a href="#" class="btn btn-popup" onclick="moveREXLinklist(' . $id . ',\'top\');return false;" title="' . rex_i18n::msg('var_linklist_move_top') . '"><i class="rex-icon rex-icon-top"></i></a>
<a href="#" class="btn btn-popup" onclick="moveREXLinklist(' . $id . ',\'up\');return false;" title="' . rex_i18n::msg('var_linklist_move_up') . '"><i class="rex-icon rex-icon-up"></i></a>
<a href="#" class="btn btn-popup" onclick="moveREXLinklist(' . $id . ',\'down\');return false;" title="' . rex_i18n::msg('var_linklist_move_down') . '"><i class="rex-icon rex-icon-down"></i></a>
<a href="#" class="btn btn-popup" onclick="moveREXLinklist(' . $id . ',\'bottom\');return false;" title="' . rex_i18n::msg('var_linklist_move_bottom') . '"><i class="rex-icon rex-icon-bottom"></i></a>';
$e['functionButtons'] = '
<a href="#" class="btn btn-popup" onclick="' . $open_func . 'return false;" title="' . rex_i18n::msg('var_link_open') . '"' . $disabled . '><i class="rex-icon rex-icon-open-linkmap"></i></a>
<a href="#" class="btn btn-popup" onclick="' . $delete_func . 'return false;" title="' . rex_i18n::msg('var_link_delete') . '"' . $disabled . '><i class="rex-icon rex-icon-delete-link"></i></a>';
$fragment = new rex_fragment();
$fragment->setVar('elements', [$e], false);
$link = $fragment->parse('core/form/widget_list.php');
return $link;
}
开发者ID:staabm,项目名称:redaxo,代码行数:44,代码来源:var_linklist.php
示例19: execute
public function execute()
{
$article_id = rex_request('article_id', 'int');
$clang = rex_request('clang', 'int');
$slice_id = rex_request('slice_id', 'int');
$direction = rex_request('direction', 'string');
$ooArt = rex_article::get($article_id, $clang);
if (!$ooArt instanceof rex_article) {
throw new rex_api_exception('Unable to find article with id "' . $article_id . '" and clang "' . $clang . '"!');
}
$category_id = $ooArt->getCategoryId();
/**
* @var rex_user
*/
$user = rex::getUser();
// check permissions
if (!$user->hasPerm('moveSlice[]')) {
throw new rex_api_exception(rex_i18n::msg('no_rights_to_this_function'));
}
if (!$user->getComplexPerm('structure')->hasCategoryPerm($category_id)) {
throw new rex_api_exception(rex_i18n::msg('no_rights_to_this_function'));
}
// modul und rechte vorhanden ?
$CM = rex_sql::factory();
$CM->setQuery('select * from ' . rex::getTablePrefix() . 'article_slice left join ' . rex::getTablePrefix() . 'module on ' . rex::getTablePrefix() . 'article_slice.module_id=' . rex::getTablePrefix() . 'module.id where ' . rex::getTablePrefix() . "article_slice.id='{$slice_id}' and clang_id={$clang}");
if ($CM->getRows() != 1) {
throw new rex_api_exception(rex_i18n::msg('module_not_found'));
} else {
$module_id = (int) $CM->getValue(rex::getTablePrefix() . 'article_slice.module_id');
// ----- RECHTE AM MODUL ?
if ($user->getComplexPerm('modules')->hasPerm($module_id)) {
$message = rex_content_service::moveSlice($slice_id, $clang, $direction);
} else {
throw new rex_api_exception(rex_i18n::msg('no_rights_to_this_function'));
}
}
$result = new rex_api_result(true, $message);
return $result;
}
开发者ID:staabm,项目名称:redaxo,代码行数:39,代码来源:api_content.php
示例20: rex_metainfo_content_sidebar
function rex_metainfo_content_sidebar($extionPointParams)
{
$params = $extionPointParams->getParams();
$article = rex_article::get($params['article_id'], $params['clang']);
$articleStatusTypes = rex_article_service::statusTypes();
$panel = '';
$panel .= '<dl class="dl-horizontal">';
$panel .= '<dt>' . rex_i18n::msg('created_by') . '</dt>';
$panel .= '<dd>' . $article->getValue('createuser') . '</dd>';
$panel .= '<dt>' . rex_i18n::msg('created_on') . '</dt>';
$panel .= '<dd>' . rex_formatter::strftime($article->getValue('createdate'), 'date') . '</dd>';
$panel .= '<dt>' . rex_i18n::msg('updated_by') . '</dt>';
$panel .= '<dd>' . $article->getValue('updateuser') . '</dd>';
$panel .= '<dt>' . rex_i18n::msg('updated_on') . '</dt>';
$panel .= '<dd>' . rex_formatter::strftime($article->getValue('updatedate'), 'date') . '</dd>';
$panel .= '<dt>' . rex_i18n::msg('status') . '</dt>';
$panel .= '<dd class="' . $articleStatusTypes[$article->getValue('status')][1] . '">' . $articleStatusTypes[$article->getValue('status')][0] . '</dd>';
$panel .= '</dl>';
$fragment = new rex_fragment();
$fragment->setVar('title', rex_i18n::msg('metadata'), false);
$fragment->setVar('body', $panel, false);
$content = $fragment->parse('core/page/section.php');
return $content;
}
开发者ID:skerbis,项目名称:redaxo,代码行数:24,代码来源:extension_content_sidebar.php
注:本文中的rex_article类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论