Пример #1
0
 /**
  * Constructor
  *
  * @access  protected
  * @return  void
  * @since   1.5.5
  */
 function __construct($config = array())
 {
     parent::__construct($config);
     $this->_ambit = JoomAmbit::getInstance();
     $this->_config = JoomConfig::getInstance();
     $this->_mainframe = JFactory::getApplication('administrator');
     $this->_user = JFactory::getUser();
     $this->_doc = JFactory::getDocument();
     $this->_doc->addStyleSheet($this->_ambit->getStyleSheet('admin.joomgallery.css'));
     JHtmlBehavior::framework();
     $this->_doc->addScript($this->_ambit->getScript('admin.js'));
     JoomHelper::addSubmenu();
     JHTML::addIncludePath(JPATH_COMPONENT . '/helpers/html');
     // Check for available updates
     if (!($checked = $this->_mainframe->getUserState('joom.update.checked'))) {
         $controller = JRequest::getCmd('controller');
         if ($this->_config->get('jg_checkupdate') && $controller && $controller != 'control') {
             $dated_extensions = JoomExtensions::checkUpdate();
             if (count($dated_extensions)) {
                 $this->_mainframe->enqueueMessage(JText::_('COM_JOOMGALLERY_ADMENU_SYSTEM_NOT_UPTODATE'), 'warning');
                 $this->_mainframe->setUserState('joom.update.checked', -1);
             } else {
                 $this->_mainframe->setUserState('joom.update.checked', 1);
             }
         }
     } else {
         if ($checked == -1) {
             $controller = JRequest::getCmd('controller');
             if ($controller && $controller != 'control') {
                 $this->_mainframe->enqueueMessage(JText::_('COM_JOOMGALLERY_ADMENU_SYSTEM_NOT_UPTODATE'), 'warning');
             }
         }
     }
 }
Пример #2
0
 /**
  * Is automatically called when an unknown method is called.
  * This will happen if JoomGallery is not uptodate.
  *
  * @param   string  $name   Name of the unknown method
  * @param   array   $params Array of parameters given to the unknown method
  * @return  void
  * @since   1.5.0
  */
 public function __call($name, $params)
 {
     $this->_mainframe->enqueueMessage('JoomGallery is not uptodate. Function ' . $name . ' does not exist', 'error');
 }
Пример #3
0
    /**
     * Make a redirect
     *
     * @param   int     $remaining  Number of remaining steps
     * @param   string  $task       The task which will be called after the redirect
     * @param   string  $msg        An optional message which will be enqueued (this is currently disabled)
     * @param   string  $type       Type of the message (one of 'message', 'notice', 'error')
     * @param   string  $controller The controller which will be called after the redirect
     * @return  void
     * @since   1.5.5
     */
    public function refresh($remaining = null, $task = null, $msg = null, $type = null, $controller = null)
    {
        if ($remaining) {
            $this->_remaining = $remaining;
        }
        if ($this->_msg && is_null($task)) {
            $this->_mainframe->enqueueMessage(JText::_('COM_JOOMGALLERY_COMMON_REDIRECT'));
        }
        if (!$task) {
            $task = $this->_task;
        }
        if (!$controller) {
            $controller = $this->_controller;
        }
        if ($msg) {
            $this->_mainframe->enqueueMessage($msg, $type);
        }
        if (!$this->_msg || $msg) {
            // Persist messages if they exist
            $messages = $this->_mainframe->getMessageQueue();
            if (count($messages)) {
                $session = JFactory::getSession();
                $session->set('application.queue', $messages);
            }
        }
        $url = 'index.php?option=' . _JOOM_OPTION . '&controller=' . $controller . '&task=' . $task;
        $onclick = 'document.location.href=\'' . $url . '\';';
        $buffer = '';
        if ($buffer = ob_get_contents()) {
            ob_end_clean();
        }
        echo '<?xml version="1.0" encoding="utf-8"?' . '>';
        ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <!--<link rel="stylesheet" href="<?php 
        echo JoomAmbit::getInstance()->getStyleSheet('admin.joomgallery.css');
        ?>
" type="text/css" />
    <link href="templates/<?php 
        echo $this->_mainframe->getTemplate();
        ?>
/css/template.css" rel="stylesheet" type="text/css" />-->
    <link href="<?php 
        echo JUri::root();
        ?>
media/jui/css/bootstrap.css" rel="stylesheet" type="text/css" />
    <link href="<?php 
        echo JUri::root();
        ?>
media/jui/css/bootstrap-extended.css" rel="stylesheet" type="text/css" />
    <?php 
        if (JFactory::getLanguage()->isRTL()) {
            ?>
    <link href="<?php 
            echo JUri::root();
            ?>
media/jui/css/bootstrap-rtl.css" rel="stylesheet" type="text/css" />
    <?php 
        }
        ?>
    <style type="text/css">
      body{
        margin-top:30px;
      }
<?php 
        if ($this->_showprogress) {
            ?>
      .bar{
        width:<?php 
            echo floor(($this->_total - $this->_remaining) / $this->_total * 100);
            ?>
% !important;
      }
<?php 
        }
        ?>
    </style>
    <title><?php 
        echo JText::_('COM_JOOMGALLERY_COMMON_REFRESHER_IN_PROGRESS');
        ?>
</title>
  </head>
  <body>
    <div class="row-fluid">
      <div class="offset2 span8 well">
        <div class="alert alert-info">
          <?php 
        echo JText::_('COM_JOOMGALLERY_COMMON_REFRESHER_PLEASE_WAIT');
        if ($this->_name) {
            ?>
          <br />
          <?php 
            echo JText::sprintf('COM_JOOMGALLERY_COMMON_REFRESHER_CURRENT_TASK', '<span style="color:green;">' . $this->_name . '</span>');
        }
        ?>
        </div>
        <p class="center"><img src="<?php 
        echo JUri::root();
        ?>
media/system/images/modal/spinner.gif" alt="Spinner" width="16" height="16" /></p>
<?php 
        if ($this->_showprogress) {
            ?>
        <div class="progress progress-striped active" title="<?php 
            echo JText::sprintf('COM_JOOMGALLERY_COMMON_REFRESHER_PROGRESSBAR', $this->_maxtime);
            ?>
">
          <div class="bar"></div>
        </div>
        <div class="small muted center"><?php 
            echo JText::sprintf('COM_JOOMGALLERY_COMMON_REFRESHER_PROGRESSBAR', $this->_maxtime);
            ?>
</div>
<?php 
        }
        if ($this->_msg) {
            $doc = JFactory::getDocument();
            $renderer = $doc->loadRenderer('message');
            echo $renderer->render('');
        }
        ?>
      </div>
    </div>
    <div><?php 
        echo $buffer;
        ?>
</div>
    <script type="text/javascript"><?php 
        echo $onclick;
        ?>
</script>
  </body>
</html><?php 
        $this->_mainframe->close();
    }