method setTheme documentation in bbn\Appui\Ide

Function for set preference theme for every single project

function(string $theme = '') { $opt_theme = $this->options->fromCode(self::THEME, self::IDE_PATH, self::BBN_APPUI); $pref_arch = $this->pref->getClassCfg(); if (!empty($opt_theme)) { //id_option is the project $pref = $this->db->selectOne( $pref_arch['tables']['user_options'], $pref_arch['arch']['user_options']['id'], [ $pref_arch['arch']['user_options']['id_user'] => $this->pref->getUser(), $pref_arch['arch']['user_options']['id_option'] => $this->projects->getId() ] ); //if it does not exist, the preference for user and project is created if (empty($pref)) { $pref = $this->pref->add($this->projects->getId(), []); } if (!empty($pref)) { $id_bit = $this->db->selectOne( $pref_arch['tables']['user_options_bits'], $pref_arch['arch']['user_options_bits']['id'], [ $pref_arch['arch']['user_options_bits']['id_user_option'] => $pref, $pref_arch['arch']['user_options_bits']['id_option'] => $opt_theme ] ); $cfg = [ 'id_option' => $opt_theme, 'cfg' => json_encode(['theme' => $theme]) ]; if (!empty($id_bit) && Str::isUid($id_bit)) { if (!empty($this->pref->updateBit($id_bit, $cfg, true))) { return true; } } else { if (!empty($this->pref->addBit($pref, $cfg))) { return true; } } } } return false; }

Function for set preference theme for every single project BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way

This website uses cookies to ensure you get the best experience on our website.