Пример #1
0
 /**
  * Show an error if ffmpeg isn't enabled
  */
 function getIndexMessages(Zend_Controller_Action $controller)
 {
     X_Debug::i('Plugin triggered');
     $m = new X_Page_Item_Message($this->getId(), X_Env::_('p_fsthumbs_dashboardffmpegerror'));
     $m->setType(X_Page_Item_Message::TYPE_ERROR);
     return new X_Page_ItemList_Message(array($m));
 }
 /**
  * Show the dashboard
  */
 public function indexAction()
 {
     /* @var $messages X_Page_ItemList_Message */
     $messages = new X_Page_ItemList_Message();
     $messages->merge(X_VlcShares_Plugins::broker()->getIndexMessages($this));
     $fm = $this->_helper->flashMessenger->getMessages();
     foreach ($fm as $i => $m) {
         $_m = new X_Page_Item_Message("fm-{$i}", '');
         if (is_array($m)) {
             if (array_key_exists('type', $m)) {
                 $_m->setType($m['type']);
             }
             if (array_key_exists('text', $m)) {
                 $_m->setLabel($m['text']);
             }
         } else {
             $_m->setType(X_Page_Item_Message::TYPE_WARNING)->setLabel((string) $m);
         }
         $messages->append($_m);
     }
     $news = X_VlcShares_Plugins::broker()->getIndexNews($this);
     $manageLinks = new X_Page_ItemList_ManageLink();
     $item = new X_Page_Item_ManageLink('core-manage-browse', X_Env::_('manage_goto_browsetitle'));
     $item->setTitle(X_Env::_('manage_goto_browse'))->setIcon('/images/manage/browse.png')->setLink(array('controller' => 'index', 'action' => 'collections'), 'default', true);
     $manageLinks->append($item);
     $item = new X_Page_Item_ManageLink('core-manage-test', X_Env::_('manage_goto_testtitle'));
     $item->setTitle(X_Env::_('manage_goto_test'))->setIcon('/images/manage/test.png')->setLink(array('controller' => 'test', 'action' => 'index'), 'default', true);
     $manageLinks->append($item);
     $item = new X_Page_Item_ManageLink('core-manage-configs', X_Env::_('manage_goto_configstitle'));
     $item->setTitle(X_Env::_('manage_goto_configs'))->setIcon('/images/manage/configs.png')->setLink(array('controller' => 'gconfigs', 'action' => 'index'), 'default', true);
     $manageLinks->append($item);
     $item = new X_Page_Item_ManageLink('core-manage-threads', X_Env::_('manage_goto_threadstitle'));
     $item->setTitle(X_Env::_('manage_goto_threads'))->setIcon('/images/manage/threads.png')->setLink(array('controller' => 'tmanager', 'action' => 'index'), 'default', true);
     $manageLinks->append($item);
     $manageLinks->merge(X_VlcShares_Plugins::broker()->getIndexManageLinks($this));
     // fetch links from plugins
     $actionLinks = X_VlcShares_Plugins::broker()->getIndexActionLinks($this);
     $statistics = X_VlcShares_Plugins::broker()->getIndexStatistics($this);
     $this->view->version = X_VlcShares::VERSION;
     //$this->view->configPath = X_VlcShares::config();
     //$this->view->test = $this->_helper->url('index', 'test');
     //$this->view->pcstream = $this->_helper->url('pcstream', 'index');
     //$this->view->pcstream_enabled = ($this->options->pcstream->get('commanderEnabled', false) && $this->vlc->isRunning());
     $this->view->actionLinks = $actionLinks;
     $this->view->manageLinks = $manageLinks;
     $this->view->statistics = $statistics;
     $this->view->news = $news;
     $this->view->messages = $messages;
     // i need to get first class links
 }
 /**
  * Retrieve statistic from plugins
  * @param Zend_Controller_Action $this
  * @return X_Page_ItemList_Message
  */
 public function getIndexMessages(Zend_Controller_Action $controller)
 {
     $updates = $this->checkUpdates();
     $list = new X_Page_ItemList_Message();
     if ($updates['core'] !== false) {
         $m = new X_Page_Item_Message("{$this->getId()}-core", X_Env::_('p_updatenotifier_coreupdate', $updates['core']['version'], $updates['core']['type'], trim($updates['core']['changelog']), $updates['core']['download'], $updates['core']['update']));
         $m->setType(X_Page_Item_Message::TYPE_INFO);
         $list->append($m);
     }
     if (count($updates['plugins'])) {
         foreach ($updates['plugins'] as $key => $infos) {
             $m = new X_Page_Item_Message("{$this->getId()}-plugin", X_Env::_('p_updatenotifier_pluginupdate', $key, $infos['version'], $infos['type'], trim($infos['changelog']), $infos['download'], $infos['update']));
             $m->setType(X_Page_Item_Message::TYPE_INFO);
             $list->append($m);
         }
     }
     return count($list->getItems()) ? $list : null;
 }
 /**
  * Retrieve statistic from plugins
  * @param Zend_Controller_Action $this
  * @return X_Page_ItemList_Message
  */
 public function getIndexMessages(Zend_Controller_Action $controller)
 {
     $version = X_VlcShares::VERSION;
     X_Debug::i('Plugin triggered');
     $showError = false;
     $type = 'warning';
     if (strpos($version, 'alpha') !== false || strpos($version, 'beta') !== false || strpos($version, 'dev') !== false || strpos($version, 'unstable') !== false) {
         $showError = true;
     } elseif (strpos($version, 'rc') !== false || strpos($version, 'release_candidate') !== false) {
         $showError = true;
         $type = 'info';
     }
     if ($showError) {
         $m = new X_Page_Item_Message($this->getId(), X_Env::_('p_widgetdevalert_warningmessage'));
         $m->setType($type);
         return new X_Page_ItemList_Message(array($m));
     }
 }
