'getKnownSegmentsToArchiveForSite', 'Segments.getKnownSegmentsToArchiveAllSites' => 'getKnownSegmentsToArchiveAllSites', 'AssetManager.getJavaScriptFiles' => 'getJsFiles', 'AssetManager.getStylesheetFiles' => 'getStylesheetFiles', 'Template.nextToCalendar' => 'getSegmentEditorHtml', 'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys', ); } function getSegmentEditorHtml(&$out) { $selector = new SegmentSelectorControl(); $out .= $selector->render(); } public function getKnownSegmentsToArchiveAllSites(&$segments) { $this->getKnownSegmentsToArchiveForSite($segments, $idSite = false); } /** * Adds the pre-processed segments to the list of Segments. * Used by CronArchive, ArchiveProcessor\Rules, etc. * * @param $segments * @param $idSite */ public function getKnownSegmentsToArchiveForSite(&$segments, $idSite) { $model = new Model(); $segmentToAutoArchive = $model->getSegmentsToAutoArchive($idSite); foreach ($segmentToAutoArchive as $segmentInfo) { $segments[] = $segmentInfo['definition']; } $segments = array_unique($segments); } public function install() { Model::install(); } public function getJsFiles(&$jsFiles) { $jsFiles[] = "plugins/SegmentEditor/javascripts/Segmentation.js"; } public function getStylesheetFiles(&$stylesheets) { $stylesheets[] = "plugins/SegmentEditor/stylesheets/segmentation.less"; } /** * Returns whether adding segments for all websites is enabled or not. * * @return bool */ public static function isAddingSegmentsForAllWebsitesEnabled() { return Config::getInstance()->General['allow_adding_segments_for_all_websites'] == 1; } public function getClientSideTranslationKeys(&$translationKeys) { $translationKeys[] = 'SegmentEditor_CustomSegment'; $translationKeys[] = 'SegmentEditor_VisibleToSuperUser'; $translationKeys[] = 'SegmentEditor_SharedWithYou'; } }