Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Panel Order with Vanilla 1.1.10
Anyone have Vanilla 1.1.10 with Panel Order extension working? If so can you please post the code or what you adjusted to get it working? Thanks!
0
Comments
function PanelReOrder(&$Context) {
$this->Name = 'PanelReOrder';
$this->ValidActions = array('PanelReOrder');
$this->Constructor($Context);
if ($this->IsPostBack) {
$Context->PageTitle = $this->Context->GetDefinition('PanelReOrder');
if ($this->PostBackAction == 'PanelReOrder') {
// Add the javascript to the head for sorting categories
global $Head;
$Head->AddScript('js/prototype.js');
$Head->AddScript('js/scriptaculous.js');
if (!file_exists($Context->Configuration['EXTENSIONS_PATH'].'PanelOrder/panelextensions.ini')) {
$panelextensions = fopen($Context->Configuration['EXTENSIONS_PATH'].'PanelOrder/panelextensions.ini','w+');
fwrite($panelextensions,"[PanelOrder]\r\n");
} else {
$panelextensions = fopen($Context->Configuration['EXTENSIONS_PATH'].'PanelOrder/panelextensions.ini','a');
}
$enabledextensions = file($Context->Configuration['APPLICATION_PATH'].'/conf/extensions.php');
foreach ($enabledextensions as $ext_num => $currentextension) {
if (strstr($currentextension, "include")) {
$panelarray = parse_ini_file($Context->Configuration['EXTENSIONS_PATH'].'PanelOrder/panelextensions.ini');
$panelnumber = count($panelarray);
$currentextensionarray = explode('"', $currentextension);
$extensionfile = $currentextensionarray[1];
if ($extensionfile != "PanelOrder/default.php") {
$fullextensionpath = $Context->Configuration['EXTENSIONS_PATH'].$extensionfile;
if (!is_int(array_search($fullextensionpath, $panelarray))) {
$currentextensioncontents = file($fullextensionpath);
foreach ($currentextensioncontents as $line_num => $line) {
if (strstr($line,"\$Panel->AddString(") || strstr($line,"\$Panel->AddList(")) {
fwrite($panelextensions,$panelnumber."=".$fullextensionpath."\r\n");
break;
}
}
}
}
}
}
fclose($panelextensions);
$panelarray = parse_ini_file($Context->Configuration['EXTENSIONS_PATH'].'PanelOrder/panelextensions.ini');
$panelnumber = count($panelarray);
$neworder = "[PanelOrder]\r\n";
$n = 0;
for ($i = 0;$i < $panelnumber;$i++) {
$found = false;
$x = $i - $n;
$explode = explode($Context->Configuration['EXTENSIONS_PATH'],$panelarray[$i]);
$search = 'include($Configuration[\'EXTENSIONS_PATH\']."'.$explode[1].'");'."\r\n";
foreach($enabledextensions as $anext) {
if(strstr($anext,$explode[1])) {
$found = true;
}
}
if ($found) {
$neworder .= $x."=".$panelarray[$i]."\r\n";
} else {
$n++;
}
}
$rewritefile = fopen($Context->Configuration['EXTENSIONS_PATH'].'PanelOrder/panelextensions.ini', 'w+');
fwrite($rewritefile,$neworder);
fclose($rewritefile);
}
}
}
I can drag the boxes around just fine, and they remember where they were put, but it still just seems to keep my extension options in alphabetical order.
Lines 65-74