$types = array(1, 2, 3, 4, 5, 6, 7, 11, 13, 14, 15, 16, 17, 18, 19, 24, 25);
if (wsDroits::revendeur()) {
- $types = array(1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 24, 25, 31,33);
+ $types = array(1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 24, 25, 31, 33);
}
if (wsDroits::admin()) {
$types = range(1, 100);
'js/libs/fluidbook/fluidbook.zoom.js',
'js/libs/fluidbook/fluidbook.menu.js',
'js/libs/fluidbook/fluidbook.sound.js',
+ 'js/libs/fluidbook/fluidbook.contentlock.js',
'js/libs/fluidbook/fluidbook.scorm.js',
'js/libs/fluidbook/menu/fluidbook.chapters.js',
'js/libs/fluidbook/menu/fluidbook.index.js',
public $seoArticles = [];
public $securityPolicyWhitelist = ['*.google-analytics.com', '*.youtube.com', '*.ytimg.com'];
public $writeLinksData = false;
- public $lock_contents = [];
+ public $content_lock = [];
protected $_indexVars = null;
public $_signature;
if ($this->phonegap && ($this->book->parametres->offlineLink == '' || $this->book->parametres->offlineLink == 'http://')) {
$this->config->share = false;
}
+ if ($this->config->maxPages > 0) {
+ $this->addContentLock($this->config->maxPages);
+ }
// We need to be able to reference both navOrder and navOrderH so convert both to arrays
// We also make sure there are no empty items in the arrays (see: http://php.net/manual/en/function.array-filter.php#111091)
$this->seo = new wsHTML5Seo($this);
}
- public function addLockContents($page, $unlockConditions)
+ public function addContentLock($page, $unlockConditions = '')
{
- $unlockConditions = trim(CubeIT_Text::explodeNewLines($unlockConditions));
+ $unlockConditions = CubeIT_Text::explodeNewLines($unlockConditions);
$conditions = [];
foreach ($unlockConditions as $unlockCondition) {
$e = explode(',', $unlockCondition);
}
$conditions[] = $e;
}
- $this->lock_contents[] = ['page' => $page, 'unlockConditions' => $conditions];
+ $page = max(1, $page);
+ if (!isset($this->content_lock[$page])) {
+ $this->content_lock[$page] = ['unlocked' => 0, 'conditions' => []];
+ }
+ $this->content_lock[$page]['conditions'] = array_merge($this->content_lock[$page]['conditions'], $conditions);
}
protected function writeScorm()
protected function beforeWriteConfig()
{
- usort($this->lock_contents, function ($a, $b) {
+ uasort($this->content_lock, function ($a, $b) {
return $a['page'] - $b['page'];
});
- $this->config->lock_contents = $this->lock_contents;
+ $this->config->content_lock = $this->content_lock;
}
-
+
protected function writeJs()
{
$this->beforeWriteConfig();
case 33:
return new zoomhdLink($id, $init, $compiler);
case 34:
- $compiler->addLockContents($init['page'], $init['to']);
+ $compiler->addContentLock($init['page'], $init['to']);
break;
default:
return null;
$attr['controls'] = ($data->video_controls ? '1' : '0');
$attr['loop'] = ($data->video_loop ? '1' : '0');
$attr['sound'] = ($data->video_sound_on ? '1' : '0');
+ $attr['link-id'] = $data->uid;
if (!is_null($w) && !is_null($h)) {
$attr['width'] = $w;