@Config\Route("/internal_link/form", name="open_orchestra_backoffice_internal_link_form")

@return Response
191613
public function formAction(Request $request)
    {
        $option = array('action' => $this->generateUrl('open_orchestra_backoffice_internal_link_form'));

        $option["method"] = "POST";
        if ("PATCH" === $request->getMethod()) {
            $option["validation_groups"] = false;
            $option["method"] = "PATCH";
        }
        $form = $this->createForm(
            'oo_internal_link',
            $request->query->all(),
            $option
        );

        $form->handleRequest($request);

        return $this->renderAdminForm($form);
    }
896596
public function map()
    {
        Route::namespace($this->namespace)->group(function (Router $router) {
            /*
             * Admin routes
             */
            $router->middleware('admin')->prefix('admin')->group(function (Router $router) {
                $router->get('menus', 'AdminController@index')->name('admin::index-menus')->middleware('can:see-all-menus');
                $router->get('menus/create', 'AdminController@create')->name('admin::create-menu')->middleware('can:create-menu');
                $router->get('menus/{menu}/edit', 'AdminController@edit')->name('admin::edit-menu')->middleware('can:update-menu');
                $router->post('menus', 'AdminController@store')->name('admin::store-menu')->middleware('can:create-menu');
                $router->put('menus/{menu}', 'AdminController@update')->name('admin::update-menu')->middleware('can:update-menu');

                $router->get('menus/{menu}/menulinks/create', 'MenulinksAdminController@create')->name('admin::create-menulink')->middleware('can:create-menu');
                $router->get('menus/{menu}/menulinks/{menulink}/edit', 'MenulinksAdminController@edit')->name('admin::edit-menulink')->middleware('can:update-menu');
                $router->post('menus/{menu}/menulinks', 'MenulinksAdminController@store')->name('admin::store-menulink')->middleware('can:create-menu');
                $router->put('menus/{menu}/menulinks/{menulink}', 'MenulinksAdminController@update')->name('admin::update-menulink')->middleware('can:update-menu');
            });

            /*
             * API routes
             */
            $router->middleware('api')->prefix('api')->group(function (Router $router) {
                $router->middleware('auth:api')->group(function (Router $router) {
                    $router->get('menus', 'ApiController@index')->middleware('can:see-all-menus');
                    $router->patch('menus/{menu}', 'ApiController@updatePartial')->middleware('can:update-menu');
                    $router->delete('menus/{menu}', 'ApiController@destroy')->middleware('can:delete-menu');

                    $router->get('menus/{menu}/menulinks', 'MenulinksApiController@index')->middleware('can:see-all-menus');
                    $router->patch('menus/{menu}/menulinks/{menulink}', 'MenulinksApiController@updatePartial')->middleware('can:update-menu');
                    $router->post('menus/{menu}/menulinks/sort', 'MenulinksApiController@sort')->middleware('can:update-menu');
                    $router->delete('menus/{menu}/menulinks/{menulink}', 'MenulinksApiController@destroy')->middleware('can:delete-menu');
                });
            });
        });
    }
85286
final protected function url() {
		$isBackend = df_fe_fc_b($this, 'dfWebhook_backend'); /** @var bool $isBackend */
		$route = df_route($this->m(), df_fe_fc($this, 'dfWebhook_suffix'), $isBackend); /** @var string $route */
		return $isBackend ? df_url_backend_ns($route) : df_url_frontend($route);
	}
927693
public function mapBackendRoutes()
    {
        $directory = __DIR__.'/../../routes/backend';
        if(is_dir($directory)) {
            $routeFiles = File::files($directory);
            \Route::group(
                [
                'middleware' => $this->middleware['backend'],
                ], function () use ($routeFiles) {
                    foreach ($routeFiles as $file) {
                        include $file;
                    }
                }
            );
        }
        return $this;
    }
1156248
public function indexUrl()
    {
        $route = 'admin::edit-page';
        if (Route::has($route)) {
            return route($route, $this->page_id);
        }

        return route('dashboard');
    }
