Example #1
0
 private function _renderStatus()
 {
     $date = JFactory::getDate();
     $jparam = new JConfig();
     if (!JFile::exists(JPATH_ROOT . '/administrator/components/com_community/community.xml')) {
         return false;
     }
     if (JFile::exists(JPATH_ROOT . '/administrator/components/com_community/jomsocialupdate.ini')) {
         $lastcheckdate = JFile::read(JPATH_ROOT . '/administrator/components/com_community/jomsocialupdate.ini');
     } else {
         $lastcheckdate = $date->format('Y-m-d H:i:s');
     }
     JFile::write(JPATH_ROOT . '/administrator/components/com_community/jomsocialupdate.ini', $lastcheckdate);
     $dayInterval = 1;
     // days
     $currentdate = $date->format('Y-m-d H:i:s');
     $checkVersion = strtotime($currentdate) > strtotime($lastcheckdate) + $dayInterval * 60 * 60 * 24;
     // Load language
     $lang = JFactory::getLanguage();
     $lang->load('com_community', JPATH_ROOT . '/administrator');
     $button = $this->_getButton($checkVersion);
     $html = JResponse::getBody();
     $html = str_replace('<div id="module-status">', '<div id="module-status">' . $button, $html);
     // Load AJAX library for the back end.
     $jaxScript = '';
     $noHTML = JRequest::getInt('no_html', 0);
     $format = JRequest::getWord('format', 'html');
     if (!$noHTML && $format == 'html') {
         require_once AZRUL_SYSTEM_PATH . '/pc_includes/ajax.php';
         $jax = new JAX(AZRUL_SYSTEM_LIVE . '/pc_includes');
         $jax->setReqURI(rtrim(JURI::root(), '/') . '/administrator/index.php');
         $jaxScript = $jax->getScript();
     }
     JResponse::setBody($html . $jaxScript);
 }
Example #2
0
 public function _renderStatus()
 {
     $date = JFactory::getDate();
     $jparam = new JConfig();
     if (!JFile::exists(JPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . 'com_community' . DS . 'community.xml')) {
         return false;
     }
     if (JFile::exists($jparam->tmp_path . DS . 'jomsocialupdate.ini')) {
         $lastcheckdate = JFile::read($jparam->tmp_path . DS . 'jomsocialupdate.ini');
     } else {
         $lastcheckdate = $date->toFormat();
     }
     JFile::write($jparam->tmp_path . DS . 'jomsocialupdate.ini', $lastcheckdate);
     $dayInterval = 1;
     // days
     $currentdate = $date->toFormat();
     $checkVersion = strtotime($currentdate) > strtotime($lastcheckdate) + $dayInterval * 60 * 60 * 24;
     // Load language
     $lang = JFactory::getLanguage();
     $lang->load('com_community', JPATH_ROOT . DS . 'administrator');
     $button = $this->_getButton($checkVersion);
     $html = JResponse::getBody();
     $html = str_replace('<div id="module-status">', '<div id="module-status">' . $button, $html);
     // Load AJAX library for the back end.
     $jax = new JAX(rtrim(JURI::root(), '/') . '/plugins/system/pc_includes');
     $jax->setReqURI(rtrim(JURI::root(), '/') . '/administrator/index.php');
     $jaxScript = $jax->getScript();
     JResponse::setBody($html . $jaxScript);
 }
Example #3
0
 */
class plgCommunityEditormyphotos extends JPlugin
{
    var $name = 'editormyphotos';
    var $_name = 'editormyphotos';
    /**
	 * Constructor
	 *
	 * For php4 compatability we must not use the __constructor as a constructor for plugins
	 * because func_get_args ( void ) returns a copy of all passed arguments NOT references.
	 * This causes problems with cross-referencing necessary for the observer design pattern.
	 *
	 * @param 	object $subject The object to observe
	 * @param 	array  $config  An array that holds the plugin configuration
	 * @since 1.5
	 */
    function plgCommunityEditormyphotos(&$subject, $config)
Example #4
0
/**
 * Display required javascript codes for AJAX function calls
 **/
function azrulSysBot()
{
    static $added = false;
    if (!$added) {
        $format = JRequest::getWord('format', 'html');
        if ($format == 'pdf') {
            return;
        }
        // Include ajax file
        include_once AZRUL_SYSTEM_PATH . '/pc_includes/ajax.php';
        $jax = new JAX(AZRUL_SYSTEM_LIVE . '/pc_includes');
        $jax->setReqURI(AZRUL_BASE_LIVE . '/index.php');
        $jax->process();
        $noHTML = JRequest::getInt('no_html', 0);
        if (!$noHTML && $format == 'html') {
            $document =& JFactory::getDocument();
            if ($document->getType() == 'html') {
                $document->addCustomTag($jax->getScript());
            }
        }
        $added = true;
    }
}
Example #5
0
/**
 * Display required javascript codes for AJAX function calls
 **/
function azrulSysBot()
{
    static $added = false;
    if (!$added) {
        $format = 'html';
        // Don't display mambots on pdf view for 1.5
        if (azrulGetJoomlaVersion() == '1.5') {
            $format = JRequest::getWord('format', 'html');
            if ($format == 'pdf') {
                return;
            }
        }
        // Include ajax file
        include_once AZRUL_SYSTEM_PATH . '/pc_includes/ajax.php';
        $jax = new JAX(AZRUL_SYSTEM_LIVE . '/pc_includes');
        $jax->setReqURI(AZRUL_BASE_LIVE . '/index.php');
        $jax->process();
        if (!isset($_POST['no_html']) && $format == 'html') {
            global $mainframe;
            $mainframe->addCustomHeadTag($jax->getScript());
        }
        $added = true;
    }
}
Example #6
0
    JTable::addIncludePath(JPATH_COMPONENT . '/tables');
}
// Get the task
$task = JRequest::getCmd('task', 'display');
// Load the required libraries
if (!defined('JAX_SITE_ROOT') && defined('AZRUL_SYSTEM_PATH')) {
    require_once AZRUL_SYSTEM_PATH . '/pc_includes/ajax.php';
}
// Let's test if the task is azrul_ajax , we skip the controller part at all.
if (isset($task) && $task == 'azrul_ajax') {
    require_once JPATH_ROOT . '/administrator/components/com_community/ajax.community.php';
} else {
    ob_start();
    // Load AJAX library for the back end. Only if the plugin exist
    if (class_exists('JAX')) {
        $jax = new JAX(AZRUL_SYSTEM_LIVE . '/pc_includes');
        $jax->setReqURI(rtrim(JURI::root(), '/') . '/administrator/index.php');
        // @rule: We do not want to add these into tmpl=component or no_html=1 in the request.
        if ($jinput->request->get('no_html', '', 'NONE') != 1 && $jinput->request->get('tmpl', '', 'NONE') != 'component') {
            // Override previously declared jax_live_site stuffs
            if (!$jax->process()) {
                echo $jax->getScript();
            }
        }
    }
    // We treat the view as the controller. Load other controller if there is any.
    $controller = JRequest::getWord('view', 'community');
    if (!empty($controller)) {
        $controller = JString::strtolower($controller);
        $path = JPATH_ROOT . '/administrator/components/com_community/controllers/' . $controller . '.php';
        // Test if the controller really exists