Ejemplo n.º 1
0
 /**
  * readAjaxAction
  *
  * @return	void
  */
 public function readAjaxAction()
 {
     try {
         $this->task = 'read';
         parent::read();
     } catch (Exception $e) {
         $message = json_encode(array('status' => false, 'message' => $e->getMessage(), 'messageType' => 'error', 'hash' => AutotweetBaseHelper::getHash()));
         echo EJSON_START . $message . EJSON_END;
     }
 }
Ejemplo n.º 2
0
 /**
  * addItemeditorHelperApp
  *
  * @return string
  */
 public static function addItemeditorHelperApp()
 {
     static $link = false;
     if ($link) {
         return $link;
     }
     $doc = JFactory::getDocument();
     $app = JFactory::getApplication();
     list($isAdmin, $option, $controller, $task, $view, $layout, $id) = AutotweetBaseHelper::getControllerParams();
     $js = "var autotweetUrlRoot = '" . JUri::root() . "';\n";
     $js .= "var autotweetUrlBase = '" . JUri::base() . "';\n";
     $mediaPath = 'media/com_autotweet/js/itemeditor/templates/';
     $ext = '.txt';
     $joomlaPart = '.j' . (EXTLY_J3 ? '3' : '25');
     $sitePart = $isAdmin ? '.admin' : '.site';
     $tpl0 = $mediaPath . $option . $ext;
     $tpl1 = $mediaPath . $option . $joomlaPart . $ext;
     $tpl2 = $mediaPath . $option . $sitePart . $joomlaPart . $ext;
     $tpl3 = $mediaPath . $option . $sitePart . $ext;
     if (file_exists(JPATH_ROOT . '/' . $tpl2)) {
         $tpl = $tpl2;
     } elseif (file_exists(JPATH_ROOT . '/' . $tpl1)) {
         $tpl = $tpl1;
     } elseif (file_exists(JPATH_ROOT . '/' . $tpl3)) {
         $tpl = $tpl3;
     } elseif (file_exists(JPATH_ROOT . '/' . $tpl0)) {
         $tpl = $tpl0;
     } else {
         $tpl = $mediaPath . 'com_joocial-default' . $joomlaPart . $ext;
     }
     $tpl = JUri::root() . $tpl . '?version=' . CAUTOTWEETNG_VERSION;
     $js .= "var autotweetPanelTemplate = 'text!" . $tpl . "';\n";
     $doc->addScriptDeclaration($js);
     $link = 'index.php?option=com_autotweet&view=itemeditor&layout=modal&tmpl=component&' . JSession::getFormToken() . '=1';
     // Add Advanced Attributes
     $params = null;
     // Case Request edit page
     if ($option == CAUTOTWEETNG && $view == 'request' && $task == 'edit') {
         $params = AdvancedattrsHelper::getAdvancedAttrByReq($id);
     } elseif ($id > 0) {
         $params = AdvancedattrsHelper::getAdvancedAttrs($option, $id);
     }
     if (!$params) {
         $params = new StdClass();
         $params->description = '';
         $params->hashtags = '';
         $params->fulltext = '';
         $params->postthis = EParameter::getComponentParam(CAUTOTWEETNG, 'joocial_postthis', PlgAutotweetBase::POSTTHIS_DEFAULT);
         $params->evergreen = PlgAutotweetBase::POSTTHIS_NO;
         $params->agenda = array();
         $params->unix_mhdmd = '';
         $params->repeat_until = '';
         $params->image = '';
         $params->image_url = '';
         $params->channels = '';
         $params->channels_text = '';
     }
     // Migrating old objects
     if (!isset($params->description)) {
         $params->description = '';
     }
     // Migrating old objects
     if (!isset($params->hashtags)) {
         $params->hashtags = '';
     }
     // Migrating old objects
     if (!isset($params->fulltext)) {
         $params->fulltext = '';
     }
     // Migrating old objects
     if (!isset($params->image_url)) {
         $params->image_url = '';
     }
     $params->editorTitle = VersionHelper::getFlavourName() . ' ' . JText::_('COM_AUTOTWEET_VIEW_ITEMEDITOR_TITLE');
     $params->postthisLabel = JText::_('COM_AUTOTWEET_VIEW_ITEMEDITOR_POSTTHIS');
     $params->evergreenLabel = JText::_('COM_AUTOTWEET_VIEW_ITEMEDITOR_EVERGREEN');
     $params->agendaLabel = JText::_('COM_AUTOTWEET_VIEW_ITEMEDITOR_SCHEDULER');
     $params->unix_mhdmdLabel = JText::_('COM_XTCRONJOB_TASKS_FIELD_UNIX_MHDMD');
     $params->repeat_untilLabel = JText::_('COM_AUTOTWEET_VIEW_ITEMEDITOR_REPEAT_UNTIL');
     $params->imageLabel = JText::_('COM_AUTOTWEET_VIEW_ITEMEDITOR_IMAGES');
     $params->channelLabel = JText::_('COM_AUTOTWEET_VIEW_ITEMEDITOR_CHANNELS');
     $params->postthisDefaultLabel = '<i class="xticon xticon-circle-o"></i> ' . JText::_('COM_AUTOTWEET_DEFAULT_LABEL');
     $params->postthisYesLabel = '<i class="xticon xticon-check"></i> ' . JText::_('JYES');
     $params->postthisNoLabel = '<i class="xticon xticon-times"></i> ' . JText::_('JNO');
     $params->descriptionLabel = JText::_('COM_AUTOTWEET_VIEW_ITEMEDITOR_MSG');
     $params->hashtagsLabel = JText::_('COM_AUTOTWEET_VIEW_ITEMEDITOR_HASHTAGS');
     $params->fulltextLabel = JText::_('COM_AUTOTWEET_VIEW_ITEMEDITOR_FULLTEXT_DESC');
     if (!isset($params->channels_text)) {
         $params->channels_text = '';
     }
     AutotweetBaseHelper::convertUTCLocalAgenda($params->agenda);
     $js = 'var autotweetAdvancedAttrs = ' . json_encode($params) . ";\n";
     $doc->addScriptDeclaration($js);
     $file = EHtml::getRelativeFile('js', 'com_autotweet/itemeditor.helper.min.js');
     if ($file) {
         $paths = array();
         $paths = array('text' => Extly::JS_LIB . 'require/text.min');
         $deps = array('itemeditor.helper' => array('text', 'underscore'));
         Extly::getScriptManager(false);
         Extly::initApp(CAUTOTWEETNG_VERSION, $file, $deps, $paths);
     }
     return $link;
 }