684166
public function form()
    {
        return Admin::form(Permission::class, function (Form $form) {
            $form->display('id', 'ID');

            $form->text('slug', trans('admin.slug'))->rules('required');
            $form->text('name', trans('admin.name'))->rules('required');

            $form->multipleSelect('http_method', trans('admin.http.method'))
                ->options($this->getHttpMethodsOptions())
                ->help(trans('admin.all_methods_if_empty'));
            $form->textarea('http_path', trans('admin.http.path'));

            $form->display('created_at', trans('admin.created_at'));
            $form->display('updated_at', trans('admin.updated_at'));
        });
    }
1273328
public function actionCheckRoute()
    {
        $post = Yii::$app->request->post();
        if (empty($post['route'])) {
            $result = Yii::t($this->tcModule, 'Error in POST-ed data');
        } else {
            $ctrlLinkPrefix = empty($post['ctrlLinkPrefix']) ? null : $post['ctrlLinkPrefix'];

            $url = ContentMenuBuilder::routeToLink($post['route'], $ctrlLinkPrefix);

            if (Yii::$app instanceof UniApplication && Yii::$app->type == UniApplication::APP_TYPE_BACKEND) {
                // backend application don't have frontend-routes, $url is wrong
                $url = false;

                // if module-container (system-module) has ApplicationModel - it can get frontend application with correct routes
                $containerModule = $this->module->module;
                if ($containerModule instanceof UniModule && array_key_exists(static::$sysAppModel, $containerModule->models)) {
                    $appModel = $containerModule::model(static::$sysAppModel);
                    $appFront = $appModel::initFrontendApplication();
                    $url = ContentMenuBuilder::routeToLink($post['route'], $ctrlLinkPrefix);
                    $appModel::restoreApplication();
                }
            }

            if ($url) {
                $result = htmlspecialchars($url);
            } else {
                $result = Yii::t($this->tcModule, "Can't resolve route '{route}'", ['route' => $post['route']]);
                if (!empty(ContentMenuBuilder::$errorRouteConvert)) {
                    $result .= ', ERROR: ' . ContentMenuBuilder::$errorRouteConvert;
                }
            }
        }
        return $result;
    }
