/** * Retrieve core statistics * @param Zend_Controller_Action $this * @return X_Page_ItemList_Statistic */ public function getIndexStatistics(Zend_Controller_Action $controller) { $entries = Application_Model_CacheMapper::i()->getCount(); $stat = new X_Page_Item_Statistic($this->getId(), X_Env::_('p_cache_statstitle')); $stat->setTitle(X_Env::_('p_cache_statstitle'))->appendStat(X_Env::_('p_cache_stats_storedentries') . ": {$entries}"); if ($entries) { $urlHelper = $controller->getHelper('url'); $clearOldHref = $urlHelper->url(array('controller' => 'cache', 'action' => 'clearold'), 'default', true); $clearAllHref = $urlHelper->url(array('controller' => 'cache', 'action' => 'clearall'), 'default', true); $clearOldLink = '<a href="' . $clearOldHref . '">' . X_Env::_('p_cache_stats_clearold') . '</a>'; $clearAllLink = '<a href="' . $clearAllHref . '">' . X_Env::_('p_cache_stats_clearall') . '</a>'; $stat->appendStat($clearOldLink)->appendStat($clearAllLink); } return new X_Page_ItemList_Statistic(array($stat)); }
/** * Retrieve thumbnails statistics * @param Zend_Controller_Action $this * @return X_Page_ItemList_Statistic */ public function getIndexStatistics(Zend_Controller_Action $controller) { $entries = Application_Model_FsThumbsMapper::i()->getCount(); $stat = new X_Page_Item_Statistic($this->getId(), X_Env::_('p_fsthumbs_statstitle')); $stat->setTitle(X_Env::_('p_fsthumbs_statstitle'))->appendStat(X_Env::_('p_fsthumbs_storedentries', Application_Model_FsThumbsMapper::i()->getCount(), $this->config('max.cached', 200)))->appendStat(X_Env::_('p_fsthumbs_storedentries_dim', self::formatSize(Application_Model_FsThumbsMapper::i()->getTotalSize()))); if ($entries) { $urlHelper = $controller->getHelper('url'); $clearOverHref = $urlHelper->url(array('controller' => 'fsthumbs', 'action' => 'delete', 'type' => 'over'), 'default', true); $clearAllHref = $urlHelper->url(array('controller' => 'fsthumbs', 'action' => 'delete', 'type' => 'all'), 'default', true); $clearOrphanHref = $urlHelper->url(array('controller' => 'fsthumbs', 'action' => 'delete', 'type' => 'orphan'), 'default', true); $clearOverLink = '<a href="' . $clearOverHref . '">' . X_Env::_('p_fsthumbs_actions_removeover') . '</a>'; $clearOrphanLink = '<a href="' . $clearOrphanHref . '">' . X_Env::_('p_fsthumbs_actions_removeorphan') . '</a>'; $clearAllLink = '<a href="' . $clearAllHref . '">' . X_Env::_('p_fsthumbs_actions_removeall') . '</a>'; $stat->appendStat($clearOverLink)->appendStat($clearOrphanLink)->appendStat($clearAllLink); } return new X_Page_ItemList_Statistic(array($stat)); }
/** * Retrieve core statistics * @param Zend_Controller_Action $this * @return X_Page_ItemList_Statistic */ public function getIndexStatistics(Zend_Controller_Action $controller) { $plugins = count(X_VlcShares_Plugins::broker()->getPlugins()); $helpers = count(X_VlcShares_Plugins::helpers()->getHelpers()); $pluginsList = '<div class="scrollable" style="max-height: 75px;"><ol>'; foreach (X_VlcShares_Plugins::broker()->getPlugins() as $pluginName => $pluginObj) { $explodedClass = explode('_', get_class($pluginObj)); $formattedPluginClass = array_pop($explodedClass); $pluginsList .= "<li style=\"font-weight: normal;\">{$formattedPluginClass}</li>\n"; } $pluginsList .= "</ol></div>"; $helpersList = '<div class="scrollable" style="max-height: 75px;"><ol>'; foreach (X_VlcShares_Plugins::helpers()->getHelpers() as $pluginName => $pluginObj) { $explodedClass = explode('_', get_class($pluginObj)); $formattedPluginClass = array_pop($explodedClass); $helpersList .= "<li style=\"font-weight: normal;\">{$formattedPluginClass}</li>\n"; } $helpersList .= "</ol></div>"; $vlc = X_Vlc::getLastInstance()->isRunning() ? X_Env::_('p_corestats_vlcrunning_yes') : X_Env::_('p_corestats_vlcrunning_no'); $stat = new X_Page_Item_Statistic($this->getId(), X_Env::_('p_corestats_statstitle')); $stat->setTitle(X_Env::_('p_corestats_statstitle'))->appendStat(X_Env::_('p_corestats_vlcrunning') . ": {$vlc}")->appendStat(X_Env::_('p_corestats_pluginnumber') . ": {$plugins}")->appendStat(X_Env::_('p_corestats_helpernumber') . ": {$helpers}")->appendStat(X_Env::_('p_corestats_pluginslist') . ": {$pluginsList}")->appendStat(X_Env::_('p_corestats_helperlist') . ": {$helpersList}"); return new X_Page_ItemList_Statistic(array($stat)); }
/** * Retrieve statistic from plugins * @param Zend_Controller_Action $this * @return X_Page_ItemList_Statistic */ public function getIndexStatistics(Zend_Controller_Action $controller) { $categories = Application_Model_VideosMapper::i()->getCountCategories(); // FIXME create count functions $videos = Application_Model_VideosMapper::i()->getCount(); // FIXME create count functions $hosters = count($this->helpers()->hoster()->getHosters()); $stat = new X_Page_Item_Statistic($this->getId(), X_Env::_('p_onlinelibrary_statstitle')); $stat->setTitle(X_Env::_('p_onlinelibrary_statstitle'))->appendStat(X_Env::_('p_onlinelibrary_statcategories', $categories))->appendStat(X_Env::_('p_onlinelibrary_statvideos', $videos))->appendStat(X_Env::_('p_onlinelibrary_stathosters', $hosters)); return new X_Page_ItemList_Statistic(array($stat)); }
/** * Retrieve statistic from plugins * @param Zend_Controller_Action $this * @return X_Page_ItemList_Statistic */ public function getIndexStatistics(Zend_Controller_Action $controller) { $categories = count(Application_Model_MegavideoMapper::i()->fetchCategories()); // FIXME create count functions $videos = count(Application_Model_MegavideoMapper::i()->fetchAll()); // FIXME create count functions $stat = new X_Page_Item_Statistic($this->getId(), X_Env::_('p_megavideo_statstitle')); $stat->setTitle(X_Env::_('p_megavideo_statstitle'))->appendStat(X_Env::_('p_megavideo_statcategories') . ": {$categories}")->appendStat(X_Env::_('p_megavideo_statvideos') . ": {$videos}"); return new X_Page_ItemList_Statistic(array($stat)); }
/** * Retrieve jdownloader statistics * @param Zend_Controller_Action $this * @return X_Page_ItemList_Statistic */ public function getIndexStatistics(Zend_Controller_Action $controller) { //$entries = Application_Model_CacheMapper::i()->getCount(); /* @var $jdHelper X_VlcShares_Plugins_Helper_JDownloader */ $jdHelper = $this->helpers('jdownloader'); /* @var $url Zend_View_Helper_Url */ $urlHelper = $controller->getHelper('url'); try { $downloadStatus = $jdHelper->sendRawCommand(X_VlcShares_Plugins_Helper_JDownloader::CMD_GET_DOWNLOADSTATUS); $connstatus = true; } catch (Exception $e) { $connstatus = false; } $stat = new X_Page_Item_Statistic($this->getId(), X_Env::_('p_jdownloader_statstitle')); $stat->setTitle(X_Env::_('p_jdownloader_statstitle'))->appendStat(X_Env::_('p_jdownloader_stat_connectionstatus', X_Env::_('p_jdownloader_stat_connection_' . ($connstatus ? '1' : '0')))); if ($connstatus) { $currentSpeed = $jdHelper->sendRawCommand(X_VlcShares_Plugins_Helper_JDownloader::CMD_GET_SPEED); $itemsTotal = $jdHelper->sendRawCommand(X_VlcShares_Plugins_Helper_JDownloader::CMD_GET_DOWNLOADS_ALL_COUNT); $itemsDone = $jdHelper->sendRawCommand(X_VlcShares_Plugins_Helper_JDownloader::CMD_GET_DOWNLOADS_FINISHED_COUNT); $stat->appendStat(X_Env::_('p_jdownloader_stat_downloadstatus', $downloadStatus))->appendStat(X_Env::_('p_jdownloader_stat_currentspeed', $currentSpeed))->appendStat(X_Env::_('p_jdownloader_stat_itemsdone', $itemsDone, $itemsTotal)); } else { $stat->appendStat(X_Env::_('p_jdownloader_stat_connectionerrorhelp')); } return new X_Page_ItemList_Statistic(array($stat)); }
/** * Show the number of shared folders in the dashboard * @param Zend_Controller_Action $this * @return X_Page_ItemList_Statistic */ public function getIndexStatistics(Zend_Controller_Action $controller) { $collections = count(Application_Model_FilesystemSharesMapper::i()->fetchAll()); // FIXME create count functions $stat = new X_Page_Item_Statistic($this->getId(), X_Env::_('p_filesystem_statstitle')); $stat->setTitle(X_Env::_('p_filesystem_statstitle'))->appendStat(X_Env::_('p_filesystem_statcollections') . ": {$collections}"); return new X_Page_ItemList_Statistic(array($stat)); }