Exemplo n.º 1
0
 public function parseSpecificContributions(&$contribNode)
 {
     parent::parseSpecificContributions($contribNode);
     if ($contribNode->nodeName == "client_configs") {
         $actionXpath = new DOMXPath($contribNode->ownerDocument);
         $gettingStartedList = $actionXpath->query('template[@name="tutorial_pane"]', $contribNode);
         if (!$gettingStartedList->length) {
             return;
         }
         if ($this->getFilteredOption("ENABLE_GETTING_STARTED") === false) {
             $contribNode->removeChild($gettingStartedList->item(0));
         } else {
             $cdata = $gettingStartedList->item(0)->firstChild;
             $keys = array("URL_APP_IOSAPPSTORE", "URL_APP_ANDROID", "URL_APP_SYNC_WIN", "URL_APP_SYNC_MAC");
             $values = array();
             foreach ($keys as $k) {
                 $values[] = $this->getFilteredOption($k);
             }
             $newData = str_replace($keys, $values, $cdata->nodeValue);
             $newCData = $contribNode->ownerDocument->createCDATASection($newData);
             $gettingStartedList->item(0)->appendChild($newCData);
             $gettingStartedList->item(0)->replaceChild($newCData, $cdata);
         }
     } else {
         if ($contribNode->nodeName == "actions" && $this->getFilteredOption("DISPLAY_SERVER_QRCODE_ACTION") === false) {
             $actionXpath = new DOMXPath($contribNode->ownerDocument);
             $actionList = $actionXpath->query('action[@name="display-server-qrcode"]', $contribNode);
             $contribNode->removeChild($actionList->item(0));
         }
     }
 }
Exemplo n.º 2
0
 public function parseSpecificContributions(&$contribNode)
 {
     parent::parseSpecificContributions($contribNode);
     if ($contribNode->nodeName == "client_configs") {
         $actionXpath = new DOMXPath($contribNode->ownerDocument);
         $gettingStartedList = $actionXpath->query('component_config/additional_tab[@id="tutorials_pane"]', $contribNode);
         if (!$gettingStartedList->length) {
             return;
         }
         if ($this->getFilteredOption("ENABLE_GETTING_STARTED") === false) {
             $compConfig = $gettingStartedList->item(0)->parentNode;
             $contribNode->removeChild($compConfig);
         } else {
             $cdata = $gettingStartedList->item(0)->firstChild;
             $keys = array("URL_APP_IOSAPPSTORE", "URL_APP_ANDROID", "URL_APP_SYNC_WIN", "URL_APP_SYNC_MAC");
             $values = array();
             foreach ($keys as $k) {
                 $values[] = $this->getFilteredOption($k);
             }
             $newData = str_replace($keys, $values, $cdata->nodeValue);
             $newCData = $contribNode->ownerDocument->createCDATASection($newData);
             $gettingStartedList->item(0)->appendChild($newCData);
             $gettingStartedList->item(0)->replaceChild($newCData, $cdata);
         }
     }
 }
 /**
  * Parse
  * @param DOMNode $contribNode
  */
 protected function parseSpecificContributions(&$contribNode)
 {
     parent::parseSpecificContributions($contribNode);
     if ($contribNode->nodeName != "actions") {
         return;
     }
     $this->redirectActionsToMethod($contribNode, array("upload", "next_to_remote", "trigger_remote_copy"), "uploadActions");
 }
 public function parseSpecificContributions(&$contribNode)
 {
     $disableAddressBook = $this->getFilteredOption("DASH_DISABLE_ADDRESS_BOOK") === true;
     if ($contribNode->nodeName == "client_configs" && $disableAddressBook) {
         // remove template_part for orbit_content
         $xPath = new DOMXPath($contribNode->ownerDocument);
         $tplNodeList = $xPath->query('component_config[@className="AjxpTabulator::userdashboard_main_tab"]', $contribNode);
         if (!$tplNodeList->length) {
             return;
         }
         $contribNode->removeChild($tplNodeList->item(0));
     }
     parent::parseSpecificContributions($contribNode);
 }
 public function parseSpecificContributions(&$contribNode)
 {
     parent::parseSpecificContributions($contribNode);
     if ($contribNode->nodeName != "actions") {
         return;
     }
     $currentUserIsGroupAdmin = AuthService::getLoggedUser() != null && AuthService::getLoggedUser()->getGroupPath() != "/";
     if (!$currentUserIsGroupAdmin) {
         return;
     }
     $actionXpath = new DOMXPath($contribNode->ownerDocument);
     $publicUrlNodeList = $actionXpath->query('action[@name="create_repository"]/subMenu', $contribNode);
     if ($publicUrlNodeList->length) {
         $publicUrlNode = $publicUrlNodeList->item(0);
         $publicUrlNode->parentNode->removeChild($publicUrlNode);
     }
 }