예제 #1
0
파일: pages.php 프로젝트: ssrsfs/blg
    } else {
        $rules = 'url:*';
    }
    $plug_loc = Model_PlugLoc::Get($_POST['locid']);
    $plug_loc->set('rules', $rules);
    $plug_loc->save();
    Typeframe::Redirect('Plugin location updated.', Typeframe::CurrentPage()->applicationUri() . '?skin=' . $row['skin']);
    return;
}
// add plugin location to template
$pm->setVariable('plugin', $plug_loc);
// define enterprise children, root
if (TYPEF_ENT) {
    $children = TypeframeEnterpriseChild::DAOFactory();
    $children = $children->getAll();
    array_unshift($children, TypeframeEnterprise::GetChild(0));
    // add to template
    foreach ($children as $child) {
        $pm->addLoop('children', array('id' => $child->get('id'), 'name' => TYPEF_ENT_CHILD_NAME . ' ' . $child->get('childname')));
    }
}
// break down rules; add to template
$rules = explode(';', $plug_loc->get('rules'));
foreach ($rules as $rule) {
    list($type, $code) = explode(':', $rule);
    if (substr($type, 0, 1) == '!') {
        $desc = 'Exclude from ';
        $type = substr($type, 1);
    } else {
        $desc = 'Include on';
    }