Exemplo n.º 1
0
 /**
  * Creates new CUrl object based on giver URL (or $_REQUEST if null is given),
  * and adds/removes parameters based on current page context.
  *
  * @param string $sourceUrl
  *
  * @return CUrl
  */
 public static function getContextUrl($sourceUrl = null)
 {
     $config = self::resolveConfig();
     $url = new CUrl($sourceUrl);
     if (isset($config['remove'])) {
         foreach ($config['remove'] as $key) {
             $url->removeArgument($key);
         }
     }
     if (isset($config['add'])) {
         foreach ($config['add'] as $key) {
             $url->setArgument($key, getRequest($key));
         }
     }
     return $url;
 }
Exemplo n.º 2
0
            $result = CFavorite::remove('web.favorite.graphids', $_REQUEST['favid'], $_REQUEST['favobj']);
            if ($result) {
                echo '$("addrm_fav").title = "' . _('Add to favourites') . '";' . "\n";
                echo '$("addrm_fav").onclick = function() { add2favorites("graphid", "' . $_REQUEST['favid'] . '"); }' . "\n";
            }
        }
        $result = DBend($result);
        if ($page['type'] == PAGE_TYPE_JS && $result) {
            echo 'switchElementClass("addrm_fav", "iconminus", "iconplus");';
        }
    }
}
if (!empty($_REQUEST['period']) || !empty($_REQUEST['stime'])) {
    CScreenBase::calculateTime(array('profileIdx' => 'web.screens', 'profileIdx2' => $pageFilter->graphid, 'updateProfile' => true, 'period' => getRequest('period'), 'stime' => getRequest('stime')));
    $curl = new CUrl();
    $curl->removeArgument('period');
    $curl->removeArgument('stime');
    ob_end_clean();
    DBstart();
    CProfile::flush();
    DBend();
    redirect($curl->getUrl());
}
ob_end_flush();
if ($page['type'] == PAGE_TYPE_JS || $page['type'] == PAGE_TYPE_HTML_BLOCK) {
    require_once dirname(__FILE__) . '/include/page_footer.php';
    exit;
}
/*
 * Display
 */