\n`]]"
},{
id: 'modx-content-below'
,border: false
@@ -1651,4 +1651,4 @@ Articles.combo.Shorteners = function(config) {
Articles.combo.Shorteners.superclass.constructor.call(this,config);
};
Ext.extend(Articles.combo.Shorteners,MODx.combo.ComboBox);
-Ext.reg('articles-combo-shorteners',Articles.combo.Shorteners);
\ No newline at end of file
+Ext.reg('articles-combo-shorteners',Articles.combo.Shorteners);
diff --git a/assets/components/articles/js/container/create.js b/assets/components/articles/js/container/create.js
index d66666f..759a91a 100644
--- a/assets/components/articles/js/container/create.js
+++ b/assets/components/articles/js/container/create.js
@@ -221,7 +221,15 @@ Ext.extend(Articles.panel.Container,MODx.panel.Resource,{
,id: 'modx-resource-hidemenu'
,inputValue: 1
,checked: parseInt(config.record.hidemenu) || false
-
+ },{
+ xtype: 'xcheckbox'
+ ,boxLabel: _('resource_folder')
+ ,hideLabel: true
+ ,description: '[[*isfolder]] '+_('resource_folder_help')
+ ,name: 'isfolder'
+ ,id: 'modx-resource-isfolder'
+ ,inputValue: 1
+ ,checked: parseInt(config.record.isfolder) || true
},{
xtype: 'xcheckbox'
,boxLabel: _('resource_published')
diff --git a/assets/components/articles/js/container/update.js b/assets/components/articles/js/container/update.js
index 0473ee9..1064d35 100644
--- a/assets/components/articles/js/container/update.js
+++ b/assets/components/articles/js/container/update.js
@@ -241,7 +241,15 @@ Ext.extend(Articles.panel.Container,MODx.panel.Resource,{
,id: 'modx-resource-hidemenu'
,inputValue: 1
,checked: parseInt(config.record.hidemenu) || false
-
+ },{
+ xtype: 'xcheckbox'
+ ,boxLabel: _('resource_folder')
+ ,hideLabel: true
+ ,description: '[[*isfolder]] '+_('resource_folder_help')
+ ,name: 'isfolder'
+ ,id: 'modx-resource-isfolder'
+ ,inputValue: 1
+ ,checked: parseInt(config.record.isfolder) || false
},{
xtype: 'xcheckbox'
,boxLabel: _('resource_published')
diff --git a/assets/components/articles/js/extras/tagfield.js b/assets/components/articles/js/extras/tagfield.js
index b7c690c..1721628 100755
--- a/assets/components/articles/js/extras/tagfield.js
+++ b/assets/components/articles/js/extras/tagfield.js
@@ -137,7 +137,7 @@ Ext.extend(Articles.extra.Tags,Ext.form.ComboBox,{
this.el.parent().wrap({
tag: 'div'
- ,class: 'bxr-field-tags'
+ ,class: 'bxr-field-tags x-superboxselect' // x-superboxselect class needed to correctly display the tag remove button/cross
});
this.el.parent().wrap({
diff --git a/core/components/articles/controllers/article/create.class.php b/core/components/articles/controllers/article/create.class.php
index fba76d6..fce9d97 100755
--- a/core/components/articles/controllers/article/create.class.php
+++ b/core/components/articles/controllers/article/create.class.php
@@ -19,7 +19,9 @@
*
* @package articles
*/
-require_once $modx->getOption('manager_path',null,MODX_MANAGER_PATH).'controllers/default/resource/create.class.php';
+if(!class_exists('ResourceCreateManagerController')) {
+ require_once $modx->getOption('manager_path',null,MODX_MANAGER_PATH).'controllers/'.$modx->getOption('manager_theme',null,'default').'/resource/create.class.php';
+}
/**
* @package articles
*/
@@ -73,7 +75,6 @@ public function getLanguageTopics() {
public function process(array $scriptProperties = array()) {
$placeholders = parent::process($scriptProperties);
- $this->resourceArray['published'] = 0;
$this->getDefaultContainerSettings();
return $placeholders;
}
@@ -87,6 +88,7 @@ public function getDefaultContainerSettings() {
$settings = $container->getProperties('articles');
$this->resourceArray['template'] = $this->modx->getOption('articleTemplate',$settings,0);
$this->resourceArray['richtext'] = $this->modx->getOption('articlesRichtext',$settings,1);
+ $this->resourceArray['published'] = $this->modx->getOption('articlesPublished',$settings,$this->modx->getOption('publish_default', null, 0));
}
}
}
\ No newline at end of file
diff --git a/core/components/articles/controllers/article/update.class.php b/core/components/articles/controllers/article/update.class.php
index 57e4376..6e9aa32 100755
--- a/core/components/articles/controllers/article/update.class.php
+++ b/core/components/articles/controllers/article/update.class.php
@@ -19,7 +19,9 @@
*
* @package articles
*/
-require_once $modx->getOption('manager_path',null,MODX_MANAGER_PATH).'controllers/default/resource/update.class.php';
+if(!class_exists('ResourceUpdateManagerController')) {
+ require_once $modx->getOption('manager_path',null,MODX_MANAGER_PATH).'controllers/'.$modx->getOption('manager_theme',null,'default').'/resource/update.class.php';
+}
/**
* @package articles
*/
diff --git a/core/components/articles/controllers/container/create.class.php b/core/components/articles/controllers/container/create.class.php
index b1a1475..c2f3c0c 100644
--- a/core/components/articles/controllers/container/create.class.php
+++ b/core/components/articles/controllers/container/create.class.php
@@ -19,7 +19,9 @@
*
* @package articles
*/
-require_once $modx->getOption('manager_path',null,MODX_MANAGER_PATH).'controllers/default/resource/create.class.php';
+if(!class_exists('ResourceCreateManagerController')) {
+ require_once $modx->getOption('manager_path',null,MODX_MANAGER_PATH).'controllers/'.$modx->getOption('manager_theme',null,'default').'/resource/create.class.php';
+}
/**
* @package articles
*/
@@ -33,6 +35,7 @@ public function loadCustomCssJs() {
$connectorUrl = $articlesAssetsUrl.'connector.php';
$articlesJsUrl = $articlesAssetsUrl.'js/';
$this->resourceArray['articles_container_settings'] = $this->resource->getContainerSettings();
+ $this->resourceArray['isfolder'] = true;
$this->addJavascript($managerUrl.'assets/modext/util/datetime.js');
$this->addJavascript($managerUrl.'assets/modext/widgets/element/modx.panel.tv.renders.js');
$this->addJavascript($managerUrl.'assets/modext/widgets/resource/modx.grid.resource.security.js');
diff --git a/core/components/articles/controllers/container/update.class.php b/core/components/articles/controllers/container/update.class.php
index 8b2cf0a..34ab4fb 100644
--- a/core/components/articles/controllers/container/update.class.php
+++ b/core/components/articles/controllers/container/update.class.php
@@ -22,7 +22,9 @@
/**
* @var modX $modx
*/
-require_once $modx->getOption('manager_path',null,MODX_MANAGER_PATH).'controllers/default/resource/update.class.php';
+if(!class_exists('ResourceUpdateManagerController')) {
+ require_once $modx->getOption('manager_path',null,MODX_MANAGER_PATH).'controllers/'.$modx->getOption('manager_theme',null,'default').'/resource/update.class.php';
+}
/**
* @package articles
*/
diff --git a/core/components/articles/docs/changelog.txt b/core/components/articles/docs/changelog.txt
index 418f99a..4f8f62b 100644
--- a/core/components/articles/docs/changelog.txt
+++ b/core/components/articles/docs/changelog.txt
@@ -1,5 +1,40 @@
Changelog for Articles.
+Articles 1.7.9
+===============================
+- Add setting for default published status of new article
+- Updated getlist to be multibyte safe and article update getButtons override change
+- 2.3 Fixes
+
+Articles 1.7.8
+===============================
+- #92 Fix Articles save on update in Revolution 2.3
+
+Articles 1.7.7
+===============================
+- #90 Fix Articles in Revolution 2.3
+- #87 Implement compatibility for ContentBlocks (v1.1)
+
+Articles 1.7.6
+===============================
+ - #50 Conditionally load classes in controller
+ - #68 Fix False Positive on Confirm Navigation warning
+ - #64 Remove static html code from page.nav placeholder
+ - #62 Allow number at start of tag to be treated still as tag (@jasonbird)
+ - Update getResources to 1.6.1
+
+Articles 1.7.5
+===============================
+ - #54 Fix RSS Feeds (Revert PR #15,#25)
+
+Articles 1.7.4
+===============================
+ - Add support for disabled cache_alias_map
+
+Articles 1.7.3
+===============================
+ - Change package name from Articles to articles for xPDO compatibility
+
Articles 1.7.2
===============================
- Rebuilt tagging component. Thanks to Jan Peca (TheBoxer)
@@ -231,4 +266,4 @@ Articles 1.0.0
- Automatic archiving of Articles
- Integrated tagging
- Easy templating for containers and articles
-- Initial release.
\ No newline at end of file
+- Initial release.
diff --git a/core/components/articles/lexicon/de/default.inc.php b/core/components/articles/lexicon/de/default.inc.php
index 60b0e49..eead27c 100644
--- a/core/components/articles/lexicon/de/default.inc.php
+++ b/core/components/articles/lexicon/de/default.inc.php
@@ -154,7 +154,7 @@
$_lang['articles.setting.articleUriTemplate'] = 'Articles-URL-Format';
$_lang['articles.setting.articleUriTemplate_desc'] = '%Y = Jahr (4-stellig), %m = Monat (mit führenden Nullen), %d = Tag (mit führenden Nullen), %alias = Artikel-Alias, %id = Artikel-ID, %ext = Dateiendung (z.B. html). Hinweis: Änderungen an dieser Einstellung wirken sich nur auf *neue* Artikel aus, es sei denn, Sie ändern den Alias oder ziehen alte Artikel zurück und veröffentlichen sie erneut, wodurch ihre URLs im neuen Format neu generiert werden.';
-/* template / archives settings */
+/* Template / archives settings */
$_lang['articles.setting.articleTemplate'] = 'Artikel-Template';
$_lang['articles.setting.articleTemplate_desc'] = 'Das Template, das standardmäßig für Artikel verwendet wird.';
$_lang['articles.setting.tplArticleRow'] = 'Artikel-Zeilen-Chunk';
@@ -205,7 +205,7 @@
$_lang['articles.setting.rssAlias'] = 'RSS-Alias (Permalink)';
$_lang['articles.setting.rssAlias_desc'] = 'Der Alias (Permalink) für den RSS-Feed, der an die Articles-Container-URL angehängt wird.';
$_lang['articles.setting.rssItems'] = 'Anzahl der RSS-Elemente';
-$_lang['articles.setting.rssItems_desc'] = 'Die Anzahl der RSS-Elemente, die im RSS-Feed angezeigt werden sollen.';
+$_lang['articles.setting.rssItems_desc'] = 'Die Anzahl der RSS-Elemente, die im RSS-Feed angezeigt werden sollen. Geben Sie 0 ein für unbegrenzt viele Elemente.';
$_lang['articles.setting.tplRssFeed'] = 'RSS-Feed-Chunk';
$_lang['articles.setting.tplRssFeed_desc'] = 'Der Chunk, der für das RSS-Feed-Template verwendet wird.';
$_lang['articles.setting.tplRssItem'] = 'RSS-Element-Chunk';
@@ -228,6 +228,8 @@
$_lang['articles.setting.latestPostsLimit_desc'] = 'Die Anzahl der anzuzeigenden neuesten Artikel.';
$_lang['articles.setting.latestPostsOffset'] = 'Start-Index für neueste Artikel';
$_lang['articles.setting.latestPostsOffset_desc'] = 'Der Start-Index der Liste der neuesten Artikel.';
+$_lang['articles.setting.otherLatestPosts'] = 'Andere Listen-Parameter';
+$_lang['articles.setting.otherLatestPosts_desc'] = 'Alle anderen Eigenschaften, die Sie dem getResources-/getPage-Aufruf für das "Neueste Artikel"-Widget hinzufügen möchten. Verwenden Sie dafür MODX-Tag-Syntax, als ob Sie sie zu dem Snippet-Aufruf hinzufügen würden (z.B. &eigenschaft=`wert`).';
/* Notifications */
$_lang['articles.setting.notifyTwitter'] = 'An Twitter senden';
@@ -326,22 +328,29 @@
$_lang['articles.setting.commentsGravatarIcon'] = 'Gravatar-Icon-Stil';
$_lang['articles.setting.commentsGravatarIcon_desc'] = 'Der Gravatar-Icon-Typ, der für Benutzer ohne Gravatar genutzt wird.';
$_lang['articles.setting.commentsGravatarSize'] = 'Gravatar-Icon-Größe';
-$_lang['articles.setting.commentsGravatarSize_desc'] = 'Die Größe des Gravatars in Pixeln.';
+$_lang['articles.setting.commentsGravatarSize_desc'] = 'Die Größe des Gravatars in Pixeln. Der Standardwert ist 50.';
$_lang['articles.setting.'] = '';
$_lang['articles.setting._desc'] = '';
+$_lang['articles.loading'] = 'Lade';
/* Settings */
$_lang['setting_articles.article_show_longtitle'] = 'Feld für langen Titel anzeigen';
$_lang['setting_articles.article_show_longtitle_desc'] = 'Setzen Sie diese Einstellung auf "Ja", wenn das Feld "Langer Titel" beim Bearbeiten eines Artikels eingeblendet werden soll.';
$_lang['setting_articles.default_container_template'] = 'Standard-Artikel-Container-Template';
-$_lang['setting_articles.default_container_template_desc'] = 'Das Template, das standardmäßig verwendet wird, wenn ein neuer Artikel-Container erstellt wird.';
+$_lang['setting_articles.default_container_template_desc'] = 'Das Template (ID), das standardmäßig verwendet wird, wenn ein neuer Artikel-Container erstellt wird.';
$_lang['setting_articles.default_article_template'] = 'Standard-Artikel-Template';
-$_lang['setting_articles.default_article_template_desc'] = 'Das Template, das standardmäßig verwendet wird, wenn ein neuer Artikel erstellt wird und im Container selbst kein Template angegeben ist.';
+$_lang['setting_articles.default_article_template_desc'] = 'Das Template (ID), das standardmäßig verwendet wird, wenn ein neuer Artikel erstellt wird und im Container selbst kein Template angegeben ist.';
$_lang['setting_articles.container_ids'] = 'Container-IDs für das Routing von suchmaschinenfreundlichen URLs';
$_lang['setting_articles.container_ids_desc'] = 'Eine kommaseparierte Liste von Container-IDs, die für das Routing von suchmaschinenfreundlichen URLs verwendet werden. Es wird empfohlen, hier keine Änderungen vorzunehmen.'; // FURL routing
$_lang['setting_articles.default_article_sort_field'] = 'Standard-Sortierfeld für Artikel im Manager';
-$_lang['setting_articles.default_article_sort_field_desc'] = 'Das Standard-Sortierfeld für die Artikel-Liste beim Bearbeiten eines Containers.';
\ No newline at end of file
+$_lang['setting_articles.default_article_sort_field_desc'] = 'Das Standard-Sortierfeld für die Artikel-Liste beim Bearbeiten eines Containers.';
+
+$_lang['setting_articles.mgr_date_format'] = 'Manager-Datumsformat';
+$_lang['setting_articles.mgr_date_format_desc'] = 'Datumsformat, das innerhalb eines Artikel-Containers angezeigt wird, wenn Artikel im Manager aufgelistet werden.';
+
+$_lang['setting_articles.mgr_time_format'] = 'Manager-Zeitformat';
+$_lang['setting_articles.mgr_time_format_desc'] = 'Zeitformat, das innerhalb eines Artikel-Containers angezeigt wird, wenn Artikel im Manager aufgelistet werden.';
diff --git a/core/components/articles/lexicon/en/default.inc.php b/core/components/articles/lexicon/en/default.inc.php
index 1f9cd04..bbb3a09 100755
--- a/core/components/articles/lexicon/en/default.inc.php
+++ b/core/components/articles/lexicon/en/default.inc.php
@@ -132,6 +132,7 @@
/* General */
$_lang['articles.setting.updateServicesEnabled'] = 'Enable Update Services';
$_lang['articles.setting.updateServicesEnabled_desc'] = 'If on, Articles will attempt to ping Ping-o-Matic whenever you publish an Article, to send out your article\'s title and URL to major search engines.';
+$_lang['articles.setting.published_desc'] = 'Default published status for new articles.';
$_lang['articles.setting.richtext_desc'] = 'Once created, individual Articles can override this value.';
$_lang['articles.setting.sortBy'] = 'Sort Field';
$_lang['articles.setting.sortBy_desc'] = 'The field to sort by on the main and archives listing pages.';
@@ -201,7 +202,7 @@
$_lang['articles.setting.rssAlias'] = 'RSS Alias (Permalink)';
$_lang['articles.setting.rssAlias_desc'] = 'The alias (permalink) for the RSS feed, appended to the Articles Container URL.';
$_lang['articles.setting.rssItems'] = 'Number of RSS Items';
-$_lang['articles.setting.rssItems_desc'] = 'The number of RSS items to show on the RSS feed.';
+$_lang['articles.setting.rssItems_desc'] = 'The number of RSS items to show on the RSS feed. Set to 0 for unlimited.';
$_lang['articles.setting.tplRssFeed'] = 'RSS Feed Chunk';
$_lang['articles.setting.tplRssFeed_desc'] = 'The Chunk to use for the RSS Feed template.';
$_lang['articles.setting.tplRssItem'] = 'RSS Item Chunk';
diff --git a/core/components/articles/model/articles/article.class.php b/core/components/articles/model/articles/article.class.php
index f2a9230..e1b05ce 100644
--- a/core/components/articles/model/articles/article.class.php
+++ b/core/components/articles/model/articles/article.class.php
@@ -72,9 +72,9 @@ public function getContainerSettings() {
$settings = $this->getProperties('articles');
/** @var ArticlesContainer $container */
$container = $this->getOne('Container');
- if ($container) {
- $settings = $container->getContainerSettings();
- }
+ if(method_exists($container, 'getContainerSettings')) {
+ $settings = $container->getContainerSettings();
+ }
return is_array($settings) ? $settings : array();
}
@@ -182,7 +182,7 @@ public function getCommentsCountCall(array $settings = array()) {
* @return string
*/
public function getTagsCall(array $settings = array()) {
- $call = '[[!tolinks? &useTagsFurl=`1` &items=`[[*articlestags]]` &target=`'.$this->get('parent').'`]]';
+ $call = '[[!tolinks? &useTagsFurl=`[[++friendly_urls]]` &items=`[[*articlestags]]` &target=`'.$this->get('parent').'`]]';
$this->xpdo->setPlaceholder('article_tags',$call);
return $call;
}
@@ -257,7 +257,9 @@ public function setArchiveUri() {
return false;
}
- $settings = $container->getContainerSettings();
+ if(method_exists($container, 'getContainerSettings')) {
+ $settings = $container->getContainerSettings();
+ }
if($this->get('pub_date')) $date = $this->get('pub_date');
else $date = $this->get('published') ? $this->get('publishedon') : $this->get('createdon');
diff --git a/core/components/articles/model/articles/articlescontainer.class.php b/core/components/articles/model/articles/articlescontainer.class.php
index 4230c2f..368aae9 100644
--- a/core/components/articles/model/articles/articlescontainer.class.php
+++ b/core/components/articles/model/articles/articlescontainer.class.php
@@ -320,9 +320,12 @@ public function getRssCall() {
public function getPostListingCall($placeholderPrefix = '') {
$settings = $this->getContainerSettings();
$where = array('class_key' => 'Article');
- if (!empty($_REQUEST['arc_user'])) {
- $userPk = $this->xpdo->sanitizeString($_REQUEST['arc_user']);
- if (intval($userPk) == 0) {
+ if (!empty($_REQUEST['arc_author'])) {
+ $userPk = $this->xpdo->sanitizeString($_REQUEST['arc_author']);
+ if (function_exists('filter_var')) {
+ $userPkNum = filter_var($userPk,FILTER_VALIDATE_INT);
+ } else { $userPkNum = intval($userPk); }
+ if ($userPkNum == 0) {
/** @var modUser $user */
$user = $this->xpdo->getObject('modUser',array('username' => $userPk));
if ($user) {
@@ -372,13 +375,7 @@ public function getPostListingCall($placeholderPrefix = '') {
]]';
$this->xpdo->setPlaceholder($placeholderPrefix.'articles',$output);
- $this->xpdo->setPlaceholder($placeholderPrefix.'paging','[[!+page.nav:notempty=`
-
-
- [[!+page.nav]]
-
-
-`]]');
+ $this->xpdo->setPlaceholder($placeholderPrefix.'paging','[[!+page.nav]]');
return $output;
}
@@ -715,7 +712,7 @@ public function afterSave() {
$this->addContainerId();
$this->removeFromArchivistIds();
$this->setProperty('clearCache',true);
- $this->object->set('isfolder',true);
+ //$this->object->set('isfolder',true);
return parent::afterSave();
}
diff --git a/core/components/articles/model/articles/articlesrouter.class.php b/core/components/articles/model/articles/articlesrouter.class.php
index 711cfae..ac96f35 100644
--- a/core/components/articles/model/articles/articlesrouter.class.php
+++ b/core/components/articles/model/articles/articlesrouter.class.php
@@ -53,15 +53,23 @@ public function route() {
$resourceId = false;
$prefix = 'arc_';
foreach ($containerIds as $archive) {
+ if (empty($archive)) continue;
$archive = explode(':',$archive);
$archiveId = $archive[0];
- if(is_array($this->modx->aliasMap)) {
- $alias = array_search($archiveId,$this->modx->aliasMap);
- if ($alias && strpos($search,$alias) !== false) {
- $search = str_replace($alias,'',$search);
- $resourceId = $archiveId;
- if (isset($archive[1])) $prefix = $archive[1];
- }
+
+ if (method_exists($this->modx->context, 'getResourceURI')) {
+ $alias = $this->modx->context->getResourceURI($archiveId);
+ } else {
+ $alias = is_array($this->modx->aliasMap) ? array_search($archiveId, $this->modx->aliasMap) : '';
+ }
+ if ($alias && $startPageId == $archiveId) {
+ $startPageResId = $archiveId;
+ if (isset($archive[1])) $startPagePrefix = $archive[1];
+ }
+ if ($alias && strpos($search, $alias) === 0) {
+ $search = substr($search, strlen($alias));
+ $resourceId = $archiveId;
+ if (isset($archive[1])) $prefix = $archive[1];
}
}
if (!$resourceId) return false;
@@ -72,10 +80,10 @@ public function route() {
/* tag handling! */
if ($params[0] == 'tags') {
- $_GET['tag'] = $params[1];
+ $_REQUEST[$prefix.'author'] = $_GET['tag'] = urldecode($params[1]);
/* author based */
} else if ($params[0] == 'user' || $params[0] == 'author') {
- $_GET[$prefix.'author'] = $params[1];
+ $_REQUEST[$prefix.'author'] = $_GET[$prefix.'author'] = urldecode($params[1]);
/* numeric "archives/1234" */
} else if ($params[0] == 'archives' && !empty($params[1])) {
@@ -87,9 +95,27 @@ public function route() {
/* normal yyyy/mm/dd or yyyy/mm */
} else {
/* set Archivist parameters for date-based archives */
- $_GET[$prefix.'year'] = $params[0];
- if (isset($params[1])) $_GET[$prefix.'month'] = $params[1];
- if (isset($params[2])) $_GET[$prefix.'day'] = $params[2];
+
+ if(is_numeric($params[0])) {
+ $_REQUEST[$prefix.'year'] = $_GET[$prefix.'year'] = $params[0];
+ if (isset($params[1]) && is_numeric($params[1])) {
+ $_REQUEST[$prefix.'month'] = $_GET[$prefix.'month'] = $params[1];
+ } else if(isset($params[1])) {
+ // Display the default 404 page if "month" is not a number
+ $this->modx->sendForward($this->modx->getOption('error_page'), 'HTTP/1.1 404 Not Found');
+ }
+ if (isset($params[2]) && is_numeric($params[2])) {
+ $_REQUEST[$prefix.'day'] = $_GET[$prefix.'day'] = $params[2];
+ } else if(isset($params[2])) {
+ // Display the default 404 page if "day" is not a number
+ $this->modx->sendForward($this->modx->getOption('error_page'), 'HTTP/1.1 404 Not Found');
+
+ }
+ } else {
+ // Display the default 404 page if nothing found
+ $this->modx->sendForward($this->modx->getOption('error_page'), 'HTTP/1.1 404 Not Found');
+ }
+
}
/* forward */
diff --git a/core/components/articles/model/articles/mysql/article.map.inc.php b/core/components/articles/model/articles/mysql/article.map.inc.php
index 79fa117..4962c76 100644
--- a/core/components/articles/model/articles/mysql/article.map.inc.php
+++ b/core/components/articles/model/articles/mysql/article.map.inc.php
@@ -1,9 +1,17 @@
'Articles',
+ 'package' => 'articles',
+ 'version' => '1.1',
+ 'extends' => 'modResource',
+ 'fields' =>
+ array (
+ ),
+ 'fieldMeta' =>
+ array (
+ ),
'aggregates' =>
array (
'Container' =>
diff --git a/core/components/articles/model/articles/mysql/articlescontainer.map.inc.php b/core/components/articles/model/articles/mysql/articlescontainer.map.inc.php
index 43b0fe9..d74a015 100644
--- a/core/components/articles/model/articles/mysql/articlescontainer.map.inc.php
+++ b/core/components/articles/model/articles/mysql/articlescontainer.map.inc.php
@@ -1,9 +1,17 @@
'Articles',
+ 'package' => 'articles',
+ 'version' => '1.1',
+ 'extends' => 'modResource',
+ 'fields' =>
+ array (
+ ),
+ 'fieldMeta' =>
+ array (
+ ),
'composites' =>
array (
'Articles' =>
diff --git a/core/components/articles/model/schema/articles.mysql.schema.xml b/core/components/articles/model/schema/articles.mysql.schema.xml
index 5893db8..28e4a8a 100644
--- a/core/components/articles/model/schema/articles.mysql.schema.xml
+++ b/core/components/articles/model/schema/articles.mysql.schema.xml
@@ -1,9 +1,9 @@
-
+
-
\ No newline at end of file
+
diff --git a/core/components/articles/processors/article/getlist.class.php b/core/components/articles/processors/article/getlist.class.php
index 29b0d54..21b7078 100644
--- a/core/components/articles/processors/article/getlist.class.php
+++ b/core/components/articles/processors/article/getlist.class.php
@@ -31,7 +31,7 @@ class ArticleGetListProcessor extends modObjectGetListProcessor {
public $objectType = 'article';
public $languageTopics = array('resource','articles:default');
- /** @var modAction $editAction */
+ /** @var int|string $editAction */
public $editAction;
/** @var modTemplateVar $tvTags */
public $tvTags;
@@ -41,10 +41,16 @@ class ArticleGetListProcessor extends modObjectGetListProcessor {
public $commentsEnabled = false;
public function initialize() {
- $this->editAction = $this->modx->getObject('modAction',array(
+ $action = $this->modx->getObject('modAction',array(
'namespace' => 'core',
'controller' => 'resource/update',
));
+ if ($action) {
+ $this->editAction = $action->get('id');
+ }
+ else {
+ $this->editAction = 'resource/update';
+ }
$this->defaultSortField = $this->modx->getOption('articles.default_article_sort_field',null,'createdon');
if ($this->getParentContainer()) {
@@ -185,7 +191,7 @@ public function prepareRow(xPDOObject $object) {
$resourceArray['publishedon_time'] = strftime($this->modx->getOption('articles.mgr_time_format',null,'%H:%I %p'),$publishedon);
$resourceArray['publishedon'] = strftime('%b %d, %Y %H:%I %p',$publishedon);
}
- $resourceArray['action_edit'] = '?a='.$this->editAction->get('id').'&action=post/update&id='.$resourceArray['id'];
+ $resourceArray['action_edit'] = '?a='.$this->editAction.'&action=post/update&id='.$resourceArray['id'];
if (!array_key_exists('comments',$resourceArray)) $resourceArray['comments'] = 0;
$this->modx->getContext($resourceArray['context_key']);
@@ -229,10 +235,10 @@ public function prepareRow(xPDOObject $object) {
}
public function ellipsis($string,$length = 300) {
- if (strlen($string) > $length) {
- $string = substr($string,0,$length).'...';
- }
+ if (mb_strlen($string) > $length) {
+ $string = mb_substr($string,0,$length,$this->modx->config['charset']).'...';
+ }
return $string;
}
}
-return 'ArticleGetListProcessor';
\ No newline at end of file
+return 'ArticleGetListProcessor';
diff --git a/readme.md b/readme.md
index fedcf3b..438a8fa 100644
--- a/readme.md
+++ b/readme.md
@@ -1,3 +1,11 @@
# Articles
-Articles is currently maintained at [modxcms/Articles](http://github.com/modxcms/Articles). Please [go there](http://github.com/modxcms/Articles).
+This is the official repo for the MODX blogging extra Articles.
+
+ * The documentation can be found at [MODX Docs](http://rtfm.modx.com/extras/revo/articles).
+ * Help can be found at the [MODX Forum](http://forums.modx.com/board?board=265)
+
+## Discuss
+Join the conversation in our public Gitter chat room.
+
+[](https://gitter.im/modxcms/Articles)