Route page callback to display module settings form
769374
public function editSettings()
    {
        $this->setTitleEditSettings();
        $this->setBreadcrumbEditSettings();

        $this->setData('statuses', $this->order->getStatuses());
        $this->setData('settings', $this->module->getSettings('twocheckout'));

        $this->submitSettings();
        $this->outputEditSettings();
    }
636712
function(req, res, route) {
    req.on('data', function(data) {
      req.body = queryStringToJSON(data.toString());
      route.callback(req, res);
    });
  }
122181
function initApp (config) {
    // init each module in the order loaded
    _.each(config.moduleNames, moduleName => {
        var module = config.modules[moduleName]
        // load modules and controllers for module, setup routes
        initModule(config, module)
        // merge module routes to global routes
        _.merge(config.routes, module.routes)
    })
    // initialize merged routes from all modules
    var router = initRoutes(config, config.routes)
    // bind router to app base
    config.express.use('/', router)
}
237071
function defineRoute (server, opts) {

    server.route({
        method: 'GET',
        path: '/' + opts.plural,
        handler: handler,
        config: {
            jsonp: 'callback',
            validate: {
                query: {},
                payload: false
            }
        }
    });

    function handler (req) {
        var res = {};
        res[opts.plural] = opts.things;
        req.reply(res);
    }

}
417669
def register_route(self, app):
        """"""
        if "url" not in self.params["options"]:
            raise Exception("Component does not have a URL property")

        if not hasattr(self.route_func, "__call__"):
            raise Exception("No app route function supplied")

        app.add_url_rule(self.params["options"]["url"],
            self.params["options"]["url"],
            self.route_func)
850756
def render_settingsLink(self, ctx, data):
        
        if self.username is None:
            return ''
        translator = self._getViewerPrivateApplication()
        return settingsLink(
            translator,
            translator.getPageComponents().settings,
            ctx.tag)
565929
function form () {
  form.form = $("#swagger-parser-form");

  form.allow = {
    label: form.form.find("#allow-label"),
    menu: form.form.find("#allow-menu"),
    json: form.form.find("input[name=allow-json]"),
    yaml: form.form.find("input[name=allow-yaml]"),
    text: form.form.find("input[name=allow-text]"),
    empty: form.form.find("input[name=allow-empty]"),
    unknown: form.form.find("input[name=allow-unknown]")
  };

  form.refs = {
    label: form.form.find("#refs-label"),
    menu: form.form.find("#refs-menu"),
    external: form.form.find("input[name=refs-external]"),
    circular: form.form.find("input[name=refs-circular]")
  };

  form.validate = {
    label: form.form.find("#validate-label"),
    menu: form.form.find("#validate-menu"),
    schema: form.form.find("input[name=validate-schema]"),
    spec: form.form.find("input[name=validate-spec]")
  };

  form.tabs = {
    url: form.form.find("#url-tab"),
    text: form.form.find("#text-tab")
  };

  form.method = {
    button: form.form.find("button[name=method]"),
    menu: form.form.find("#method-menu")
  };

  form.samples = {
    url: {
      container: form.form.find("#url-sample"),
      link: form.form.find("#url-sample-link"),
    },
    text: {
      container: form.form.find("#text-sample"),
      link: form.form.find("#text-sample-link"),
    }
  };

  form.url = form.form.find("input[name=url]");
  form.textBox = null; // This is set in editors.js
  form.bookmark = form.form.find("#bookmark");
}
736531
public function add_settings_page() {

		$this->screen_hook_suffix = add_menu_page(
			$this->struct['args']['page_title'],
			$this->struct['args']['menu_title'],
			$this->struct['args']['capability'],
			$this->slug,
			array( $this, 'create_page' ),
			$this->struct['args']['icon'],
			$this->struct['args']['position']
		);

	}
1352001
function getRoute(params) {
    params.route = params.route || "";
    var localeRoute = utils.getLocaleRoute(),
        pageRoute = localeRoute + "/:page/",
        settingsRoute = utils.getAppSettingsRoute() + "/";

    return (params.isAppRoute ? AppURL + "/" : params.settings ? settingsRoute : pageRoute)
        + params.pluginId + (params.many ? "/:iId" : "") + params.route
}
359642
public function remote_management_page_init() {
		register_setting(
			'github_updater_remote_management',
			'github_updater_remote_settings',
			[ $this, 'sanitize' ]
		);

		add_settings_section(
			'remote_management',
			esc_html__( 'Remote Management', 'github-updater' ),
			[ $this, 'print_section_remote_management' ],
			'github_updater_remote_settings'
		);

		foreach ( self::$remote_management as $id => $name ) {
			add_settings_field(
				$id,
				null,
				[ $this, 'token_callback_checkbox_remote' ],
				'github_updater_remote_settings',
				'remote_management',
				[
					'id'    => $id,
					'title' => esc_html( $name ),
				]
			);
		}
	}
523575
function (config) {
        if (typeof config !== 'object') {
            throw new Error('Invalid Route Config');
        }
        if (typeof config.route !== 'string') {
            var name_1 = config.name || '(no name)';
            throw new Error('Invalid Route Config for "' + name_1 + '": You must specify a "route:" pattern.');
        }
        if (!('redirect' in config || config.moduleId || config.navigationStrategy || config.viewPorts)) {
            throw new Error('Invalid Route Config for "' + config.route + '": You must specify a "moduleId:", "redirect:", "navigationStrategy:", or "viewPorts:".');
        }
    }
