Get default App
@return Renderer JSON response log list
@throws Server500
483559
public function getDefaultAppActivity():Renderer
    {
        $default = array();
        $file = (array) JL::open(FEnv::get("framework.config.core.apps.file"));
        foreach ($file as $one) {
            if ($one->isdefault == "yes") {
                $default = $one;
                break;
            }
        }
        return ((new Renderer())->jsonRenderer(array("code" => 200, "results" => $default)));
    }
1100282
public function setDefaultJsonDecoder()
    {
        $args = func_get_args();
        $this->jsonDecoder = function ($response) use ($args) {
            array_unshift($args, $response);

            // Call json_decode() without the $options parameter in PHP
            // versions less than 5.4.0 as the $options parameter was added in
            // PHP version 5.4.0.
            if (version_compare(PHP_VERSION, '5.4.0', '<')) {
                $args = array_slice($args, 0, 3);
            }

            $json_obj = call_user_func_array('json_decode', $args);
            if (!($json_obj === null)) {
                $response = $json_obj;
            }
            return $response;
        };
    }
400364
private function default() {

        $this->callback->filter(function (HttpCallBack $test) {
           
            return !strcmp($test->getPath(), $this->actual.'/**');

        })->each(function (HttpCallBack $test) {
 
            $test->call($this->rutesManager->getParameter());

        });
        
    }
845584
public function editActivity(string $appname):Renderer
    {
        $prefix = $this->get("request")->get("prefix");
        $enable = $this->get("request")->get("enabled");


        // Advanced options
        $vdev = $this->get("request")->get("vdev");
        $vprod = $this->get("request")->get("vprod");

        $hostsdeva = $this->get("request")->get("hostsdeva");
        $hostsdevd = $this->get("request")->get("hostsdevd");
        $hostsproda = $this->get("request")->get("hostsproda");
        $hostsprodd = $this->get("request")->get("hostsprodd");

        if ($prefix != "" && $this->checkPrefix($prefix) == -1) {
            return ((new Renderer())->jsonRenderer(array("code" => 500, "msg" =>
                "Error on app prefix. (App prefix must be a string without special character exepted [ _ & numbers])"))
            );
        }

        if (!in_array($enable, array("yes", "no"))) {
            return ((new Renderer())->jsonRenderer(array("code" => 500, "msg" => "App name already exist")));
        }

        if (!in_array($vdev, array("null", "false", "true"))) {
            return ((new Renderer())->jsonRenderer(array("code" => 500,
                "msg" => "Cannot set visibility on dev environment : Undefined value $vdev")));
        }

        if (!in_array($vprod, array("null", "false", "true"))) {
            return ((new Renderer())->jsonRenderer(array("code" => 500,
                "msg" => "Cannot set visibility on prod environment : Undefined value $vdev")));
        }

        $f = json_decode(file_get_contents(
            FEnv::get("framework.root")."elements/config_files/core/apps.json"
        ));

        foreach ($f as $one => $val) {
            if ($val->name == $appname) {
                $val->prefix = trim(stripslashes($prefix));
                $val->enabled = trim($enable);
                $val->update = new \DateTime('UTC');
                break;
            }
        }
        $f = json_encode($f, JSON_PRETTY_PRINT);
        file_put_contents(FEnv::get("framework.root")."elements/config_files/core/apps.json", $f);


        if ("null" === $vdev) {
            $vdev = null;
        } elseif ("false" === $vdev) {
            $vdev = false;
        } elseif ("true" === $vdev) {
            $vdev = true;
        } else {
            $vdev = null;
        }

        if ("null" === $vprod) {
            $vprod = null;
        } elseif ("false" === $vprod) {
            $vprod = false;
        } elseif ("true" === $vprod) {
            $vprod = true;
        } else {
            $vprod = null;
        }

        $hostsdeva  = (("" === trim($hostsdeva))? null : array_map(
            'trim',
            (explode(";", $hostsdeva))
        ));
        $hostsdevd  = (("" === trim($hostsdevd))? null : array_map(
            'trim',
            (explode(";", $hostsdevd))
        ));
        $hostsproda = (("" === trim($hostsproda))? null : array_map(
            'trim',
            (explode(";", $hostsproda))
        ));
        $hostsprodd = (("" === trim($hostsprodd))? null : array_map(
            'trim',
            (explode(";", $hostsprodd))
        ));




        if (JsonListener::exists(FEnv::get("app.config.file", $appname))) {
            $a = json_decode(file_get_contents(
                FEnv::get("app.config.file", $appname)
            ));
        } else {
            $a = new \stdClass();
        }

        $a->visibility_dev  = $vdev;
        $a->visibility_prod = $vprod;

        $a->hosts_allowed_dev   = $hostsdeva;
        $a->hosts_denied_dev    = $hostsdevd;
        $a->hosts_allowed_prod  = $hostsproda;
        $a->hosts_denied_prod   = $hostsprodd;

        $a = json_encode($a, JSON_PRETTY_PRINT);
        file_put_contents(FEnv::get("app.config.file", $appname), $a);

        return ((new Renderer())->jsonRenderer(array("code" => 200, "msg" => "OK")));
    }
