Ejemplo n.º 1
0
 /**
  * onAdd.
  *
  * @param   string  $tpl  Param
  *
  * @return	void
  */
 public function onAdd($tpl = null)
 {
     $result = parent::onAdd($tpl);
     Extly::loadAwesome();
     $file = EHtml::getRelativeFile('js', 'com_autotweet/channel.min.js');
     if ($file) {
         $dependencies = array();
         $dependencies['channel'] = array('extlycore');
         Extly::initApp(CAUTOTWEETNG_VERSION, $file, $dependencies);
     }
     $postsModel = F0FModel::getTmpInstance('Posts', 'AutoTweetModel');
     $postsModel->set('pubstate', array(AutotweetPostHelper::POST_SUCCESS, AutotweetPostHelper::POST_ERROR));
     $postsModel->set('channel', $this->item->id);
     $postsModel->set('filter_order', 'id');
     $postsModel->set('filter_order_Dir', 'DESC');
     $postsModel->set('limit', 1);
     $posts = $postsModel->getItemList();
     $alert_message = '';
     $alert_style = 'alert-info';
     if (count($posts) > 0) {
         $lastpost = $posts[0];
         if ($lastpost->pubstate == AutotweetPostHelper::POST_ERROR) {
             $alert_style = 'alert-error';
         }
         $alert_message = $lastpost->postdate . ' - ' . JText::_($lastpost->resultmsg);
     }
     $this->assign('alert_message', $alert_message);
     $this->assign('alert_style', $alert_style);
     return $result;
 }
Ejemplo n.º 2
0
 /**
  * onAdd.
  *
  * @param   string  $tpl  Param
  *
  * @return	void
  */
 public function onAdd($tpl = null)
 {
     Extly::loadAwesome();
     $file = EHtml::getRelativeFile('js', 'com_autotweet/post.min.js');
     if ($file) {
         $dependencies = array();
         $dependencies['post'] = array('extlycore');
         Extly::initApp(CAUTOTWEETNG_VERSION, $file, $dependencies);
     }
     return parent::onAdd($tpl);
 }
Ejemplo n.º 3
0
 /**
  * onAdd.
  *
  * @param   string  $tpl  Param
  *
  * @return	void
  */
 public function onAdd($tpl = null)
 {
     $result = parent::onAdd($tpl);
     Extly::loadAwesome();
     $file = EHtml::getRelativeFile('js', 'com_autotweet/post.min.js');
     if ($file) {
         $dependencies = array();
         $dependencies['post'] = array('extlycore');
         Extly::initApp(CAUTOTWEETNG_VERSION, $file, $dependencies);
     }
     if ($this->item->id == 0 && isset($this->item->pubstate)) {
         if (!$this->perms->editstate) {
             $this->item->pubstate = 'approve';
         }
     }
     return $result;
 }
Ejemplo n.º 4
0
 /**
  * onAdd.
  *
  * @param   string  $tpl  Param
  *
  * @return	void
  */
 public function onAdd($tpl = null)
 {
     $jlang = JFactory::getLanguage();
     $jlang->load('com_content');
     Extly::loadAwesome();
     $file = EHtml::getRelativeFile('js', 'com_autotweet/feed.min.js');
     if ($file) {
         $dependencies = array();
         $paths = array();
         $ajax_import = EParameter::getComponentParam(CAUTOTWEETNG, 'ajax_import', true);
         $this->assignRef('ajax_import', $ajax_import);
         if ($ajax_import) {
             $paths['import'] = 'media/com_autotweet/js/import.min';
         }
         Extly::initApp(CAUTOTWEETNG_VERSION, $file, $dependencies, $paths);
     }
     return parent::onAdd($tpl);
 }