Ejemplo n.º 1
0
 private static function _GetPluginsFor($for)
 {
     $locs = new Model_PlugLoc();
     $locs->where('skin = ?', Typeframe_Skin::Current());
     $locs->where('socket = ?', $for);
     $locs->where('plugin.siteid = ?', Typeframe::CurrentPage()->siteid());
     $locs->order('sortnum');
     $result = array();
     foreach ($locs->select() as $loc) {
         $show = true;
         if ($loc['rules']) {
             $show = self::ProcessRules($loc['rules']);
         }
         if ($show) {
             $plug = $loc['plugin'];
             $result[] = $plug;
         }
     }
     return $result;
 }
Ejemplo n.º 2
0
Archivo: index.php Proyecto: ssrsfs/blg
}
$pm->setVariable('skins', $skins);
// set skin; add to template
$skin = trim(@$_REQUEST['skin']);
$skin = strlen($skin) > 0 ? $_REQUEST['skin'] : (TYPEF_SITE_SKIN ? TYPEF_SITE_SKIN : 'default');
if (!in_array($skin, $skins)) {
    Typeframe::Redirect("'{$skin}' was not found in the skins directory.", TYPEF_WEB_DIR . '/admin/skins');
    return;
}
$pm->setVariable('skin', $skin);
// load sockets
$plugins = array();
$sockets = new Model_PlugLoc();
$sockets->where('skin = ?', $skin);
$sockets->where('plugin.siteid = ?', Typeframe::CurrentPage()->siteid());
$sockets->order('socket, sortnum');
foreach ($sockets->getAll() as $socket) {
    if (!isset($plugins[$socket->get('socket')])) {
        $plugins[$socket->get('socket')] = array();
    }
    $plugins[$socket->get('socket')][] = $socket;
}
// define skin file
$skinfile = TYPEF_DIR . '/skins/' . $skin . '/skin.html';
if (!file_exists($skinfile)) {
    $skinfile = TYPEF_DIR . '/skins/default/skin.html';
}
// load sockets for skin file
$source = file_get_contents($skinfile);
foreach (get_html_translation_table() as $character => $entity) {
    if ($entity != '&' && $entity != '"' && $entity != '>' && $entity != '<') {