application/modules/g/views/helpers/Browsebox.php
public function config($id = false) {
        $boxes = $this->_getAllBrowseboxes();
        if (count($boxes)) {
            $script = "Garp.browseboxes = [];\n";
            foreach ($boxes as $boxId => $box) {
                $jsConfig  = $this->_getJavascriptOptions($box);
                $boxScript = '';
                $boxScript .= "new Garp.Browsebox({\n";
                $boxScript .= "\t\"id\": \"$boxId\",\n";
                $i = 0;
                $total = count($jsConfig);
                foreach ($jsConfig as $confKey => $confVal) {
                    $boxScript .= "\t\"$confKey\": \"$confVal\"";
                    if ($i < ($total-1)) {
                        $boxScript .= ',';
                    }
                    $boxScript .= "\n";
                    $i++;
                }
                $boxScript .= "})";

                if ($id && $boxId === $id) {
                    return $this->_wrapInTags($boxScript);
                }
                $script .= "Garp.browseboxes.push($boxScript);\n";
            }
            return $this->_wrapInTags($script);
        }
        return '';
    }
public function config($id = false) {
        $boxes = $this->_getAllBrowseboxes();
        if (count($boxes)) {
            $script = "Garp.browseboxes = [];\n";
            foreach ($boxes as $boxId => $box) {
                $jsConfig  = $this->_getJavascriptOptions($box);
                $boxScript = '';
                $boxScript .= "new Garp.Browsebox({\n";
                $boxScript .= "\t\"id\": \"$boxId\",\n";
                $i = 0;
                $total = count($jsConfig);
                foreach ($jsConfig as $confKey => $confVal) {
                    $boxScript .= "\t\"$confKey\": \"$confVal\"";
                    if ($i < ($total-1)) {
                        $boxScript .= ',';
                    }
                    $boxScript .= "\n";
                    $i++;
                }
                $boxScript .= "})";

                if ($id && $boxId === $id) {
                    return $this->_wrapInTags($boxScript);
                }
                $script .= "Garp.browseboxes.push($boxScript);\n";
            }
            return $this->_wrapInTags($script);
        }
        return '';
    }
public function config ( $ id = false ) { $ boxes = $ this -> _getAllBrowseboxes ( ) ; if ( count ( $ boxes ) ) { $ script = "Garp.browseboxes = [];\n" ; foreach ( $ boxes as $ boxId => $ box ) { $ jsConfig = $ this -> _getJavascriptOptions ( $ box ) ; $ boxScript = '' ; $ boxScript .= "new Garp.Browsebox({\n" ; $ boxScript .= "\t\"id\": \"$boxId\",\n" ; $ i = 0 ; $ total = count ( $ jsConfig ) ; foreach ( $ jsConfig as $ confKey => $ confVal ) { $ boxScript .= "\t\"$confKey\": \"$confVal\"" ; if ( $ i < ( $ total - 1 ) ) { $ boxScript .= ',' ; } $ boxScript .= "\n" ; $ i ++ ; } $ boxScript .= "})" ; if ( $ id && $ boxId === $ id ) { return $ this -> _wrapInTags ( $ boxScript ) ; } $ script .= "Garp.browseboxes.push($boxScript);\n" ; } return $ this -> _wrapInTags ( $ script ) ; } return '' ; }
Create Javascript configuration for browsebox objects.

@param string $id The browsebox id. If given, only config for this browsebox is returned.
@return string
Create Javascript configuration for browsebox objects .