コード例 #1
0
ファイル: photo_bridge.php プロジェクト: hardikamutech/loov
 /**
  * Returns class instance
  *
  * @return PCGALLERY_CLASS_PhotoBridge
  */
 public static function getInstance()
 {
     if (!isset(self::$classInstance)) {
         self::$classInstance = new self();
     }
     return self::$classInstance;
 }
コード例 #2
0
ファイル: init.php プロジェクト: hardikamutech/hammu
function pcgallery_class_get_instance(OW_Event $event)
{
    $params = $event->getParams();
    if ($params['className'] != 'BASE_CMP_ProfileActionToolbar') {
        return;
    }
    if (!PCGALLERY_CLASS_PhotoBridge::getInstance()->isActive()) {
        return;
    }
    $arguments = $params['arguments'];
    $cmp = new PCGALLERY_CMP_ProfileActionToolbarMock($arguments[0]);
    $event->setData($cmp);
    return $cmp;
}
コード例 #3
0
ファイル: gallery.php プロジェクト: hardikamutech/hammu
 public function onBeforeRender()
 {
     parent::onBeforeRender();
     $permissions = $this->getPemissions();
     PCGALLERY_CLASS_PhotoBridge::getInstance()->initFloatbox();
     $staticUrl = OW::getPluginManager()->getPlugin('pcgallery')->getStaticUrl();
     OW::getDocument()->addStyleSheet($staticUrl . 'style.css');
     OW::getDocument()->addScript($staticUrl . 'script.js');
     $this->assign("avatarApproval", $this->avatarDto && $this->avatarDto->status != "active");
     $this->initJs($permissions);
     $toolbar = new BASE_CMP_ProfileActionToolbar($this->userId);
     $this->addComponent('actionToolbar', $toolbar);
     $this->assign('uniqId', $this->uniqId);
     $this->assign('user', $this->getUserInfo());
     $this->assign('permissions', $permissions);
     $photos = $permissions["view"] ? $this->getPhotos() : array();
     $this->assign('empty', empty($photos));
     if (empty($photos)) {
         $this->initEmptyGallery();
     } else {
         $this->initFullGallery();
     }
     $this->assign('photos', $photos);
     $source = BOL_PreferenceService::getInstance()->getPreferenceValue("pcgallery_source", $this->userId);
     $settings = array("changeInterval" => self::PHOTO_CHANGE_INTERVAL, "userId" => $this->userId, "listType" => $source == "all" ? "userPhotos" : "albumPhotos");
     $js = UTIL_JsGenerator::newInstance();
     $js->callFunction(array('PCGALLERY', 'init'), array($this->uniqId, $settings, $photos));
     OW::getDocument()->addOnloadScript($js);
     OW::getLanguage()->addKeyForJs("pcgallery", "setting_fb_title");
 }