$res.='<tr><td class="min nowrap">' . __('Certificat APNS') . ' Prod (' . __('Fichier .pem') . ')</td><td><input type="file" name="apns_prod" /></td></tr>';\r
$res.='</table>';\r
\r
+ $res.='<h3>' . __('Applications offline') . '</h3>';\r
+ $res.='<table class="max">';\r
+ $res.='<tr><td class="min nowrap">' . __("Filtres d'exclusion") . '</td><td>' . form::textarea(array('settings[offline_exclude]', 'offline_exclude'), 30, 3, $collection->settings['offline_exclude']) . '</td></tr>';\r
+ $res.='<tr><td class="min nowrap">' . __("Synchronisations supplémentaires") . '</td><td>' . form::textarea(array('settings[offline_syncs]', 'offline_syncs'), 30, 3, $collection->settings['offline_syncs']) . '</td></tr>';\r
+ $res.='</table>';\r
+\r
$res.='<h3>' . __('Thème') . '</h3>';\r
$res.='<table class="max">';\r
$images = array('back' => __('Image de fond'), 'etagere' => __("Image de l'étagère"), 'icon' => __("Icône de l'application") . ' (1024x1024px)');\r
)
);
+ $allpub = $compiler->books;
+
if (isset($collection->settings['offline']) && $collection->settings['offline']) {
- $phonegap->addAdditionalSource('publications', $compiler->getPublishedVersionPath($os));
+ $p = $compiler->getPublishedVersionPath($os);
+ $phonegap->addAdditionalSource('publications', $p);
+
+ $exs = explode("\n", $collection->settings['offline_exclude']);
+ foreach ($exs as $e) {
+ $e = trim($e);
+ if ($e == '') {
+ continue;
+ }
+
+ if (stristr($e, '$id$')) {
+ foreach ($allpub as $i) {
+ $phonegap->addExclude('"' . str_replace('$id$', $i, $e) . '"');
+ }
+ } else {
+ $phonegap->addExclude('"' . $e . '"');
+ }
+ }
+
+ $add = explode("\n", $collection->settings['offline_syncs']);
+ foreach ($add as $a) {
+ $a = trim($a);
+ if ($a == '') {
+ continue;
+ }
+ list($to, $source) = explode(':', $a);
+ $phonegap->addAdditionalSource('publications' . '/' . $to, $p . $source);
+ }
}
$ctrl = isset($_GET['ctrl']) && $_GET['ctrl'] == 'true';
}
$phonegap->run($run);
-
- /* $this->_createProject($os, $collection->nom, $collection->settings['namespace']);
- $this->_collectionAssets($os, $compiler);
- $this->_transfertPhonegap($os, $dir, $dest); */
}
/**
public $os;
public $phonegapVersion;
public $langs;
+ public $books=array();
public function __construct($collectionId) {
foreach ($this->collection->datas as $group) {
foreach ($group['publications'] as $p) {
- $books[] = $p['id'];
+ $this->books[] = $p['id'];
}
}
$daoBook = new wsDAOBook($core->con);
- $allbooks = $daoBook->selectByIds($books);
+ $allbooks = $daoBook->selectByIds($this->books);
$this->langs = array();
foreach ($allbooks as $b) {
$dir = WS_COLLECTIONS . '/versions/' . $this->collectionId . '/' . $time . '/';
- $books = array();
- foreach ($this->collection->datas as $group) {
- foreach ($group['publications'] as $p) {
- $books[] = $p['id'];
- }
- }
+ $books = $this->getPublicationsIds();
$exporter = new wsExporter();
foreach ($os as $o) {
return $time;
}
+ protected function getPublicationsIds() {
+ $books = array();
+ foreach ($this->collection->datas as $group) {
+ foreach ($group['publications'] as $p) {
+ $books[] = $p['id'];
+ }
+ }
+ return $books;
+ }
+
protected function copy($s, $t) {
if (!file_exists($s)) {
return;