387978
public function view()
    {
        $this->setPageType('form');
        $this->setTitle(__('%1$s &ndash; %2$s', array(__('Preferences'), __('Symphony'))));
        $this->addElementToHead(new XMLElement('link', null, array(
            'rel' => 'canonical',
            'href' => SYMPHONY_URL . '/system/preferences/',
        )));
        $this->appendSubheading(__('Preferences'));

        $bIsWritable = true;
        $formHasErrors = (is_array($this->_errors) && !empty($this->_errors));

        if (General::checkFileWritable(CONFIG) === false) {
            $this->pageAlert(__('The Symphony configuration file, %s, or folder is not writable. You will not be able to save changes to preferences.', array('<code>/manifest/config.php</code>')), Alert::ERROR);
            $bIsWritable = false;
        } elseif ($formHasErrors) {
            $this->pageAlert(
                __('An error occurred while processing this form. See below for details.'), Alert::ERROR
            );
        } elseif (isset($this->_context[0]) && $this->_context[0] == 'success') {
            $this->pageAlert(__('Preferences saved.'), Alert::SUCCESS);
        }

        // Get available languages
        $languages = Lang::getAvailableLanguages();

        if (count($languages) > 1) {
            // Create language selection
            $group = new XMLElement('fieldset');
            $group->setAttribute('class', 'settings');
            $group->appendChild(new XMLElement('legend', __('System Language')));
            $label = Widget::Label();

            // Get language names
            asort($languages);

            $options = array();
            foreach ($languages as $code => $name) {
                $options[] = array($code, $code == Symphony::Configuration()->get('lang', 'symphony'), $name);
            }

            $select = Widget::Select('settings[symphony][lang]', $options);
            $label->appendChild($select);
            $group->appendChild($label);
            $group->appendChild(new XMLElement('p', __('Authors can set up a differing language in their profiles.'), array('class' => 'help')));
            // Append language selection
            $this->Form->appendChild($group);
        }

        // Get available EmailGateways
        $email_gateways = EmailGatewayManager::listAll();

        if (count($email_gateways) >= 1) {
            $group = new XMLElement('fieldset', null, array('class' => 'settings condensed'));
            $group->appendChild(new XMLElement('legend', __('Default Email Settings')));
            $label = Widget::Label(__('Gateway'));

            // Get gateway names
            ksort($email_gateways);

            $default_gateway = EmailGatewayManager::getDefaultGateway();
            $selected_is_installed = EmailGatewayManager::__getClassPath($default_gateway);

            $options = array();

            foreach ($email_gateways as $handle => $details) {
                $options[] = array($handle, (($handle == $default_gateway) || (($selected_is_installed == false) && $handle == 'sendmail')), $details['name']);
            }

            $select = Widget::Select('settings[Email][default_gateway]', $options, array('class' => 'picker', 'data-interactive' => 'data-interactive'));
            $label->appendChild($select);
            $group->appendChild($label);
            // Append email gateway selection
            $this->Form->appendChild($group);
        }

        foreach ($email_gateways as $gateway) {
            $gateway_settings = EmailGatewayManager::create($gateway['handle'])->getPreferencesPane();

            if (is_a($gateway_settings, 'XMLElement')) {
                $this->Form->appendChild($gateway_settings);
            }
        }

        // Get available cache drivers
        $caches = Symphony::ExtensionManager()->getProvidersOf('cache');
        // Add default Symphony cache driver..
        $caches['database'] = 'Database';

        if (count($caches) > 1) {
            $group = new XMLElement('fieldset', null, array('class' => 'settings condensed'));
            $group->appendChild(new XMLElement('legend', __('Default Cache Settings')));

            /**
             * Add custom Caching groups. For example a Datasource extension might want to add in the ability
             * for set a cache driver for it's functionality. This should usually be a dropdown, which allows
             * a developer to select what driver they want to use for caching. This choice is stored in the
             * Configuration in a Caching node.
             * eg.
             *  'caching' => array (
             *        'remote_datasource' => 'database',
             *        'dynamic_ds' => 'YourCachingExtensionClassName'
             *  )
             *
             * @since Symphony 2.4
             * @delegate AddCachingOpportunity
             * @param string $context
             * '/system/preferences/'
             * @param XMLElement $wrapper
             *  An XMLElement of the current Caching fieldset
             * @param string $config_path
             *  The node in the Configuration where this information will be stored. Read only.
             * @param array $available_caches
             *  An array of the available cache providers
             * @param array $errors
             *  An array of errors
             */
            Symphony::ExtensionManager()->notifyMembers('AddCachingOpportunity', '/system/preferences/', array(
                'wrapper' => &$group,
                'config_path' => 'caching',
                'available_caches' => $caches,
                'errors' => $this->_errors
            ));

            $this->Form->appendChild($group);
        }

        /**
         * Add Extension custom preferences. Use the $wrapper reference to append objects.
         *
         * @delegate AddCustomPreferenceFieldsets
         * @param string $context
         * '/system/preferences/'
         * @param XMLElement $wrapper
         *  An XMLElement of the current page
         * @param array $errors
         *  An array of errors
         */
        Symphony::ExtensionManager()->notifyMembers('AddCustomPreferenceFieldsets', '/system/preferences/', array(
            'wrapper' => &$this->Form,
            'errors' => $this->_errors
        ));

        $div = new XMLElement('div');
        $div->setAttribute('class', 'actions');

        $version = new XMLElement('p', 'Symphony ' . Symphony::Configuration()->get('version', 'symphony'), array(
            'id' => 'version'
        ));
        $div->appendChild($version);

        $attr = array('accesskey' => 's');

        if (!$bIsWritable) {
            $attr['disabled'] = 'disabled';
        }

        $div->appendChild(Widget::Input('action[save]', __('Save Changes'), 'submit', $attr));

        $this->Form->appendChild($div);
    }