Пример #5
0
 /**
  * Return the HELLO WORLD message, one for message type
  * @param Zend_Controller_Action $this
  * @return X_Page_ItemList_Message
  */
 public function getIndexMessages(Zend_Controller_Action $controller)
 {
     $messages = array();
     $message = new X_Page_Item_Message($this->getId(), 'HELLO WORLD (INFO)');
     $message->setType(X_Page_Item_Message::TYPE_INFO);
     $messages[] = $message;
     $message = new X_Page_Item_Message($this->getId(), 'HELLO WORLD (SUCCESS)');
     $message->setType(X_Page_Item_Message::TYPE_SUCCESS);
     $messages[] = $message;
     $message = new X_Page_Item_Message($this->getId(), 'HELLO WORLD (WARNING)');
     $message->setType(X_Page_Item_Message::TYPE_WARNING);
     $messages[] = $message;
     $message = new X_Page_Item_Message($this->getId(), 'HELLO WORLD (ERROR)');
     $message->setType(X_Page_Item_Message::TYPE_ERROR);
     $messages[] = $message;
     $message = new X_Page_Item_Message($this->getId(), 'HELLO WORLD (FATAL)');
     $message->setType(X_Page_Item_Message::TYPE_FATAL);
     $messages[] = $message;
     return new X_Page_ItemList_Message($messages);
 }
Пример #6
0
 /**
  * Show an error message if one of the plugin dependencies is missing
  * @param Zend_Controller_Action $this
  * @return X_Page_ItemList_Message
  */
 public function getIndexMessages(Zend_Controller_Action $controller)
 {
     $messages = new X_Page_ItemList_Message();
     if (class_exists("X_VlcShares_Plugins_Utils", true)) {
         if (!method_exists('X_VlcShares_Plugins_Utils', 'menuProxy')) {
             // old version of PageParserLib
             $message = new X_Page_Item_Message($this->getId(), "PageParserLib plugin version is old. Please, update it");
             $message->setType(X_Page_Item_Message::TYPE_FATAL);
             $messages->append($message);
         }
     } else {
         $message = new X_Page_Item_Message($this->getId(), "PageParser API is required from RaiClick. Please, install PageParserLib plugin");
         $message->setType(X_Page_Item_Message::TYPE_FATAL);
         $messages->append($message);
     }
     return $messages;
 }
