示例#1
0
文件: url.lib.php 项目: rhertzog/lcs
 /**
  * Relay Claroline current Url context in urls
  * @return $this
  */
 public function relayCurrentContext()
 {
     /* $context = Claro_Context::getCurrentUrlContext();
             
             if ( array_key_exists( 'cid', $context )
                 && ! array_key_exists( 'cidReq', $context ) )
             {
                 $context['cidReq'] = $context['cid'];
                 unset( $context['cid'] );
             }
     
             if ( array_key_exists( 'gid', $context )
                 && ! array_key_exists( 'gidReq', $context ) )
             {
                 $context['gidReq'] = $context['gid'];
                 unset( $context['gid'] );
             } */
     $this->addParamList(Claro_Context::getCurrentUrlContext());
     return $this;
 }
示例#2
0
/**
 * Get the string needed to relay the current context in urls
 * @param string $prepend string to prepend to the relayed context
 * @param array $context
 * @return string
 * @deprecated since 1.9 use Url::Contextualize instead
 */
function claro_url_relay_context($prepend = '', $context = null)
{
    if (is_null($context)) {
        $context = Claro_Context::getCurrentUrlContext();
    }
    if (array_key_exists('cid', $context) && !array_key_exists('cidReq', $context)) {
        $context['cidReq'] = $context['cid'];
        unset($context['cid']);
    }
    if (array_key_exists('gid', $context) && !array_key_exists('gidReq', $context)) {
        $context['gidReq'] = $context['gid'];
        unset($context['gid']);
    }
    if (count($context) > 0) {
        return $prepend . http_build_query($context);
    } else {
        return '';
    }
}