Esempio n. 1
0
 protected function _prepareFiles()
 {
     $links = glob($this->_dst . '/src/com/' . $this->_formatted_bundle_name . '/' . $this->_formatted_name . '/*');
     $url = $this->getUrl();
     if (!$links) {
         return $this;
     }
     $links = array_merge(array($this->_dst . '/AndroidManifest.xml'), $links);
     foreach ($links as $link) {
         if (!is_dir($link)) {
             $this->__replace(array('siberian.app' => $this->_formatted_bundle_name . '.' . $this->_formatted_name), $link);
             if (strpos($link, 'CommonUtilities.java') !== false) {
                 $this->__replace(array('String SENDER_ID = ""' => 'String SENDER_ID = "' . Push_Model_Certificat::getAndroidSenderId() . '"', 'SERVEUR_URL = "http://www.siberiancms.com/";' => 'SERVEUR_URL = "' . $this->getUrl() . '";'), $link);
             }
         }
     }
     $name = str_replace(array('&', '/'), 'AND', $this->getApplication()->getName());
     $this->__replace(array('<name>Siberian</name>' => '<name>' . $name . '</name>'), $this->_dst . '/.project');
     $replacements = array('http://app.siberiancms.com' => $this->getApplication()->getUrl(null, array(), false, 'en'), '<string name="app_name">Siberian</string>' => '<string name="app_name">' . $name . '</string>');
     $this->__replace($replacements, $this->_dst . '/res/values/strings.xml');
     foreach (Core_Model_Language::getLanguageCodes() as $lang) {
         if ($lang != 'en') {
             $replacements = array('http://app.siberiancms.com' => $this->getApplication()->getUrl(null, array(), false, $lang), '<string name="app_name">Siberian</string>' => '<string name="app_name">' . $name . '</string>');
             $this->__replace($replacements, $this->_dst . '/res/values-' . $lang . '/strings.xml');
         }
     }
     return $this;
 }