public function progressBarInfos(Request $request, $databox_id)
    {
        if (!$request->isXmlHttpRequest() || 'json' !== $request->getRequestFormat()) {
            $this->app->abort(400, $this->app->trans('Bad request format, only JSON is allowed'));
        }

        $appbox = $this->getApplicationBox();

        $ret = [
            'success'           => false,
            'sbas_id'           => null,
            'msg'               => $this->app->trans('An error occured'),
            'indexable'         => false,
            'viewname'          => null,
            'printLogoURL'      => null,
            'counts'            => null,
        ];

        try {
            $databox = $this->findDataboxById($databox_id);

            $ret['sbas_id'] = $databox_id;
            $ret['indexable'] = $appbox->is_databox_indexable($databox);
            $ret['viewname'] = (($databox->get_dbname() == $databox->get_viewname())
                ? $this->app->trans('admin::base: aucun alias')
                : $databox->get_viewname());
            $ret['counts'] = $databox->get_counts();
            if ($this->app['filesystem']->exists($this->app['root.path'] . '/config/minilogos/logopdf_' . $databox_id . '.jpg')) {
                $ret['printLogoURL'] = '/custom/minilogos/logopdf_' . $databox_id . '.jpg';
            }

            $ret['success'] = true;
            $ret['msg'] = $this->app->trans('Successful update');
        } catch (\Exception $e) {

        }

        return $this->app->json($ret);
    }
public function progressBarInfos(Request $request, $databox_id)
    {
        if (!$request->isXmlHttpRequest() || 'json' !== $request->getRequestFormat()) {
            $this->app->abort(400, $this->app->trans('Bad request format, only JSON is allowed'));
        }

        $appbox = $this->getApplicationBox();

        $ret = [
            'success'           => false,
            'sbas_id'           => null,
            'msg'               => $this->app->trans('An error occured'),
            'indexable'         => false,
            'viewname'          => null,
            'printLogoURL'      => null,
            'counts'            => null,
        ];

        try {
            $databox = $this->findDataboxById($databox_id);

            $ret['sbas_id'] = $databox_id;
            $ret['indexable'] = $appbox->is_databox_indexable($databox);
            $ret['viewname'] = (($databox->get_dbname() == $databox->get_viewname())
                ? $this->app->trans('admin::base: aucun alias')
                : $databox->get_viewname());
            $ret['counts'] = $databox->get_counts();
            if ($this->app['filesystem']->exists($this->app['root.path'] . '/config/minilogos/logopdf_' . $databox_id . '.jpg')) {
                $ret['printLogoURL'] = '/custom/minilogos/logopdf_' . $databox_id . '.jpg';
            }

            $ret['success'] = true;
            $ret['msg'] = $this->app->trans('Successful update');
        } catch (\Exception $e) {

        }

        return $this->app->json($ret);
    }
public function progressBarInfos ( Request $ request , $ databox_id ) { if ( ! $ request -> isXmlHttpRequest ( ) || 'json' !== $ request -> getRequestFormat ( ) ) { $ this -> app -> abort ( 400 , $ this -> app -> trans ( 'Bad request format, only JSON is allowed' ) ) ; } $ appbox = $ this -> getApplicationBox ( ) ; $ ret = [ 'success' => false , 'sbas_id' => null , 'msg' => $ this -> app -> trans ( 'An error occured' ) , 'indexable' => false , 'viewname' => null , 'printLogoURL' => null , 'counts' => null , ] ; try { $ databox = $ this -> findDataboxById ( $ databox_id ) ; $ ret [ 'sbas_id' ] = $ databox_id ; $ ret [ 'indexable' ] = $ appbox -> is_databox_indexable ( $ databox ) ; $ ret [ 'viewname' ] = ( ( $ databox -> get_dbname ( ) == $ databox -> get_viewname ( ) ) ? $ this -> app -> trans ( 'admin::base: aucun alias' ) : $ databox -> get_viewname ( ) ) ; $ ret [ 'counts' ] = $ databox -> get_counts ( ) ; if ( $ this -> app [ 'filesystem' ] -> exists ( $ this -> app [ 'root.path' ] . '/config/minilogos/logopdf_' . $ databox_id . '.jpg' ) ) { $ ret [ 'printLogoURL' ] = '/custom/minilogos/logopdf_' . $ databox_id . '.jpg' ; } $ ret [ 'success' ] = true ; $ ret [ 'msg' ] = $ this -> app -> trans ( 'Successful update' ) ; } catch ( \ Exception $ e ) { } return $ this -> app -> json ( $ ret ) ; }
Get number of indexed items for a databox

@param  Request $request    The current HTTP request
@param  integer $databox_id The requested databox
@return JsonResponse
Get number of indexed items for a databox