Пример #7
0
 /**
  * Retrieve statistic from plugins
  * @param Zend_Controller_Action $this
  * @return array The format of the array should be:
  * 		array(
  * 			array(
  * 				'title' => ITEM TITLE,
  * 				'label' => ITEM LABEL,
  * 				'stats' => array(INFO, INFO, INFO),
  * 				'provider' => array('controller', 'index', array()) // if provider is setted, stats key is ignored 
  * 			), ...
  * 		)
  */
 public function getIndexMessages(Zend_Controller_Action $controller)
 {
     X_Debug::i('Plugin triggered');
     $type = 'warning';
     $showError = true;
     try {
         $backupDir = new DirectoryIterator(APPLICATION_PATH . "/../data/backupper/");
         foreach ($backupDir as $entry) {
             if ($entry->isFile() && pathinfo($entry->getFilename(), PATHINFO_EXTENSION) == 'xml' && X_Env::startWith($entry->getFilename(), 'backup_')) {
                 $showError = false;
                 break;
             }
         }
     } catch (Exception $e) {
         X_Debug::e("Error while parsing backupper data directory: {$e->getMessage()}");
     }
     $showError = $showError && $this->config('alert.enabled', true);
     if ($showError) {
         $urlHelper = $controller->getHelper('url');
         /* @var $urlHelper Zend_Controller_Action_Helper_Url */
         $removeAlertLink = $urlHelper->url(array('controller' => 'backupper', 'action' => 'alert', 'status' => 'off'));
         $mess = new X_Page_Item_Message($this->getId(), X_Env::_('p_backupper_warningmessage_nobackup') . " <a href=\"{$removeAlertLink}\">" . X_Env::_('p_backupper_warningmessage_nobackupremove') . '</a>');
         $mess->setType($type);
         return new X_Page_ItemList_Message(array($mess));
     }
 }
Пример #8
0
 /**
  * Show an error message if one of the plugin dependencies is missing
  * @param Zend_Controller_Action $this
  * @return X_Page_ItemList_Message
  */
 public function getIndexMessages(Zend_Controller_Action $controller)
 {
     $messages = new X_Page_ItemList_Message();
     if (class_exists("X_VlcShares_Plugins_Utils", true)) {
         if (!method_exists('X_VlcShares_Plugins_Utils', 'menuProxy')) {
             // old version of PageParserLib
             $message = new X_Page_Item_Message($this->getId(), "PageParserLib plugin version is old. Please, update it (0.1alpha2 or later required)");
             $message->setType(X_Page_Item_Message::TYPE_FATAL);
             $messages->append($message);
         } else {
             if (!$this->helpers()->rtmpdump()->isEnabled()) {
                 $messages->append(X_VlcShares_Plugins_Utils::getMessageEntry($this->getId(), 'p_own3d_err_rtmpdump_disabled', X_Page_Item_Message::TYPE_WARNING));
             }
         }
     } else {
         $message = new X_Page_Item_Message($this->getId(), "PageParser API is required from Own3d. Please, install PageParserLib plugin (0.1alpha2 or later required)");
         $message->setType(X_Page_Item_Message::TYPE_FATAL);
         $messages->append($message);
     }
     return $messages;
 }
Пример #9
0
 /**
  * Show an error message if megavideo plugin version < 0.2.1
  * @param Zend_Controller_Action $this
  * @return X_Page_ItemList_Message
  */
 public function getIndexMessages(Zend_Controller_Action $controller)
 {
     try {
         $megauploadHelper = $this->helpers('megaupload');
     } catch (Exception $e) {
         X_Debug::i('Plugin triggered');
         $m = new X_Page_Item_Message($this->getId(), X_Env::_('p_icefilms_dashboardwarning'));
         $m->setType(X_Page_Item_Message::TYPE_ERROR);
         return new X_Page_ItemList_Message(array($m));
     }
 }
 /**
  * Show an error message if one of the plugin dependencies is missing
  * @param Zend_Controller_Action $this
  * @return X_Page_ItemList_Message
  */
 public function getIndexMessages(Zend_Controller_Action $controller)
 {
     $messages = new X_Page_ItemList_Message();
     if (class_exists("X_VlcShares_Plugins_Utils", true)) {
         if (count(X_VlcShares_Plugins::helpers()->hoster()->getHosters()) < 1) {
             $messages->append(X_VlcShares_Plugins_Utils::getMessageEntry($this->getId(), 'p_streamingonline_warning_nohosters', X_Page_Item_Message::TYPE_ERROR));
         }
     } else {
         $message = new X_Page_Item_Message($this->getId(), "PageParser API is required from Streaming-Online. Please, install PageParserLib plugin (alpha version)");
         $message->setType(X_Page_Item_Message::TYPE_FATAL);
         $messages->append($message);
     }
     return $messages;
 }
Пример #11
0
 /**
  * Create a new X_Page_Item_Test
  * @param string $key item key in the list
  * @param string $label item label
  * @param array|string $link an array of Route params
  */
 function __construct($key, $label, $type = self::TYPE_INFO)
 {
     parent::__construct($key, $label, $type);
 }