1304802
public function editPageSettingsAction(Request $request, $id)
	{
		/** @var PageInterface $page */
		$page = $this->admin->getObject($id);

		$layoutBlocks = $page->getLayoutBlock();

		$form = $this->admin->getForm();
		$form->setData($page);

		$form->handleRequest($request);

		$response = new Response();

		if($form->isSubmitted()){
			if($form->isValid()){
				$page->setStatus(PageInterface::STATUS_DRAFT);
				$page->setUpdatedAt();
				$page->setLayoutBlock($layoutBlocks);
				$this->admin->update($page);

				return $this->getAjaxEditResponse($form, $page);

			}
			$response->setStatusCode(422);
		}
		$view = $form->createView();
		$this->setFormTheme($view, $this->admin->getFormTheme());

		return $this->renderWithExtraParams(
			'@NetworkingInitCms/PageAdmin/page_settings_edit.html.twig',
			[
				'form' => $view,
                'object' => $page,
			],
			$response
		);
	}
1148919
function runRouteChat(callback) {
  var call = client.routeChat();
  call.on('data', function(note) {
    console.log('Got message "' + note.message + '" at ' +
        note.location.latitude + ', ' + note.location.longitude);
  });

  call.on('end', callback);

  var notes = [{
    location: {
      latitude: 0,
      longitude: 0
    },
    message: 'First message'
  }, {
    location: {
      latitude: 0,
      longitude: 1
    },
    message: 'Second message'
  }, {
    location: {
      latitude: 1,
      longitude: 0
    },
    message: 'Third message'
  }, {
    location: {
      latitude: 0,
      longitude: 0
    },
    message: 'Fourth message'
  }];
  for (var i = 0; i < notes.length; i++) {
    var note = notes[i];
    console.log('Sending message "' + note.message + '" at ' +
        note.location.latitude + ', ' + note.location.longitude);
    call.write(note);
  }
  call.end();
}
1159692
function (callback) {
    var APIController = require('./controllers/api'),
      DefaultController = require('./controllers/index'),
      PackController = require('./controllers/pack'),
      CardController = require('./controllers/card'),
      WebHookController = require('./controllers/webhook'),
      ProxyController = require('./controllers/proxy'),
      JsonParser = BodyParser.json({strict: false});
    
    // Disable caching middleware.  
    var nocache = function (req, res, next) {
      res.header('Cache-Control', 'private, no-cache, no-store, must-revalidate');
      res.header('Expires', '-1');
      res.header('Pragma', 'no-cache');
      next();
    };
    
    // Setup routes late to give implementers routes higher priority and allow middleware as well.
    App.get('/api/count', nocache, APIController.count);
    App.get('/api/cards', nocache, APIController.cards);
    App.get('/api/card', nocache, APIController.card);
    
    App.post('/api/card/state/save', APIController.saveState);
    App.post('/api/card/state/clear', APIController.clearState);
    App.post('/api/card/analytics', APIController.recordAnalyticEvents);

    // Proxy
    App.post('/proxy/:pack/:card', ProxyController.post);

    // Web Hooks
    App.post('/webhook/:pack/:card', WebHookController.process);

    // Card Routes
    App.post('/:pack/:card', JsonParser, CardController.post);
    App.get('/:pack/:card', CardController.get);
    
    App.get('/:pack', PackController);
    App.get('/', DefaultController);

    var exit = function () {
      HashDo.db.disconnect(function () {
        process.exit(0);
      });
    };
    
    // Gracefully disconnect from the database on expected exit.
    process.on('SIGINT', exit);
    process.on('SIGTERM', exit);
    
    // Global error handler (always exit for programmatic errors).
    process.on('uncaughtException', function (err) {
      console.error('FATAL: ', err.message);
      console.error(err.stack);
      process.exit(1);
    });
    
    // Connect to the database and start server on successful connection.
    HashDo.db.connect(function (err) {
      if (err) {
        console.error('FATAL: Could not connect to database.', err);
        process.exit(1);
      }
      else {
        console.log('WEB: Starting web server on port %d...', process.env.PORT);
        
        App.listen(process.env.PORT, function () {
          console.log();
          console.log('Let\'s #Do');
          
          callback && callback();
        });
      }
    });
  }
1334071
function(page) {
      var t = this,
          newPages = t.pages.slice(0);
      newPages.push(page);
      t.tour.set('pages', newPages);
      t.tour.isDirty = true;
      t.setDirty(true);
      t.loadForm();
    }
932119
function (form) {
            var viewData = {
              form: form,
              organization: req.organization
            };
            // The form library puts us in this error case if the form is empty,
            // which is true when you arrive on the form with a GET request.
            // This conditional allows us to control what we do in that situation
            if (form.data && !form.data.email) {
              client.getCurrentTenant(function (err, tenant) {
                if (err) {
                  logger.info(err.message);
                  viewData.error = err.userMessage;
                  return helpers.render(req, res, view, viewData);
                }

                tenant.verifyAccountEmail(req.query.sptoken, function (err, account) {
                  if (err) {
                    logger.info(err.message);
                    viewData.invalid_sp_token = true;
                    return helpers.render(req, res, view, viewData);
                  }

                  client.getAccount(account.href, function (err) {
                    if (err) {
                      logger.info(err.message);
                      viewData.error = err.userMessage;
                      return helpers.render(req, res, view, viewData);
                    }

                    res.redirect(config.web.login.uri + '?status=verified');
                  });
                });
              });
            } else {
              viewData.formErrors = helpers.collectFormErrors(form);
              helpers.render(req, res, view, viewData);
            }
          }
1242227
def render_settingsLink(self, ctx, data):
        
        return settingsLink(
            self.translator, self.pageComponents.settings, ctx.tag)