Esempio n. 1
0
 /**
  * check if page is an edit page
  */
 public static function isEditPage()
 {
     $hash = md5('isEditPage');
     if (RLCache::has($hash)) {
         return RLCache::get($hash);
     }
     $app = JFactory::getApplication();
     $option = $app->input->get('option');
     // always return false for these components
     if (in_array($option, array('com_rsevents', 'com_rseventspro'))) {
         return RLCache::set($hash, false);
     }
     $task = $app->input->get('task');
     if (strpos($task, '.') !== false) {
         $task = explode('.', $task);
         $task = array_pop($task);
     }
     $view = $app->input->get('view');
     if (strpos($view, '.') !== false) {
         $view = explode('.', $view);
         $view = array_pop($view);
     }
     $isedit = in_array($task, array('edit', 'form', 'submission')) || in_array($view, array('edit', 'form')) || in_array($app->input->get('do'), array('edit', 'form')) || in_array($app->input->get('layout'), array('edit', 'form', 'write')) || in_array($app->input->get('option'), array('com_contentsubmit', 'com_cckjseblod')) || $app->input->get('option') == 'com_comprofiler' && in_array($task, array('', 'userdetails')) || RLProtect::isAdmin();
     return RLCache::set($hash, $isedit);
 }