Пример #12
0
 /**
  * Show an error message if one of the plugin dependencies is missing
  * @param Zend_Controller_Action $this
  * @return X_Page_ItemList_Message
  */
 public function getIndexMessages(Zend_Controller_Action $controller)
 {
     $messages = new X_Page_ItemList_Message();
     if (!X_VlcShares_Plugins::broker()->isRegistered('megavideo')) {
         $message = new X_Page_Item_Message($this->getId(), X_Env::_('p_filmstream_warning_nomegavideo'));
         $message->setType(X_Page_Item_Message::TYPE_ERROR);
         $messages->append($message);
     }
     if (!X_VlcShares_Plugins::broker()->isRegistered('youtube')) {
         $message = new X_Page_Item_Message($this->getId(), X_Env::_('p_filmstream_warning_noyoutube'));
         $message->setType(X_Page_Item_Message::TYPE_WARNING);
         $messages->append($message);
     }
     return $messages;
 }
Пример #13
0
 /**
  * Show a warning message if username and password aren't specified yet
  * @param Zend_Controller_Action $this
  * @return X_Page_ItemList_Message
  */
 public function getIndexMessages(Zend_Controller_Action $controller)
 {
     X_Debug::i('Plugin triggered');
     if ($this->config('auth.username', '') == '' || $this->config('auth.password', '') == '') {
         $m = new X_Page_Item_Message($this->getId(), X_Env::_('p_animeftw_dashboardwarning'));
         $m->setType(X_Page_Item_Message::TYPE_ERROR);
         return new X_Page_ItemList_Message(array($m));
     }
 }
Пример #14
0
 /**
  * Show an error message if one of the plugin dependencies is missing
  * @param Zend_Controller_Action $this
  * @return X_Page_ItemList_Message
  */
 public function getIndexMessages(Zend_Controller_Action $controller)
 {
     $messages = new X_Page_ItemList_Message();
     if (!class_exists("X_VlcShares_Plugins_Utils", true)) {
         $message = new X_Page_Item_Message($this->getId(), "PageParser API is required from RapidShare. Please, install PageParserLib plugin");
         $message->setType(X_Page_Item_Message::TYPE_FATAL);
         $messages->append($message);
     }
     return $messages;
 }
Пример #15
0
 /**
  * Show an error message if one of the plugin dependencies is missing
  * @param Zend_Controller_Action $this
  * @return X_Page_ItemList_Message
  */
 public function getIndexMessages(Zend_Controller_Action $controller)
 {
     $messages = new X_Page_ItemList_Message();
     if (class_exists("X_VlcShares_Plugins_Utils", true)) {
         if (method_exists('X_VlcShares_Plugins_Utils', 'menuProxy')) {
             if (count(X_VlcShares_Plugins::helpers()->hoster()->getHosters()) < 1) {
                 $messages->append(X_VlcShares_Plugins_Utils::getMessageEntry($this->getId(), 'p_tvlinks_warning_nohosters', X_Page_Item_Message::TYPE_ERROR));
             }
         } else {
             // old version of PageParserLib
             $message = new X_Page_Item_Message($this->getId(), "PageParserLib plugin version is old. Please, update it (0.1alpha2 or later required)");
             $message->setType(X_Page_Item_Message::TYPE_FATAL);
             $messages->append($message);
         }
     } else {
         $message = new X_Page_Item_Message($this->getId(), "PageParser API is required from TvLinks. Please, install PageParserLib plugin (0.1alpha2 or later required)");
         $message->setType(X_Page_Item_Message::TYPE_FATAL);
         $messages->append($message);
     }
     return $messages;
 }
 /**
  * Show an error message if one of the plugin dependencies is missing
  * @param Zend_Controller_Action $this
  * @return X_Page_ItemList_Message
  */
 public function getIndexMessages(Zend_Controller_Action $controller)
 {
     $messages = new X_Page_ItemList_Message();
     if (!class_exists('X_VlcShares_Plugins_Utils')) {
         $message1 = new X_Page_Item_Message($this->getId(), X_Env::_("p_streamseeker_err_pageparserlibrequired"));
         $message1->setType(X_Page_Item_Message::TYPE_FATAL);
         $messages->append($message1);
     }
     if (!X_VlcShares_Plugins::broker()->isRegistered('cache')) {
         $message2 = new X_Page_Item_Message($this->getId(), X_Env::_("p_streamseeker_err_cachedisabled"));
         $message2->setType(X_Page_Item_Message::TYPE_FATAL);
         $messages->append($message2);
     }
     return $messages;
 }