示例#1
0
/******************************************************************************/
$List = array();
#-------------------------------------------------------------------------------
$Loaded =& Link_Get('Css', 'array');
#-------------------------------------------------------------------------------
foreach ($Css as $Path) {
    #-----------------------------------------------------------------------------
    $Path = SPrintF('Css/%s.css', $Path);
    #-----------------------------------------------------------------------------
    $CacheID = $Path;
    #-------------------------------------------------------------------------------
    if (In_Array($CacheID, $Loaded)) {
        continue;
    }
    #-----------------------------------------------------------------------------
    $HostsIDs = Styles_HostsIDs($Path);
    if (Is_Error($HostsIDs)) {
        return ERROR | @Trigger_Error(500);
    }
    #-----------------------------------------------------------------------------
    foreach (Array_Reverse($HostsIDs) as $HostID) {
        #---------------------------------------------------------------------------
        $Link = new Tag('LINK', array('href' => SPrintF('/styles/%s/%s', $HostID, $Path), 'rel' => 'stylesheet', 'type' => 'text/css'));
        #---------------------------------------------------------------------------
        $List[] = $Link;
    }
    #-----------------------------------------------------------------------------
    $Loaded[] = $CacheID;
}
#-------------------------------------------------------------------------------
return $List;
示例#2
0
function Styles_Url($Element)
{
    /****************************************************************************/
    $__args_types = array('string');
    #-----------------------------------------------------------------------------
    $__args__ = Func_Get_Args();
    eval(FUNCTION_INIT);
    /****************************************************************************/
    $HostsIDs = Styles_HostsIDs($Element);
    if (Is_Error($HostsIDs)) {
        return ERROR | @Trigger_Error('[Styles_Url]: список хостов содержащих элемент не найдены');
    }
    #-----------------------------------------------------------------------------
    $HostID = Current($HostsIDs);
    #-----------------------------------------------------------------------------
    return SPrintF('%s://%s/styles/%s/%s', Url_Scheme(), @$_SERVER['HTTP_HOST'], $HostID, $Element);
    #return SPrintF('/styles/%s/%s',$HostID,$Element);
}