989466
public function serve() {
        if(is_null($this->linkPath)) {
            $route = $this->fw->get('PARAMS.0');
            if($this->fw->exists('PARAMS.'.$this->routeKey))
                $route = preg_replace('/'.preg_quote($this->routeKeyPrefix.
                    $this->fw->get('PARAMS.'.$this->routeKey)).'$/','',$route);
            elseif(substr($route,-1) != '/')
                $route.= '/';
        } else
            $route = $this->linkPath;
        $this->fw->set('pg.route',$route);
        $this->fw->set('pg.prefix',$this->routeKeyPrefix);
        $this->fw->set('pg.currentPage',$this->current_page);
        $this->fw->set('pg.nextPage',$this->getNext());
        $this->fw->set('pg.prevPage',$this->getPrev());
        $this->fw->set('pg.firstPage',$this->getFirst());
        $this->fw->set('pg.lastPage',$this->getLast());
        $this->fw->set('pg.rangePages',$this->getInRange());
        $this->fw->set('pg.allPages',$this->getMax());
        $output = \Template::instance()->render($this->template);
        $this->fw->clear('pg');
        return $output;
    }
1137822
public function editorInternalLink()
    {
        $showLinkText = $this->getOwner()->getRequest()->getVar('requireLinkText');
        $factory = InternalLinkFormFactory::singleton();
        return $factory->getForm(
            $this->getOwner(),
            "editorInternalLink",
            [ 'RequireLinkText' => isset($showLinkText) ]
        );
    }
823457
public function addAction()
    {
        $request = $this->getRequest();
        $service = $this->getService();
        $form    = $this->getAddForm();

        //if ($this->getOptions()->getUseRedirectParameterIfPresent() && $request->getQuery()->get('redirect')) {
        if ($request->getQuery()->get('redirect')) {
            $redirect = $request->getQuery()->get('redirect');
        } else {
            $redirect = false;
        }

        $redirectUrl = $this->url()->fromRoute($this->getAddActionRoute())
                     . ($redirect ? '?redirect=' . $redirect : '');

        $prg = $this->prg($redirectUrl, true);

        if ($prg instanceof Response) {
            return $prg;
        } elseif ($prg === false) {
            return array(
                'options'  => $this->getOptions(),
                'form'     => $form,
                'redirect' => $redirect,
            );
        }

        $post   = $prg;
        $entity = $service->create($post);

        $redirect = isset($prg['redirect']) ? $prg['redirect'] : null;

        if (!$entity) {
            return array(
                'options'  => $this->getOptions(),
                'form'     => $form,
                'redirect' => $redirect,
            );
        }

        // TODO: Add the redirect parameter here...
        return $this->redirect()->toUrl($this->url()->fromRoute($this->getRouteIdentifierPrefix()) . ($redirect ? '?redirect='.$redirect : ''));
    }
1293972
protected function BackLink()
    {
        $module = new NavigationTree();
        $params = array('navigation'=>$this->navi->GetID());
        return BackendRouter::ModuleUrl($module, $params);
    }
993949
public function EditorExternalLink()
    {
        // Show link text field if requested
        $showLinkText = $this->controller->getRequest()->getVar('requireLinkText');
        $factory = EditorExternalLinkFormFactory::singleton();
        return $factory->getForm(
            $this->controller,
            "{$this->name}/EditorExternalLink",
            [ 'RequireLinkText' => isset($showLinkText) ]
        );
    }
213569
public function Link()
    {
        $form = $this->form;

        return Controller::join_links(
            $form->getDisplayLink(),
            sprintf("?%s=%s&StepID=%s", $form->getGetVar(), $this->getSession()->Hash, $this->ID)
        );
    }