1297564
public function renderJson()
    {
        $totalCount = $this->getDatasource()->totalCount();
        $rows = $this->getDatasource()->listRows();

        $tmpData = [];
        foreach ($rows as $row) {
            $tmp = [];

            $this->currentRow = new DefaultRow();
            if ($this->rowCallback instanceof \Closure) {
                $this->rowCallback->call($this, $row);
            }

            foreach ($this->getColumns() as $key => $column) {
                $this->currentColumn = $key;
                $tmp[$column->getName()] = $column->format($row);
            }

            $tmpData[] = $tmp;
        }

        $data = [
            'draw' => $this->getRequest()->get('draw'), // @todo param names configurable
            'recordsTotal' => $totalCount,
            'recordsFiltered' => $totalCount,
            'data' => $tmpData,
        ];

        header('Content-Type: application/json');
        echo json_encode($data);die;
    }
553622
public function getAllActivity():Renderer
    {
        $locales = [];
        $elems = Locale::getAll();
        foreach ($elems as $one => $value) {
            if (null === $value) {
                $locales[] = ["app" => $one, "enabled" => false, "values" => [],
                   "prefered" => null, "transtype" => null,
                   "route_status_change" =>
                       $this->generateRoute(
                           "iumio_manager_locale_manager_framework_change_status_app",
                           ["appname" => $one, "status" => "enabled"]
                       ),
                   "route_get_one_locale_app_save" =>
                       $this->generateRoute(
                           "iumio_manager_locale_manager_edit_one",
                           ["appname" => $one]
                       ),
                       "route_get_one_locale_app" =>
                           $this->generateRoute(
                               "iumio_manager_locale_manager_get_one",
                               ["appname" => $one]
                           )];
            } else {
                $locales[] = ["app" => $one, "enabled" => $value->isEnabled(), "values" => $value->getValues(),
                   "prefered" => $value->getPrefer(), "transtype" => $value->getTranstype(), "route_status_change" =>
                       $this->generateRoute(
                           "iumio_manager_locale_manager_framework_change_status_app",
                           ["appname" => $one, "status" => ((true === $value->isEnabled())? "disabled" : "enabled")]
                       ),
                   "route_get_one_locale_app_save" =>
                       $this->generateRoute(
                           "iumio_manager_locale_manager_edit_one",
                           ["appname" => $one]
                       ),
                   "route_get_one_locale_app" => $this->generateRoute(
                       "iumio_manager_locale_manager_get_one",
                       ["appname" => $one]
                   )];
            }
        }
        return ((new Renderer())->jsonRenderer(array("code" => 200, "results" => $locales)));
    }
569681
public function getJson() : ?string 
    {
        if ( ! $this->hasJson()) {
            $this->setJson($this->getDefaultJson());
        }
        return $this->json;
    }
553504
protected function getRender()
    {
        // environment
        /** @var $environmentResolver EnvironmentResolver */
        $environmentResolver = $this->application->container->get('environment_resolver');
        $environment = $environmentResolver->resolve();

        $format = $this->getOption('format');
        if (is_null($format)) {
            $format = $environment->getDefaultFormat();
        }

        /** @var $formatResolver FormatResolver */
        $formatResolver = $this->application->container->get('format_resolver');
        $format = $formatResolver->getFormat($format);

        /** @var $themeResolver ThemeResolver */
        $themeResolver = $this->application->container->get('theme_resolver');

        if ($this->application->container->hasParameter('theme')) {
            $theme = $themeResolver->getTheme($this->application->container->getParameter('theme'), $format->getName());
        } else {
            $theme = $themeResolver->resolve($format);
        }

        /** @var $renderResolver RendererResolver */
        $renderResolver = $this->application->container->get('renderer_resolver');

        $render = $renderResolver->resolve($format);
        $render->setTheme($theme);
        //$render->setFormat($format);
        return $render;
    }
