public function controlAction()
 {
     $request = $this->getRequest();
     $engineId = X_Streamer::i()->getStreamingEngineId();
     $engine = X_VlcShares_Plugins::helpers()->streamer()->get($engineId);
     $pageItems = new X_Page_ItemList_PItem();
     // links on top
     $pageItems->merge(X_VlcShares_Plugins::broker()->preGetControlItems($engine, $this));
     // add separator between play items and options items
     $separator = new X_Page_Item_PItem('core-separator', X_Env::_('_____options_separator_____'));
     $separator->setType(X_Page_Item_PItem::TYPE_ELEMENT)->setLink(array('controller' => 'controls', 'action' => 'control', 'pid' => null, 'a' => null, 'param' => null), 'default', false);
     $pageItems->append($separator);
     // normal links
     $pageItems->merge(X_VlcShares_Plugins::broker()->getControlItems($engine, $this));
     // bottom links
     $pageItems->merge(X_VlcShares_Plugins::broker()->postGetControlItems($engine, $this));
     // filter out items (parental-control / hidden file / system dir / custom controls)
     foreach ($pageItems->getItems() as $key => $item) {
         $results = X_VlcShares_Plugins::broker()->filterControlItems($item, $engine, $this);
         if ($results != null && in_array(false, $results)) {
             $pageItems->remove($item);
         }
     }
     // trigger for page creation
     X_VlcShares_Plugins::broker()->gen_afterPageBuild($pageItems, $this);
 }
 public function collectionsAction()
 {
     $pageItems = new X_Page_ItemList_PItem();
     // links on top
     $pageItems->merge(X_VlcShares_Plugins::broker()->preGetCollectionsItems($this));
     // normal links
     $pageItems->merge(X_VlcShares_Plugins::broker()->getCollectionsItems($this));
     // bottom links
     $pageItems->merge(X_VlcShares_Plugins::broker()->postGetCollectionsItems($this));
     // filter out items (parental-control / hidden file / system dir)
     foreach ($pageItems->getItems() as $key => $item) {
         $results = X_VlcShares_Plugins::broker()->filterCollectionsItems($item, $this);
         if ($results != null && in_array(false, $results)) {
             //unset($pageItems[$key]);
             $pageItems->remove($item);
         }
     }
     // trigger for page creation
     X_VlcShares_Plugins::broker()->gen_afterPageBuild($pageItems, $this);
 }
 public function selectionAction()
 {
     $request = $this->getRequest();
     X_VlcShares_Plugins::broker()->gen_preProviderSelection($this);
     $provider = $request->getParam('p', false);
     if ($provider === false || !X_VlcShares_Plugins::broker()->isRegistered($provider)) {
         throw new Exception("Invalid provider");
     }
     $pid = $request->getParam('pid', false);
     if ($pid === false || !X_VlcShares_Plugins::broker()->isRegistered($pid)) {
         throw new Exception("Invalid pluginId");
     }
     $location = X_Env::decode($request->getParam('l', ''));
     $pageItems = new X_Page_ItemList_PItem();
     // I add a "Back" button as first, this should redirect to mode action
     $back = new X_Page_Item_PItem('core-back', X_Env::_('back'));
     $back->setType(X_Page_Item_PItem::TYPE_ELEMENT)->setLink(array('action' => 'mode', 'pid' => null), 'default', false);
     $pageItems->append($back);
     // links on top
     $pageItems->merge(X_VlcShares_Plugins::broker()->preGetSelectionItems($provider, $location, $pid, $this));
     // add separator between header items and options items
     $separator = new X_Page_Item_PItem('core-separator', X_Env::_('_____options_separator_____'));
     $separator->setType(X_Page_Item_PItem::TYPE_ELEMENT)->setLink(X_Env::completeUrl($this->_helper->url->url()));
     $pageItems->append($separator);
     // normal links
     $pageItems->merge(X_VlcShares_Plugins::broker()->getSelectionItems($provider, $location, $pid, $this));
     // bottom links
     $pageItems->merge(X_VlcShares_Plugins::broker()->postGetSelectionItems($provider, $location, $pid, $this));
     // filter out items (parental-control / hidden file / system dir)
     foreach ($pageItems->getItems() as $key => $item) {
         $results = X_VlcShares_Plugins::broker()->filterSelectionItems($item, $provider, $pid, $this);
         if ($results != null && in_array(false, $results)) {
             $pageItems->remove($item);
         }
     }
     // trigger for page creation
     X_VlcShares_Plugins::broker()->gen_afterPageBuild($pageItems, $this);
 }