Ejemplo n.º 3
0
 /**
  * Better implementation to handle multiple menu entry for component (multiple itemids)
  *
  * @param   object  $comp_name  Param
  * @param   object  $needles    Param
  * @param   object  $q_view     Param
  *
  * @return	int
  */
 protected function getItemid($comp_name, $needles, $q_view = 'view')
 {
     return AutotweetBaseHelper::getItemid($comp_name, $needles, $q_view);
 }
Ejemplo n.º 4
0
<?php

/**
 * @package     Extly.Components
 * @subpackage  com_autotweet - A powerful social content platform to manage multiple social networks.
 *
 * @author      Prieco S.A. <*****@*****.**>
 * @copyright   Copyright (C) 2007 - 2015 Prieco, S.A. All rights reserved.
 * @license     http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
 * @link        http://www.extly.com http://support.extly.com
 */
// No direct access
defined('_JEXEC') or die('Restricted access');
if (AUTOTWEETNG_JOOCIAL) {
    $params = AdvancedattrsHelper::getAdvancedAttrByReq($this->item->id);
    AutotweetBaseHelper::convertUTCLocalAgenda($params->agenda);
    if (!empty($params->image)) {
        $this->item->image_url = $params->image;
        $params->image = null;
    }
    $this->item->autotweet_advanced_attrs = $params;
}
echo EJSON_START . json_encode($this->item) . EJSON_END;
Ejemplo n.º 5
0
 /**
  * executeRule.
  *
  * @param   object  &$rule     Params
  * @param   object  &$channel  Params
  * @param   object  &$post     Params
  *
  * @return	void
  */
 public static function executeRule(&$rule, &$channel, &$post)
 {
     // Correct autopublish options when rules engine is used
     $post->nextstate = self::getValue($rule, self::RULE_AUTOPUBLISH);
     switch ($post->nextstate) {
         case 'on':
             $post->autopublish = true;
             break;
         case 'off':
             $post->autopublish = false;
             break;
         case 'cancel':
             $post->autopublish = false;
             break;
         case 'default':
             // Use default value from plugin/channel: do nothing
             break;
     }
     // Correct url link mode options when rules engine is used
     $show_url = self::getValue($rule, self::RULE_SHOW_URL);
     if ('default' != $show_url) {
         $post->show_url = $show_url;
     }
     // Target_id
     if (!isset($rule->xtform)) {
         $rule->xtform = Eform::paramsToRegistry($rule);
     }
     $target_id = $rule->xtform->get(self::RULE_TARGET_ID);
     if ($target_id) {
         $post->xtform->set('target_id', $target_id);
     }
     $message = TextUtil::cleanText($post->message);
     // Create message for new post (logged posts uses existing message text)
     // Filter first full and msgtext if there is an regex in rule
     $rule_reg_ex = self::getValue($rule, self::RULE_REG_EX);
     if (!empty($rule_reg_ex)) {
         $is_json = json_decode($rule_reg_ex);
         if ($is_json) {
             $rule_reg_ex = $is_json;
         }
         $rule_reg_replace = self::getValue($rule, self::RULE_REG_REPLACE);
         $is_json = json_decode($rule_reg_replace);
         if ($is_json) {
             $rule_reg_replace = $is_json;
         }
         $message = preg_replace($rule_reg_ex, $rule_reg_replace, $message);
         $post->title = preg_replace($rule_reg_ex, $rule_reg_replace, $post->title);
         $post->fulltext = preg_replace($rule_reg_ex, $rule_reg_replace, $post->fulltext);
     }
     $post->message = $message;
     // Apply a custom pattern to the text
     $pattern = self::getValue($rule, self::RULE_RMC_TEXTPATTERN);
     if (!empty($pattern)) {
         AutotweetBaseHelper::applyTextPattern($pattern, $post);
     }
     $message = $post->message;
     // Add static text from rules engine
     $show_static_text = self::getValue($rule, self::RULE_SHOW_STATIC_TEXT);
     $rule_static_text = self::getValue($rule, self::RULE_STATIC_TEXT);
     $message = AutotweetBaseHelper::addStatictext($show_static_text, $message, $rule_static_text);
     $post->message = $message;
 }