316236
public function defaultAction()
    {
        $lng = \Cmf\Language\Factory::get($this);
        HelperFactory::getMeta()->clear();
        HelperFactory::getJS()->clear();
        HelperFactory::getStyle()->clear();
        HelperFactory::getTitle()->setTitle('Redirect');
        if ($path = urldecode(Application::getRequest()->get('path'))) {
            HelperFactory::getMeta()->addTag('refresh', '0; url=' . $path);
            $response = ['path' => $path];
        } else {
            $response = ['error' => $lng['error_badPath']];
        }

        return $response;
    }
205259
protected function getDefaultOptions()
    {
        if (!isset($this->defaultOptions['replacements']['APP_NAME'])) {
            $this->defaultOptions['replacements']['APP_NAME'] = $this->env('APP_NAME');
        }

        return $this->defaultOptions;
    }
299689
function(){
            return {
                request: this.request.toJSON(),
                response: this.response.toJSON(),
                app: this.app.toJSON(),
                originalUrl: this.originalUrl,
                req: '<original node req>',
                res: '<original node res>',
                socket: '<original node socket>',
            };
        }
81173
public function getRenderer()
    {
        if ($this->renderer === null) {
            $this->renderer = Services::renderer();
        }
        return $this->renderer;
    }
1111412
public function getAppConfigActivity(string $appname)
    {
        $g = AppConfig::getInstance($appname);
        return ((new Renderer())->jsonRenderer(array("code" => 200, "result" =>  $g->getConfig())));
    }
1259640
function App() {
  this.ui = {
    'map': 'j-map',
    'panel': 'j-panel',
    'header': 'j-header',
    'overlay': 'j-overlay'
  };

  /** This is root element of app */
  this.$app = document.getElementById('j-app');

  this.map;

  this.user = new User();
  this.places = new Places();
  this.checkin = Checkin;

  /* A list of possible name of pages */
  this._PAGES = ['dashboard', 'new_place', 'place_detailed', 'checkin'];

  this._activePageName = '';
    
  /**
   * Write to root element a class name of a page
   * by set activePage property 
   */
  Object.defineProperty(this, 'activePage', {
    set: function(params) {
      var self = this;

      // Set a class (pageName) to root el of app
      // Remove all previously options
      self._PAGES.forEach(function(pName) {
          self.$app.classList.remove(pName);
      });

      // set a name of current page
      self.$app.classList.add(params.pageName);

      // render the page
      self.renderPage(params.pageName, params.detailed);

      this._activePageName = params.pageName;
    },
    get: function() {
      return this._activePageName;
    }
  });

  this._init();
}
340484
public function updateActivity(string $env):Renderer
    {
        $allowed     = $this->get("request")->get("allowed");
        $denied     = $this->get("request")->get("denied");

        if (!in_array($env, array("dev", "prod"))) {
            throw new Server500(new \ArrayObject(array("explain" => "Undefined environment $env", "solution" =>
                "Environment must be [dev or prod]")));
        }

        if (trim($allowed) == "" || trim($denied) == "") {
            return ((new Renderer())->jsonRenderer(array("code" => 500, "msg" => "Error on hosts parameters")));
        }


        $allowed = (object)(explode(";", $allowed));
        $denied = (object)(explode(";", $denied));

        $a = new \stdClass();
        $a->allowed = $allowed;
        $a->denied = $denied;

        JL::put(
            FEnv::get("framework.config").'hosts/hosts.'.$env.'.json',
            json_encode($a, JSON_PRETTY_PRINT)
        );

        return ((new Renderer())->jsonRenderer(array("code" => 200, "msg" => "OK")));
    }
483103
protected function getDefaultBrowser()
    {
        $potential = array('xdg-open', 'open', 'start');
        /** @var \Symfony\Component\Console\Helper\ProcessHelper $process */
        $process = $this->getHelper('process');
        foreach ($potential as $browser) {
            // Check if command exists by executing help flag.

            if ($process->run($this->stdOut, "command -v $browser")->isSuccessful()) {
                return $browser;
            }
        }
        return false;
    }
1197844
public function defaultAction()
    {
        // Check current user authorization
        if (null !== $response = $this->checkAuth(AdminResources::MODULE, Team::getModuleCode(),
                AccessManager::VIEW)
        ) {
            return $response;
        }

        return $this->getListRenderTemplate();
    }