本文整理汇总了PHP中Box::addOption方法的典型用法代码示例。如果您正苦于以下问题:PHP Box::addOption方法的具体用法?PHP Box::addOption怎么用?PHP Box::addOption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Box
的用法示例。
在下文中一共展示了Box::addOption方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: menu
/**
* Build the menu.
* Additional options that have been set are added to the menu.
*/
function menu()
{
$menubox = new Box("Menu");
$menubox->setIcon("menu-item.gif");
foreach ($this->menuOptions as $options) {
if (isset($options[2])) {
$menubox->addOption($options[0], $options[1], $options[2]);
} else {
$menubox->addOption($options[0], $options[1]);
}
}
return $menubox->generate();
}
示例2: menu
/**
* Generates the menu for the user
* @return string
*/
public static function menu()
{
$box = new Box('User');
$box->setIcon('menu-item.gif');
if (!user::loggedin()) {
$box->addOption('link', 'Login', edkURI::build(array('a', 'login', true)));
$box->addOption('link', 'Register', edkURI::build(array('a', 'register', true)));
} else {
if (user::get('usr_pilot_id')) {
$plt = Pilot::getByID((int) user::get('usr_pilot_id'));
$box->addOption('link', $plt->getName(), edkURI::build(array('a', 'pilot_detail', true), array('plt_id', $plt->getID(), true)));
}
$box->addOption('link', 'Logout', edkURI::build(array('a', 'logout', true)));
}
event::call('user_menu_create', $box);
return $box->generate();
}
示例3: map
/**
* Returns HTML for the map where this kill took place
*
* @return string HTML for the map where this kill took place
*/
function map()
{
//Admin is able to see classsified systems
if (!$this->kill->isClassified() || $this->page->isAdmin()) {
$mapbox = new Box("Map");
if (IS_IGB) {
$mapbox->addOption("img", imageURL::getURL('map', $this->kill->getSystem()->getID(), 145), "javascript:CCPEVE.showInfo(3, " . $this->kill->getSystem()->getRegionID() . ")");
$mapbox->addOption("img", imageURL::getURL('region', $this->kill->getSystem()->getID(), 145), "javascript:CCPEVE.showInfo(4, " . $this->kill->getSystem()->getConstellationID() . ")");
$mapbox->addOption("img", imageURL::getURL('cons', $this->kill->getSystem()->getID(), 145), "javascript:CCPEVE.showInfo(5, " . $this->kill->getSystem()->getExternalID() . ")");
} else {
$mapbox->addOption("img", imageURL::getURL('map', $this->kill->getSystem()->getID(), 145));
$mapbox->addOption("img", imageURL::getURL('region', $this->kill->getSystem()->getID(), 145));
$mapbox->addOption("img", imageURL::getURL('cons', $this->kill->getSystem()->getID(), 145));
}
return $mapbox->generate();
}
return '';
}
示例4: points
function points()
{
$html = '';
if (config::get('kill_points') && !empty($this->points)) {
$scorebox = new Box("Kill points");
$scorebox->addOption("points", $this->points);
$html .= $scorebox->generate();
}
if (config::get('loss_points') && !empty($this->lpoints)) {
$scorebox = new Box("Loss points");
$scorebox->addOption("points", $this->lpoints);
$html .= $scorebox->generate();
}
if (config::get('total_points') && !empty($this->lpoints)) {
$scorebox = new Box("Total points");
$scorebox->addOption("points", $this->points - $this->lpoints);
$html .= $scorebox->generate();
}
return $html;
}
示例5: genAdminMenu
/**
* Generate admin menu.
*
* @return string HTML for a menu of admin links.
*/
public static function genAdminMenu()
{
// sort the menu alphabetically
ksort(self::$data);
// create a standardbox to print all links into
$menubox = new Box('Options');
$menubox->setIcon('menu-item.gif');
foreach (self::$data as $field => $subfields) {
$menubox->addOption('caption', $field);
foreach ($subfields as $subfield => $array) {
// if this subfield has no options then it is a category
if (!is_array($array)) {
$menubox->addOption('link', $subfield, $array);
continue;
}
// we're not a category, make it clickable
$menubox->addOption('link', $subfield, edkURI::build(array(array('a', 'admin', true), array('field', urlencode($field), true), array('sub', urlencode($subfield), true))));
}
$lastfield = $field;
}
return $menubox->generate();
}