Esempio n. 1
0
function Array_Cut(&$What, $Whom, $IsFull = FALSE)
{
    /****************************************************************************/
    $__args_types = array('array', 'array', 'boolean');
    #-----------------------------------------------------------------------------
    $__args__ = Func_Get_Args();
    eval(FUNCTION_INIT);
    /****************************************************************************/
    foreach (Array_Keys($Whom) as $Key) {
        #---------------------------------------------------------------------------
        if (isset($What[$Key])) {
            #-------------------------------------------------------------------------
            $ElementA =& $What[$Key];
            $ElementB = $Whom[$Key];
            #-------------------------------------------------------------------------
            if (Is_Array($ElementA) && Is_Array($ElementB)) {
                #-----------------------------------------------------------------------
                Array_Cut($ElementA, $ElementB, $IsFull);
                #-----------------------------------------------------------------------
                if ($IsFull && !Count($ElementA)) {
                    unset($What[$Key]);
                }
            } else {
                unset($What[$Key]);
            }
        }
    }
}
Esempio n. 2
0
$Template = System_XML('tables/Common.xml');
if (Is_Error($Template)) {
    return ERROR | @Trigger_Error(500);
}
foreach ($Chain as $Pattern) {
    if (isset($Pattern['Cut'])) {
        Array_Cut($Template, $Pattern['Cut']);
    }
    Array_Union($Template, $Pattern);
}
$Columns =& $Template['Columns'];
foreach (Array_Keys($Columns) as $ColumnID) {
    $Column = $Template['Column'];
    $Add = $Column['Add'];
    if (isset($Column['Cut'])) {
        Array_Cut($Add, $Column['Cut']);
    }
    Array_Union($Add, $Columns[$ColumnID]);
    $Columns[$ColumnID] = $Add;
}
$Query =& $Template['Query'];
$Args =& Args();
$IsFlush = isset($Args['IsFlush']) && (int) $Args['IsFlush'];
if ($IsFlush) {
    $Args = array();
}
$Session = new Session(isset($_COOKIE['SessionID']) ? (string) $_COOKIE['SessionID'] : UniqID());
$IsSession = $Session->Load();
if (!Is_Error($IsSession) && $Template['IsSession']) {
    $KeyID = Md5($TemplateID);
    if (isset($Session->Data[$KeyID]) && !$IsFlush) {