Beispiel #1
0
 /**
  *
  * @return BASE_CMP_ContextAction
  */
 private function getContextToolbar()
 {
     $language = OW::getLanguage();
     $permissions = $this->getPemissions();
     $contextActionMenu = new BASE_CMP_ContextAction();
     $contextParentAction = new BASE_ContextAction();
     $contextParentAction->setKey('gheaderToolbar');
     $contextParentAction->setLabel('<span class="uh-toolbar-add-label">' . $language->text('gheader', 'set_covet_label') . '</span><span class="uh-toolbar-edit-label">' . $language->text('gheader', 'change_covet_label') . '</span>');
     $contextParentAction->setId('uh-toolbar-parent');
     //$contextParentAction->setClass('ow_ic_picture');
     $contextActionMenu->addAction($contextParentAction);
     if ($permissions['add']) {
         if (GHEADER_CLASS_PhotoBridge::getInstance()->isActive()) {
             $contextAction = new BASE_ContextAction();
             $contextAction->setParentKey($contextParentAction->getKey());
             $contextAction->setLabel($language->text('gheader', 'choose_from_photos_label'));
             $contextAction->setUrl('javascript://');
             $contextAction->setKey('uhChoose');
             $contextAction->setId('uhco-choose');
             $contextAction->setClass('uhco-item uhco-choose');
             $contextAction->setOrder(1);
             $contextActionMenu->addAction($contextAction);
         }
         $contextAction = new BASE_ContextAction();
         $contextAction->setParentKey($contextParentAction->getKey());
         $contextAction->setLabel('<div class="uh-fake-file"><div>' . $language->text('gheader', 'upload_label') . '</div><input type="file" name="file" id="uh-upload-cover" size="1" /></div>');
         $contextAction->setUrl('javascript://');
         $contextAction->setKey('uhUpload');
         $contextAction->setClass('uhco-item uhco-upload');
         $contextAction->setOrder(2);
         $contextActionMenu->addAction($contextAction);
     }
     if ($permissions['reposition']) {
         $contextAction = new BASE_ContextAction();
         $contextAction->setParentKey($contextParentAction->getKey());
         $contextAction->setLabel($language->text('gheader', 'reposition_label'));
         $contextAction->setUrl('javascript://');
         $contextAction->setKey('uhReposition');
         $contextAction->setId('uhco-reposition');
         $contextAction->setClass('uhco-item uhco-reposition');
         $contextAction->setOrder(3);
         $contextActionMenu->addAction($contextAction);
     }
     if ($permissions['delete']) {
         $contextAction = new BASE_ContextAction();
         $contextAction->setParentKey($contextParentAction->getKey());
         $contextAction->setLabel($language->text('gheader', 'remove_label'));
         $contextAction->setUrl('javascript://');
         $contextAction->setKey('uhRemove');
         $contextAction->setId('uhco-remove');
         $contextAction->setClass('uhco-item uhco-remove');
         $contextAction->setOrder(4);
         $contextActionMenu->addAction($contextAction);
     }
     return $contextActionMenu;
 }
Beispiel #2
0
 public function __construct($params = null)
 {
     parent::__construct();
     $this->bridge = GHEADER_CLASS_PhotoBridge::getInstance();
     if (!$this->bridge->isActive()) {
         $this->setVisible(false);
         return;
     }
     if (!empty($params['windowHeight'])) {
         $this->windowHeight = $params['windowHeight'];
     }
     $this->userId = OW::getUser()->getId();
 }
Beispiel #3
0
 public function fullInit()
 {
     //FULL INIT
     $this->genericInit();
     //OVerwrite
     require_once $this->getPlugin()->getRootDir() . 'overwrite' . DS . 'components' . DS . 'brief_info.php';
     // Bridges
     GHEADER_CLASS_PhotoBridge::getInstance()->init();
     GHEADER_CLASS_NewsfeedBridge::getInstance()->init();
     GHEADER_CLASS_NotificationsBridge::getInstance()->init();
     GHEADER_CLASS_CommentsBridge::getInstance()->init();
     GHEADER_CLASS_CreditsBridge::getInstance()->init();
     OW::getEventManager()->bind('admin.add_auth_labels', array($this, 'onAddAuthLabels'));
 }
Beispiel #4
0
 public static function validateSettingList($settingList)
 {
     parent::validateSettingList($settingList);
     $validationMessage = OW::getLanguage()->text('gheader', 'widget_height_validation_error', array('min' => self::MIN_HEIGHT, 'max' => self::MAX_HEIGHT));
     $settingList['coverHeight'] = intval($settingList['coverHeight']);
     if ($settingList['coverHeight'] < self::MIN_HEIGHT) {
         throw new WidgetSettingValidateException($validationMessage, 'coverHeight');
     }
     if ($settingList['coverHeight'] > self::MAX_HEIGHT) {
         throw new WidgetSettingValidateException($validationMessage, 'coverHeight');
     }
     if (!GHEADER_CLASS_PhotoBridge::getInstance()->isActive()) {
         return;
     }
     $albumName = trim($settingList['albumName']);
     if ($settingList['saveToPhoto'] && empty($albumName)) {
         $errorMessage = OW::getLanguage()->text('gheader', 'widget_album_name_validation_error');
         throw new WidgetSettingValidateException($errorMessage, 'albumName');
     }
 }
Beispiel #5
0
 public function loadMorePhotos($query)
 {
     $count = 20;
     $start = $query['offset'];
     $listFull = false;
     $userId = OW::getUser()->getId();
     $photos = GHEADER_CLASS_PhotoBridge::getInstance()->findUserPhotos($userId, $start, $count);
     $photoCount = count($photos);
     $listFull = $photoCount < $count;
     $list = new GHEADER_CMP_MyPhotoList($photos);
     return array('listFull' => $listFull, 'list' => $list->render());
 }