Merge pull request #5041 from M-arcus/patch-1
[TASK] Automatic installation: Install theme
This commit is contained in:
commit
288b508e2a
|
@ -167,6 +167,8 @@ The content of this file should be something like
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
/* meta informations for the theme, see below */
|
/* meta informations for the theme, see below */
|
||||||
|
use Friendica\App;
|
||||||
|
|
||||||
function duepuntozero_lr_init(App $a) {
|
function duepuntozero_lr_init(App $a) {
|
||||||
$a-> theme_info = array(
|
$a-> theme_info = array(
|
||||||
'extends' => 'duepuntozero'.
|
'extends' => 'duepuntozero'.
|
||||||
|
@ -246,6 +248,12 @@ These three pieces of information should be listed.
|
||||||
If the original author is no longer working on the theme, but a maintainer has taken over, the maintainer should be listed as well.
|
If the original author is no longer working on the theme, but a maintainer has taken over, the maintainer should be listed as well.
|
||||||
The information from the theme header will be displayed in the admin panel.
|
The information from the theme header will be displayed in the admin panel.
|
||||||
|
|
||||||
|
The first thing in file is to import the `App` class from `\Friendica\` namespace.
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
|
|
||||||
|
This will make our job a little easier, as we don't have to specify the full name every time we need to use the `App` class.
|
||||||
|
|
||||||
The next crucial part of the theme.php file is a definition of an init function.
|
The next crucial part of the theme.php file is a definition of an init function.
|
||||||
The name of the function is <theme-name>_init.
|
The name of the function is <theme-name>_init.
|
||||||
So in the case of quattro it is
|
So in the case of quattro it is
|
||||||
|
|
|
@ -6,6 +6,7 @@ use Asika\SimpleConsole\Console;
|
||||||
use dba;
|
use dba;
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Core\Install;
|
use Friendica\Core\Install;
|
||||||
|
use Friendica\Core\Theme;
|
||||||
|
|
||||||
require_once 'mod/install.php';
|
require_once 'mod/install.php';
|
||||||
require_once 'include/dba.php';
|
require_once 'include/dba.php';
|
||||||
|
@ -90,6 +91,15 @@ HELP;
|
||||||
|
|
||||||
$this->out(" Complete!\n\n");
|
$this->out(" Complete!\n\n");
|
||||||
|
|
||||||
|
// Install theme
|
||||||
|
$this->out("Installing theme\n");
|
||||||
|
if (!empty($a->config['system']['theme'])) {
|
||||||
|
Theme::install($a->config['system']['theme']);
|
||||||
|
$this->out(" Complete\n\n");
|
||||||
|
} else {
|
||||||
|
$this->out(" Theme setting is empty. Please check the file htconfig.php\n\n");
|
||||||
|
}
|
||||||
|
|
||||||
// Copy config file
|
// Copy config file
|
||||||
$this->out("Saving config file...\n");
|
$this->out("Saving config file...\n");
|
||||||
if ($config_file != '.htconfig.php' && !copy($config_file, '.htconfig.php')) {
|
if ($config_file != '.htconfig.php' && !copy($config_file, '.htconfig.php')) {
|
||||||
|
|
Loading…
Reference in a new issue