<?php
namespace wcf\system\package\plugin;
+use wcf\system\exception\SystemException;
/**
* Installs, updates and deletes page page menu items.
// position
$result['menuPosition'] = (!empty($data['elements']['position']) && $data['elements']['position'] == 'footer') ? 'footer' : 'header';
+
+ // controller
+ $result['menuItemController'] = (isset($data['elements']['controller'])) ? $data['elements']['controller'] : '';
+
// class name
if (!empty($data['elements']['classname'])) {
$result['className'] = $data['elements']['classname'];
}
+ // validate controller and link (cannot be empty at the same time)
+ if (empty($result['menuItemLink']) && empty($result['menuItemController'])) {
+ throw new SystemException("Menu item '".$result['menuItem']."' neither has a link nor a controller given");
+ }
+
return $result;
}
}
packageID INT(10) NOT NULL,
menuItem VARCHAR(255) NOT NULL DEFAULT '',
parentMenuItem VARCHAR(255) NOT NULL DEFAULT '',
+ menuItemController VARCHAR(255) NOT NULL DEFAULT '',
menuItemLink VARCHAR(255) NOT NULL DEFAULT '',
menuPosition ENUM('header', 'footer') NOT NULL DEFAULT 'header',
showOrder INT(10) NOT NULL DEFAULT 0,