本文整理汇总了PHP中ActionController类的典型用法代码示例。如果您正苦于以下问题:PHP ActionController类的具体用法?PHP ActionController怎么用?PHP ActionController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ActionController类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_post_action_creates_action
public function test_post_action_creates_action()
{
$this->mySetup(__DIR__ . "/basic_action_table.xml");
$new_data = ["name" => "derp", "description" => "pred"];
$controller = new ActionController([], Response::REQUEST_METHOD_POST, $new_data);
$response = $controller->getResponse();
self::assertIsValidResponse($response, Response::STATUS_CODE_CREATED);
self::assertIsCorrectResponseData($response->getBody(), $new_data);
}
示例2: close_round
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function close_round()
{
//
if (Session::has('admin')) {
DB::table('rounds')->where('idgame', '=', Input::get('game'))->where('status', '=', 0)->update(array('status' => 1));
$ActionController = new ActionController();
$ActionController->order_actions();
$ActionController->execute_actions();
return Response::json(array('output' => 'closed'));
} else {
return Response::json(array('output' => 'not admin'));
}
}
示例3: dispatch
/**
* Framework entry point
*
* @return void.
*/
public function dispatch()
{
include_once 'action/controller/http/HTTPResponse.php';
include_once 'action/controller/http/HTTPRequest.php';
$request = new HTTPRequest();
$response = new HTTPResponse();
try {
$configurator = $this->manager->getConfigurator();
Registry::put($configurator, '__configurator');
Registry::put($logger = new Logger($configurator), '__logger');
$ap = $configurator->getApplicationPath();
// application path
$an = $configurator->getApplicationName();
// application name
$logger->debug('[Medick] >> version: ' . Medick::getVersion() . ' ready for ' . $an);
$logger->debug('[Medick] >> Application path ' . $ap);
$routes_path = $ap . DIRECTORY_SEPARATOR . 'conf' . DIRECTORY_SEPARATOR . $an . '.routes.php';
include_once $routes_path;
// load routes
$logger->debug('[Medick] >> Config File: ' . str_replace($ap, '${' . $an . '}', $configurator->getConfigFile()));
$logger->debug('[Medick] >> Routes loaded from: ' . str_replace($ap, '${' . $an . '}', $routes_path));
ActionControllerRouting::recognize($request)->process($request, $response)->dump();
} catch (Exception $ex) {
ActionController::process_with_exception($request, $response, $ex)->dump();
$logger->warn($ex->getMessage());
}
}
示例4: set_actions
function set_actions()
{
$actions = array_filter(func_get_args());
if (count($actions) === 1 && is_array($actions[0])) {
$actions = $actions[0];
}
ActionController::$actions = array_merge(ActionController::$actions, $actions);
}
示例5: __construct
public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
{
parent::__construct($po_request, $po_response, $pa_view_paths);
if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn() || $this->request->config->get('show_bristol_only') && !$this->request->isLoggedIn()) {
$this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "form"));
}
}
示例6: __construct
public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
{
parent::__construct($po_request, $po_response, $pa_view_paths);
$this->opo_datamodel = Datamodel::load();
$this->opo_app_plugin_manager = new ApplicationPluginManager();
$this->opo_result_context = new ResultContext($po_request, $this->ops_table_name, ResultContext::getLastFind($po_request, $this->ops_table_name));
}
示例7: __construct
public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
{
$this->ops_theme = __CA_THEME__;
// get current theme
if (!is_dir(__CA_APP_DIR__ . '/plugins/eastend/themes/' . $this->ops_theme . '/views')) {
// if theme is not defined for this plugin, try to use "default" theme
$this->ops_theme = 'default';
}
parent::__construct($po_request, $po_response, array(__CA_APP_DIR__ . '/plugins/eastend/themes/' . $this->ops_theme . '/views'));
MetaTagManager::addLink('stylesheet', $po_request->getBaseUrlPath() . "/app/plugins/eastend/themes/" . $this->ops_theme . "/css/eastend.css", 'text/css');
$this->opo_plugin_config = Configuration::load($this->request->getAppConfig()->get('application_plugins') . '/eastend/conf/eastend.conf');
if (!(bool) $this->opo_plugin_config->get('enabled')) {
die(_t('eastend plugin is not enabled'));
}
// redirect user if not logged in
if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn()) {
$this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "form"));
}
if ($this->request->config->get("dont_enforce_access_settings")) {
$this->opa_access_values = array();
} else {
$this->opa_access_values = caGetUserAccessValues($this->request);
}
$this->view->setVar('access_values', $va_access_values);
$this->opo_result_context = new ResultContext($po_request, 'ca_objects', ResultContext::getLastFind($po_request, 'ca_objects'));
JavascriptLoadManager::register('cycle');
}
示例8: __construct
public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
{
$this->ops_theme = __CA_THEME__;
// get current theme
if (!is_dir(__CA_APP_DIR__ . '/plugins/MetabolicChronology/themes/' . $this->ops_theme . '/views')) {
// if theme is not defined for this plugin, try to use "default" theme
$this->ops_theme = 'default';
}
parent::__construct($po_request, $po_response, array(__CA_APP_DIR__ . '/plugins/MetabolicChronology/themes/' . $this->ops_theme . '/views'));
$this->opo_plugin_config = Configuration::load($this->request->getAppConfig()->get('application_plugins') . '/MetabolicChronology/conf/Chronology.conf');
if (!(bool) $this->opo_plugin_config->get('enabled')) {
die(_t('Metabolic Chronology plugin is not enabled'));
}
$this->_initView($pa_options);
$this->opo_result_context = new ResultContext($po_request, 'ca_objects', 'MetabolicChronology');
MetaTagManager::addLink('stylesheet', $po_request->getBaseUrlPath() . "/app/plugins/MetabolicChronology/themes/" . $this->ops_theme . "/css/chronology.css", 'text/css');
JavascriptLoadManager::register('jcarousel');
JavascriptLoadManager::register('maps');
$t_list = new ca_lists();
$this->opn_silo_type_id = $t_list->getItemIDFromList('collection_types', 'silo');
$this->opn_action_type_id = $t_list->getItemIDFromList('occurrence_types', 'action');
$this->opn_context_type_id = $t_list->getItemIDFromList('occurrence_types', 'context');
$this->opn_yes_list_id = $t_list->getItemIDFromList('yes_no', 'yes');
$t_relationship_types = new ca_relationship_types();
$this->opn_rel_type_action_display_image = $t_relationship_types->getRelationshipTypeID("ca_objects_x_occurrences", "display");
$this->opn_rel_type_action_secondary_images = $t_relationship_types->getRelationshipTypeID("ca_objects_x_occurrences", "secondary");
$va_access_values = caGetUserAccessValues($this->request);
$this->opa_access_values = $va_access_values;
$this->view->setVar('access_values', $va_access_values);
}
示例9: __construct
public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
{
parent::__construct($po_request, $po_response, $pa_view_paths);
// Reload user preferences config to reflect current user locale. Initial load of config file is prior to setting of preferred locale
// (which requires loading of user preferences...) and does not reflect user's preferred language.
$this->request->user->loadUserPrefDefs(true);
}
示例10: __construct
public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
{
$this->ops_theme = __CA_THEME__;
// get current theme
if (!is_dir(__CA_APP_DIR__ . '/plugins/NovaMuse/themes/' . $this->ops_theme . '/views')) {
// if theme is not defined for this plugin, try to use "default" theme
$this->ops_theme = 'default';
}
parent::__construct($po_request, $po_response, array(__CA_APP_DIR__ . '/plugins/NovaMuse/themes/' . $this->ops_theme . '/views'));
$this->opo_plugin_config = Configuration::load($this->request->getAppConfig()->get('application_plugins') . '/NovaMuse/conf/NovaMuse.conf');
if (!(bool) $this->opo_plugin_config->get('enabled')) {
die(_t('NovaMuse plugin is not enabled'));
}
MetaTagManager::addLink('stylesheet', $po_request->getBaseUrlPath() . "/app/plugins/NovaMuse/themes/" . $this->ops_theme . "/css/dashboard.css", 'text/css');
$this->opo_result_context = new ResultContext($po_request, 'ca_objects', 'dashboard');
$t_list = new ca_lists();
$this->opn_member_institution_id = $t_list->getItemIDFromList('entity_types', 'member_institution');
$this->opn_individual_id = $t_list->getItemIDFromList('entity_types', 'ind');
$this->opn_family_id = $t_list->getItemIDFromList('entity_types', 'fam');
$this->opn_organization_id = $t_list->getItemIDFromList('entity_types', 'org');
$t_object = new ca_objects();
$this->opn_objectTableNum = $t_object->tableNum();
$va_access_values = caGetUserAccessValues($this->request);
$this->opa_access_values = $va_access_values;
$this->view->setVar('access_values', $va_access_values);
}
示例11: init
public function init()
{
parent::init();
$tabs = $this->getTabs();
$type = $this->getType();
if (in_array(ucfirst($type), $this->globalTypes)) {
$ltype = strtolower($type);
$tabs->add('overview', array('url' => 'director', 'label' => $this->translate('Overview')));
foreach ($this->globalTypes as $tabType) {
$ltabType = strtolower($tabType);
$tabs->add($ltabType, array('label' => $this->translate(ucfirst($ltabType) . 's'), 'url' => sprintf('director/%ss', $ltabType)));
}
$tabs->activate($ltype);
return;
}
$object = $this->dummyObject();
if ($object->isGroup()) {
$type = substr($type, 0, -5);
}
$tabs = $this->getTabs()->add('objects', array('url' => sprintf('director/%ss', strtolower($type)), 'label' => $this->translate(ucfirst($type) . 's')));
if ($object->supportsGroups() || $object->isGroup()) {
$tabs->add('objectgroups', array('url' => sprintf('director/%sgroups', $type), 'label' => $this->translate('Groups')));
}
$tabs->add('tree', array('url' => sprintf('director/%ss/templatetree', $type), 'label' => $this->translate('Tree')));
}
示例12: __construct
public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
{
parent::__construct($po_request, $po_response, $pa_view_paths);
if (!$this->request->isLoggedIn()) {
$this->response->setRedirect($this->request->config->get('error_display_url') . '/n/2320?r=' . urlencode($this->request->getFullUrlPath()));
return;
}
}
示例13: __construct
public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
{
parent::__construct($po_request, $po_response, $pa_view_paths);
//if (!$this->request->isLoggedIn() || !$this->request->user->canDoAction('can_do_search_reindex')) {
// $this->response->setRedirect($this->request->config->get('error_display_url').'/n/2320?r='.urlencode($this->request->getFullUrlPath()));
// return;
//}
}
示例14: __construct
public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
{
parent::__construct($po_request, $po_response, $pa_view_paths);
if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn()) {
$this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "LoginForm"));
}
caSetPageCSSClasses(array("staticPage"));
}
示例15: __construct
public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
{
parent::__construct($po_request, $po_response, $pa_view_paths);
$this->opo_client_services_config = Configuration::load($this->request->config->get('client_services_config'));
$this->view->setVar('client_services_config', $this->opo_client_services_config);
JavascriptLoadManager::register("panel");
JavascriptLoadManager::register('cycle');
JavascriptLoadManager::register('bundleableEditor');
}