/** * * @return Ultimatum_Model_Ultplayergroupordertypes */ public static function getInstance() { if ($pReload || is_null(self::$_Instance)) { // process self::$_Instance = new self(); } return self::$_Instance; }
/** * */ public function run() { $c = $this->get_controller(); if (!$c->_prep()) { return $c->forward('index', 'index', NULL, array('error' => 'problem loading game')); } elseif (!($target = $c->view->target)) { $params = array('error' => 'Cannot find target'); return $c->forward('run', NULL, NULL, $params); } $c->view->orders = Ultimatum_Model_Ultplayergroupordertypes::get_by_type(Ultimatum_Model_Ultplayergroupordertypes::TARGET_TYPE_OTHER, Ultimatum_Model_Ultplayergroupordertypes::TARGET_TYPE_BOTH); $c->_draw_network(); }
public function run() { $c = $this->get_controller(); if (!$c->_prep()) { return $this->forward('index', 'index', NULL, array('error' => 'problem loading game')); } elseif (!$this->view()->player_group) { $params = array('error' => 'Cannot load group'); return $this->_forward('run', NULL, NULL, $params); } $this->_draw_network(); $order = $this->_getParam("order", NULL); $this->view()->order_type = Ultimatum_Model_Ultplayergroupordertypes::getInstance()->get($order); }
/** * * @param boolean $pReload * @return Ultimatum_Model_Ultplayergroupordertypes */ function order_type($pReload = FALSE) { if ($pReload || is_null($this->_order_type)) { $value = Ultimatum_Model_Ultplayergroupordertypes::getInstance()->get($this->type); // process $this->_order_type = $value; } return $this->_order_type; }
/** * @param boolean $pChange_to * @return NULL * * */ public function _change_ota($pChange_to) { $ot = Ultimatum_Model_Ultplayergroupordertypes::getInstance()->get($name = $this->_getParam('name')); if ($ot->isSaved()) { $ot->active = $pChange_to ? 1 : 0; $ot->save(); $params = array('message' => $ot->title . ' active set to ' . ($pChange_to ? 'TRUE' : 'FALSE')); } else { $params = array('error' => "no action {$name} found"); } $this->_forward('ordertypes', NULL, NULL, $params); }
/** * * @param $pPlayer_group * @return string */ public function playergroup(Ultimatum_Model_Ultgamegroups $pPlayer_group, $pContent = NULL) { $this->view->headLink()->appendStylesheet($this->view->baseUrl() . '/style/ultimatum/ult_style.css'); $po = $pPlayer_group->pending_orders(); $group = $pPlayer_group->get_group(); ob_start(); ?> <fieldset class="ult_groupinfo"> <legend>Group <?php echo $group->get_title(); ?> </legend> <?php echo $this->view->powerMatrix($group); ?> <p><b><?php echo $group->get_lead(); ?> </b>: <?php echo $group->get_content(); ?> </p> <?php if ($pContent) { echo $pContent; } else { ?> <?php if ($po && count($po)) { ?> <h3>Pending Orders</h3> <ol> <?php foreach ($po as $o) { ?> <li><?php echo $o; ?> <?php echo $o->cancel_link(); ?> </li> <?php } ?> </ol> <?php } ?> <h3>Command Group</h3> <ul> <?php $params = array('active' => 1); foreach (Ultimatum_Model_Ultplayergroupordertypes::getInstance()->find($params) as $ot) { ?> <li><a class="linkbutton" href="/ultimatum/game/order/group/<?php echo $group->identity(); ?> /order/<?php echo $ot->identity(); ?> /"><?php echo $ot; ?> </a> <?php echo $ot->get_lead(); ?> <?php } ?> </ul> <?php } ?> </fieldset> <?php return ob_get_clean(); }