X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=doc%2Fthemes.md;h=60f4fdb96d288ca00417578bc9d149181dc4e86c;hb=19155a4bb2d3f0d3935286fbb5a97333150e7dc9;hp=f50ea791da08fefde2293747724f345a47e2612a;hpb=5dfee31108fc92a7abca5f99b8fdf1b34aec5dd5;p=friendica.git diff --git a/doc/themes.md b/doc/themes.md index f50ea791da..60f4fdb96d 100644 --- a/doc/themes.md +++ b/doc/themes.md @@ -3,8 +3,8 @@ * [Home](help) To change the look of friendica you have to touch the themes. -The current default theme is [Vier](https://github.com/friendica/friendica/tree/master/view/theme/vier) but there are numerous others. -Have a look at [friendica-themes.com](http://friendica-themes.com) for an overview of the existing themes. +The current default theme is [Vier](https://github.com/friendica/friendica/tree/stable/view/theme/vier) but there are numerous others. +Have a look at [github.com/bkil/friendica-themes](https://github.com/bkil/friendica-themes) for an overview of the existing themes. In case none of them suits your needs, there are several ways to change a theme. So, how to work on the UI of friendica. @@ -123,13 +123,13 @@ The selected 1st part will be saved in the database by the theme_post function. function theme_post(App $a){ // non local users shall not pass - if (! local_user()) { + if (!Session::getLocalUser()) { return; } // if the one specific submit button was pressed then proceed if (isset($_POST['duepuntozero-settings-submit'])){ // and save the selection key into the personal config of the user - DI::pConfig()->set(local_user(), 'duepuntozero', 'colorset', $_POST['duepuntozero_colorset']); + DI::pConfig()->set(Session::getLocalUser(), 'duepuntozero', 'colorset', $_POST['duepuntozero_colorset']); } } @@ -137,9 +137,9 @@ Now that this information is set in the database, what should friendica do with For this, have a look at the theme.php file of the *duepunto zero*. There you'll find somethink alike - $colorset = DI::pConfig()->get( local_user(), 'duepuntozero','colorset'); + $colorset = DI::pConfig()->get(Session::getLocalUser(), 'duepuntozero','colorset'); if (!$colorset) - $colorset = Config::get('duepuntozero', 'colorset'); + $colorset = DI::config()->get('duepuntozero', 'colorset'); if ($colorset) { if ($colorset == 'greenzero') DI::page()['htmlhead'] .= ''."\n"; @@ -170,9 +170,8 @@ The content of this file should be something like use Friendica\App; function duepuntozero_lr_init(App $a) { - $a-> theme_info = array( - 'extends' => 'duepuntozero'. - ); + $a->setThemeInfoValue('extends', 'duepuntozero'); + $a->set_template_engine('smarty3'); /* and more stuff e.g. the JavaScript function for the header */ } @@ -272,9 +271,7 @@ If you like to use another templating engine, please implement it. When you want to inherit stuff from another theme you have to *announce* this in the theme_info: - $a->theme_info = array( - 'extends' => 'duepuntozero', - ); + $a->setThemeInfoValue('extends', 'duepuntozero'); which declares *duepuntozero* as parent of the theme.