Exemplo n.º 1
0
 /**
  * Regenerate system filenames
  * (See AttachmentsUpdate::regenerate_system_filenames() in update.php for details )
  */
 public function regenerate_system_filenames()
 {
     // Access check.
     if (!JFactory::getUser()->authorise('core.admin', 'com_attachments')) {
         return JError::raiseError(404, JText::_('JERROR_ALERTNOAUTHOR') . ' (ERR 154)');
     }
     require_once JPATH_ADMINISTRATOR . '/components/com_attachments/update.php';
     $msg = AttachmentsUpdate::regenerate_system_filenames();
     if (JRequest::getBool('close')) {
         $this->enqueueSystemMessage($msg);
         // Close this window and refesh the parent window
         AttachmentsJavascript::closeModal();
     } else {
         $this->setRedirect('index.php?option=' . $this->option, $msg);
     }
 }
Exemplo n.º 2
0
 function regenerate_system_filenames()
 {
     require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_attachments' . DS . 'update.php';
     $close = JRequest::getVar('close', false);
     $msg = AttachmentsUpdate::regenerate_system_filenames();
     if ($close) {
         require_once JPATH_SITE . DS . 'components' . DS . 'com_attachments' . DS . 'helper.php';
         AttachmentsHelper::enqueueSystemMessage($msg);
         echo "<script>window.parent.document.getElementById('sbox-window').close();\n                  window.parent.location.reload();</script>";
     } else {
         global $option;
         $this->setRedirect('index.php?option=' . $option, $msg);
     }
 }