$template = TYPEF_SOURCE_DIR . '/templates/content/' . (!empty($settings['template']) ? $settings['template'] : 'generic.html'); if (!file_exists($template)) { $page->set('dead_template', $settings['template']); $template = (TYPEF_SOURCE_DIR . '/templates/content/generic.html'); } $elements = Insertable::ElementsFrom($template); $groups = Insertable::GroupsFrom($template); if ((count($elements) > 0) || (count($groups) > 0)) { $garray = array(); foreach ($groups as $group) { if (empty($group['admin']) || (Typeframe::User()->get('usergroupid') == TYPEF_ADMIN_USERGROUPID) || inGroup($group['admin'])) $garray[] = $group; } $page->set('groups', $garray); $pm->addLoop('pages', $page->getAsArray()); } }*/ $pm->setVariable('pages', $pages); // add plugins $plugs = new Model_Plug(); //$plugs->where('plug = ?', 'Content'); $plugs->where('siteid = ?', Typeframe::CurrentPage()->siteid()); $plugs->order('name'); $pm->setVariable('plugins', $plugs); /*$all_pages = new Model_Page(); $all_pages->where('siteid = ?', Typeframe::CurrentPage()->siteid()); $all_pages->order('nickname, uri'); $pm->setVariable('all_pages', $all_pages);*/
<?php /** * Typeframe Plugin application * * admin index controller */ // load plugins; add to template $plugins = new Model_Plug(); $plugins->order('name, plug, plugid'); $plugins->where('siteid = ?', Typeframe::CurrentPage()->siteid()); $pm->setVariable('plugins', $plugins); // add skins to template $skins = array(); foreach (glob(TYPEF_DIR . '/skins/*', GLOB_ONLYDIR) as $directory) { $skins[] = basename($directory); } $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());