private function generateNamesDescription()
    {
        foreach ($this->app['config']->get('contenttypes') as $ctname => $ctype) {
            $keyprefix = 'contenttypes.' . $this->slugifyKey($ctname) . '.';

            // Names & description
            $setkeys = [
                'name.plural'   => 'name',
                'name.singular' => 'singular_name',
                'description'   => 'description',
            ];
            foreach ($setkeys as $setkey => $getkey) {
                $key = $keyprefix . $setkey;

                if ($this->isSaved($key)) {
                    $this->translation[$key] = $this->saved[$key];
                } else {
                    if (isset($ctype[$getkey]) && $ctype[$getkey] !== '') {
                        $this->hints[$key] = $ctype[$getkey];
                    } else {
                        $fallback = $this->fallback($key);
                        if ($fallback !== false) {
                            $this->hints[$key] = $fallback;
                        }
                    }
                    $this->translation[$key] = '';
                }
                // Remember names for later usage
                if ($setkey == 'name.plural') {
                    $this->ctnames[$ctname]['%contenttypes%'] = $this->translation[$key];
                } elseif ($setkey == 'name.singular') {
                    $this->ctnames[$ctname]['%contenttype%'] = $this->translation[$key];
                }
            }
        }
    }
private function generateNamesDescription()
    {
        foreach ($this->app['config']->get('contenttypes') as $ctname => $ctype) {
            $keyprefix = 'contenttypes.' . $this->slugifyKey($ctname) . '.';

            // Names & description
            $setkeys = [
                'name.plural'   => 'name',
                'name.singular' => 'singular_name',
                'description'   => 'description',
            ];
            foreach ($setkeys as $setkey => $getkey) {
                $key = $keyprefix . $setkey;

                if ($this->isSaved($key)) {
                    $this->translation[$key] = $this->saved[$key];
                } else {
                    if (isset($ctype[$getkey]) && $ctype[$getkey] !== '') {
                        $this->hints[$key] = $ctype[$getkey];
                    } else {
                        $fallback = $this->fallback($key);
                        if ($fallback !== false) {
                            $this->hints[$key] = $fallback;
                        }
                    }
                    $this->translation[$key] = '';
                }
                // Remember names for later usage
                if ($setkey == 'name.plural') {
                    $this->ctnames[$ctname]['%contenttypes%'] = $this->translation[$key];
                } elseif ($setkey == 'name.singular') {
                    $this->ctnames[$ctname]['%contenttype%'] = $this->translation[$key];
                }
            }
        }
    }
private function generateNamesDescription ( ) { foreach ( $ this -> app [ 'config' ] -> get ( 'contenttypes' ) as $ ctname => $ ctype ) { $ keyprefix = 'contenttypes.' . $ this -> slugifyKey ( $ ctname ) . '.' ; // Names & description $ setkeys = [ 'name.plural' => 'name' , 'name.singular' => 'singular_name' , 'description' => 'description' , ] ; foreach ( $ setkeys as $ setkey => $ getkey ) { $ key = $ keyprefix . $ setkey ; if ( $ this -> isSaved ( $ key ) ) { $ this -> translation [ $ key ] = $ this -> saved [ $ key ] ; } else { if ( isset ( $ ctype [ $ getkey ] ) && $ ctype [ $ getkey ] !== '' ) { $ this -> hints [ $ key ] = $ ctype [ $ getkey ] ; } else { $ fallback = $ this -> fallback ( $ key ) ; if ( $ fallback !== false ) { $ this -> hints [ $ key ] = $ fallback ; } } $ this -> translation [ $ key ] = '' ; } // Remember names for later usage if ( $ setkey == 'name.plural' ) { $ this -> ctnames [ $ ctname ] [ '%contenttypes%' ] = $ this -> translation [ $ key ] ; } elseif ( $ setkey == 'name.singular' ) { $ this -> ctnames [ $ ctname ] [ '%contenttype%' ] = $ this -> translation [ $ key ] ; } } } }
Generates keys for contenttypes names and description and save found names for later usage.
Generates keys for contenttypes names and description and save found names for later usage .