<?php /** * Change the order of plugins in a socket. */ $typef_app_dir = Typeframe::CurrentPage()->applicationUri(); if ($_SERVER['REQUEST_METHOD'] == 'POST') { if (!isset($_POST['locid']) || !is_array($_POST['locid'])) { Typeframe::Redirect('Invalid socket plugin ids.', $typef_app_dir); } else { $sortnum = 1; foreach ($_POST['locid'] as $locid) { $plugloc = Model_PlugLoc::Get($locid); $plugloc->set('sortnum', $sortnum); $plugloc->save(); ++$sortnum; } Typeframe::Redirect('Plugins sorted.', $typef_app_dir); } } else { Typeframe::Redirect('Nothing to do.', $typef_app_dir); }
$rules = ''; if (empty($_POST['allpages']) && isset($_POST['rules'])) { $allExcludes = true; foreach ($_POST['rules'] as $rule) { if (substr($rule, 0, 1) != '!') { $allExcludes = false; } } $rules = implode(';', $_POST['rules']); if ($allExcludes) { $rules = "url:*;{$rules}"; } } 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')));