-
-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
виджет офновостей в админке, + разное по мелочи
- Loading branch information
Showing
23 changed files
with
717 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
|
||
class actionAdminLoadIcmsNews extends cmsAction { | ||
|
||
private $news_link = array( | ||
'icms' => 'http://www.instantcms.ru/rss/content/2/feed.rss', | ||
'icms_addons' => 'http://addons.instantcms.ru/rss/feed/addons', | ||
'icms_docs' => 'http://docs.instantcms.ru/feed.php' | ||
); | ||
|
||
private $news_count = 10; | ||
|
||
public function run($target){ | ||
|
||
if (!$this->request->isAjax()) { cmsCore::error404(); } | ||
|
||
if (!$target || !in_array($target, array_keys($this->news_link))) { cmsCore::error404(); } | ||
|
||
cmsCore::loadLib('lastrss.class'); | ||
|
||
$rss = new lastRSS; | ||
|
||
$rss->cache_dir = cmsConfig::get('cache_path'); | ||
$rss->cache_time = 3600; | ||
$rss->stripHTML = true; | ||
$rss->cp = 'UTF-8'; | ||
$rss->items_limit = $this->news_count; | ||
|
||
$items = array(); | ||
|
||
$res = $rss->get($this->news_link[$target]); | ||
|
||
if(!empty($res['items'])){ | ||
foreach ($res['items'] as $item) { | ||
|
||
$item['target_title'] = empty($res['title']) ? | ||
(empty($res['image_title']) ? '' : $res['image_title']) : | ||
$res['title']; | ||
|
||
$item['target_description'] = empty($res['description']) ? | ||
(empty($res['image_description']) ? '' : $res['image_description']) : | ||
$res['description']; | ||
|
||
$items[] = $item; | ||
|
||
} | ||
} | ||
|
||
if(!$items){ $this->halt(LANG_NO_ITEMS); } | ||
|
||
$this->cms_template->renderPlain('index_news_data', array( | ||
'items' => $items | ||
)); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.