1339294
public function formAction(Request $request, $groupId)
    {
        $group = $this->get('open_orchestra_user.repository.group')->find($groupId);
        $this->denyAccessUnlessGranted(ContributionActionInterface::EDIT, $group);

        $form = $this->createForm('oo_group', $group, array(
            'action' => $this->generateUrl('open_orchestra_group_form', array(
                'groupId' => $groupId,
            )),
            'enable_delete_button' => $this->get('open_orchestra_backoffice.business_rules_manager')->isGranted(ContributionActionInterface::DELETE, $group),
            'delete_button' => $this->isGranted(ContributionActionInterface::DELETE, $group)
        ));

        $form->handleRequest($request);
        $message = $this->get('translator')->trans('open_orchestra_group.form.group.edit.success');
        if ($this->handleForm($form, $message)) {
            $this->dispatchEvent(GroupEvents::GROUP_UPDATE, new GroupEvent($group));
        }

        return $this->renderAdminForm($form);
    }
83595
private function _route() {
        $this->profiler->addTime('route');

        $router = new Router($this);

        foreach ($this->config->config['route'] as $key => $value) {
            foreach ($value as $data) {
                $vars = explode(',', $data['vars']);
                $controller = explode('.', $data['action'])[0];
                $action = explode('.', $data['action'])[1];

                $router->addRoute(new Route($data['url'], $controller, $action, $data['name'], $data['cache'], $vars, $key, $data['logged'], $data['access'], $data['method']));
            }
        }

        $this->request->data->post = $_POST;
        $this->request->data->get = $_GET;
        $this->request->data->file = $_FILES;
        $this->request->data->method = strtolower($_SERVER['REQUEST_METHOD']);

        if (isset($_GET['request-get']) && $_SERVER['REQUEST_METHOD'] == 'GET') {
            $this->request->data->form = true;
            $this->request->data->method = 'get';
        }
        else if (isset($_POST['request-post'])) {
            $this->request->data->form = true;
            $this->request->data->method = 'post';
        }
        else if (isset($_POST['request-put'])) {
            $this->request->data->form = true;
            $this->request->data->method = 'put';
            $this->request->data->put = $_POST;
        }
        else if (isset($_POST['request-patch'])) {
            $this->request->data->form = true;
            $this->request->data->method = 'patch';
            $this->request->data->patch = $_POST;
        }
        else if (isset($_POST['request-delete'])) {
            $this->request->data->form = true;
            $this->request->data->method = 'delete';
            $this->request->data->delete = $_POST;
        }

        if ($_SERVER['REQUEST_METHOD'] == 'PUT') {
            parse_str(file_get_contents("php://input"), $put_vars);
            $this->request->data->put = $put_vars;
        }
        else if ($_SERVER['REQUEST_METHOD'] == 'PATCH') {
            parse_str(file_get_contents("php://input"), $patch_vars);
            $this->request->data->patch = $patch_vars;
        }
        else if ($_SERVER['REQUEST_METHOD'] == 'DELETE') {
            parse_str(file_get_contents("php://input"), $delete_vars);
            $this->request->data->delete = $delete_vars;
        }

        if ($matchedRoute = $router->getRoute(preg_replace('`\?' . preg_quote($_SERVER['QUERY_STRING']) . '`isU', '', $_SERVER['REQUEST_URI']), $this->config)) {
            $_GET = array_merge($_GET, $matchedRoute->vars());

            $this->request->name = $matchedRoute->name();
            $this->request->src = $matchedRoute->src();
            $this->request->controller = $matchedRoute->controller();
            $this->request->action = $matchedRoute->action();
            $this->request->logged = $matchedRoute->logged();
            $this->request->access = $matchedRoute->access();
            $this->request->method = $matchedRoute->method();
            $this->request->auth = new Auth($this->request->src);

            if ($this->config->config['user']['output']['cache']['enabled'] && $matchedRoute->cache() != '') {
                $this->request->cache = $matchedRoute->cache();
            }
            else {
                $this->request->cache = 0;
            }

            if ($this->request->action == '') {
                $this->request->action = 'default';
            }

            $this->_route = true;
        }

        $this->profiler->addTime('route', Profiler::USER_END);

        return $this;
    }
446082
protected function BackLink()
    {
        $params = array('site'=>$this->page->GetSite()->GetID());
        $params['selected'] = $this->page->GetID();
        return BackendRouter::ModuleUrl(new PageTree(), $params);
    }