예제 #1
0
 /**
  * Singleton instantiation
  * @return HTS_Api
  */
 public static function getInstance()
 {
     if (is_null(self::$_instance)) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
예제 #2
0
 function __construct()
 {
     $this->_social = HTS_Api::getInstance()->getSocialPlugin();
     $this->view = new Zend_View();
     $this->view->social = $this->_social;
     $this->_social_name = $this->view->social->getName();
 }
예제 #3
0
 public function init()
 {
     parent::init();
     /*
      * Initial instance of social plugin
      */
     $this->_social = HTS_Api::getInstance()->getSocialPlugin();
     $this->view->social = $this->_social;
     /*
      * Initial layout
      */
     $this->_helper->layout->setLayout('hts_canvas');
     /*
      * Check user authorize apps 
      */
     $this->_authenticate();
     $this->_authorize();
     /*
      * Get user infomation
      */
     $this->_id_user = $this->_social->getIdUser();
     $this->_id_social = $this->_social->getIdSocial();
     $this->_user = $this->_social->getUser();
     /*
      * Get all params
      */
     $this->_params = $this->_getAllParams();
     $this->_params['id_user'] = $this->_id_user;
     $this->_params['id_social'] = $this->_id_social;
     Zend_Registry::set('params', $this->_params);
     /*
      * Initial translate language
      */
     $this->_initTranslator();
 }
 function init()
 {
     parent::init();
     $social = HTS_Api::getInstance()->getSocialPlugin();
     $name = $social->getName();
     $viewPath = HTS_PATH . '/' . $name . '/views/scripts/' . strtolower($name);
     $view = $this->getView();
     $view->addScriptPath($viewPath);
     $this->setMultiOptions($social->getPageList());
     $this->setDecorators(array(array('ViewScript', array('viewScript' => 'loadFanpages.phtml'))));
 }
예제 #5
0
 private function _preConstruct()
 {
     $this->_social = HTS_Api::getInstance()->getSocialPlugin();
     $this->_params = Zend_Registry::get('params');
 }
 protected function _initYouNetApi()
 {
     // init Social plugin
     $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/social.ini', APPLICATION_ENV);
     HTS_Api::getInstance()->initSocialPlugin($config->social);
 }