Ejemplo n.º 6
0
	ng-controller="EditorController as editorCtrl">
	<input type="hidden" name="option" value="com_autotweet" /> <input
		type="hidden" name="view" value="composer" /> <input type="hidden"
		name="task" value="" /> <input type="hidden" name="returnurl"
		value="<?php 
echo base64_encode(JRoute::_('index.php?option=com_autotweet&view=cpanels'));
?>
" />
<?php 
echo EHtml::renderRoutingTags();
// Publish_up
echo '<input type="hidden" name="plugin"
 		ng-init="editorCtrl.plugin = \'autotweetpost\'"
 		ng-value="editorCtrl.plugin" />';
echo '<input type="hidden" name="ref_id"
 		ng-init="editorCtrl.ref_id = \'' . AutotweetBaseHelper::getHash() . '\'"
 		ng-value="editorCtrl.ref_id"/>';
echo '<input type="hidden" name="id"
 		ng-init="editorCtrl.request_id = 0"
 		ng-value="editorCtrl.request_id" />';
echo '<input type="hidden" name="published" value="0" />';
?>
<fieldset>
		<div class="row-fluid">
			<div class="span12">

				<p class="text-center" ng-if="editorCtrl.waiting"><span class="loaderspinner72 loading72">
					<?php 
echo JText::_('COM_AUTOTWEET_LOADING');
?>
				</span></p>