WordPress Plugin - Notice: Undefined index error - php

I'm playing around with a plugin that's a little out of date and trying to get it back up to standard but I've hit a brick wall. On line #25 of the php script below, it's throwing a Notice: Undefined index: zip_path error for if($entry['zip_path']){.
What's even more strange is that it's working on a couple of my domains but not on others. It might be worthwhile adding that the 'other' websites are hosted on external servers to the one I've been testing it on.
Can anyone provide some insight into why I'm receiving this Undefined index error?
<?php defined('ABSPATH') or die("No direct access allowed.");
require_once __DIR__ . '/vendor/autoload.php';
if (class_exists("GFForms") && !class_exists("GFBulkDownload")) {
class GFBulkDownload {
protected $name = 'Gravity Forms Bulk Download';
protected $version = '1.0';
public function __construct() {
add_action("admin_enqueue_scripts", array($this, 'addStyles'));
add_action("gform_entry_created", array($this, 'afterSubmission'), 1, 2);
add_action("gform_pre_submission_filter", array($this, 'preSubmissionFilter'), 10, 1);
add_action("gform_entries_column_filter", array($this, 'change_column_data'), 10, 5);
add_filter('gform_custom_merge_tags', array($this, 'custom_merge_tags'), 10, 4);
add_filter('gform_replace_merge_tags', array($this, 'replace_download_link'), 10, 7);
add_action("gform_entry_detail", array($this, 'addMetaToDetails'), 10, 2);
add_filter('gform_notification', array($this, 'before_email'), 10, 3);
}
function before_email( $notification, $form, $entry ) {
$site = trailingslashit(get_bloginfo('url'));
if($entry['zip_path']){
$url = $site.$entry['zip_path'];
$notification['message'] .= "\n\n <a href='{$url}' >Download All Files in Zip</a>";
}
return $notification;
}
public function addStyles(){
wp_register_style('gform_bulk_download_css', plugin_dir_url(__FILE__).'assets/css/style.css');
wp_enqueue_style('gform_bulk_download_css');
}
public function addScripts(){
}
function addMetaToDetails($form, $entry){
$zip = gform_get_meta($entry['id'], 'zip_path');
if($zip){
$site_url = trailingslashit(get_bloginfo('url'));
$url = $site_url.$zip;
echo "<table cellspacing='0' class='widefat fixed entry-detail-view'>
<tr>
<td colspan='2' class='entry-view-field-name' >Zip File Download Link</td>
</tr>
<tr>
<td colspan='2' class='entry-view-field-value lastrow'>
<a class='gfbd-btn' style='margin-left:0;' href='{$url}'> Download All Files Zip <i class='fa fa-download'> </i></a>
</td>
</tr>
</table>";
}
}
public function preSubmissionFilter($form) {
//Get upload path for form
$form_upload_dir = GFFormsModel::get_upload_path($form['id']);
//strip everything up to wp-content/.... so we can build a url
$form_upload_dir_formatted = stristr($form_upload_dir, 'wp-content/');
//decode json and remove slashes to get list of files
$files_for_zip = json_decode(stripslashes($_POST['gform_uploaded_files']), true);
if(!is_null($files_for_zip)){
//reset the array pointer
reset($files_for_zip);
// get the key of the first element (This is due to the format of the array )
$key = key($files_for_zip);
$zipArray = $files_for_zip[$key];
$zip = new ZipArchive();
$filename = 'files_' . md5(rand(0123456, 7890123)) . '.zip';
$file_path = trailingslashit($form_upload_dir) . $filename;
$zip->open($file_path, ZipArchive::CREATE);
foreach($zipArray as $file_info){
$zip->addFile($form_upload_dir . '/tmp/' . $file_info['temp_filename'], $file_info['uploaded_filename']);
}
$zip->close();
//Set the zip key for the $form object to the url for the zip file we created, minus the domainname so we can pass it to the entry
$form['zip'] = trailingslashit($form_upload_dir_formatted) . $filename;
}
return $form;
}
public function afterSubmission($entry, $form) {
//update the Entry with a zip_file meta field with a link to the zip file that was created.
if (isset($form['zip'])) {
gform_update_meta($entry['id'], 'zip_path', $form['zip']);
}
}
function change_column_data($value, $form_id, $field_id, $lead, $query_string) {
$form = GFFormsModel::get_form_meta($form_id);
$zip_path = gform_get_meta($lead['id'], 'zip_path');
$site_url = get_bloginfo('url');
$full_url = trailingslashit($site_url) . $zip_path;
foreach ($form['fields'] as $field) {
if ($field['type'] == 'fileupload' && $field['multipleFiles'] == "1") {
$upload_field_id = $field['id'];
}
}
if ($upload_field_id == $field_id) {
if (!empty($zip_path)) {
return $value . " <a class='gfbd-btn' href='$full_url'> Download All <i class='fa fa-download'> </i></a>";
}
}
return $value;
}
function custom_merge_tags($merge_tags, $form_id, $fields, $element_id) {
$merge_tags[] = array('label' => 'Download All Files (Zip)', 'tag' => '{download_all_files_zip}');
return $merge_tags;
}
function replace_download_link($text, $form, $entry, $url_encode, $esc_html, $nl2br, $format) {
$custom_merge_tag = '{download_all_files_zip}';
if (strpos($text, $custom_merge_tag) === false) {
return $text;
} else {
$zip_path = gform_get_meta($entry['id'], 'zip_path');
$full_url = trailingslashit(get_bloginfo('url')) . $zip_path;
return str_replace($custom_merge_tag, $full_url, $text);
}
}
}
new GFBulkDownload();
}
Thank you in advance.

Related

how to get an uploaded file path in moodle

I created a new activity and i uploaded a file correctly within it but when i used
$url = moodle_url::make_pluginfile_url($file->contextid, $file->component, $file->filearea, $file->itemid,$file->filepath, $file->filename);
to get the link the result is : Sorry, the requested file could not be found
I searched an I find that I have to add a pluginfile function in my lib and this is my function :
function testnew_pluginfile($course, $cm, $context, $component, $filearea, $itemid, $path, $filename) {
global $CFG, $DB;
require_course_login($course, true, $cm);
$fullpath = "/{$context->id}/$component/$filearea/$itemid/$path/$filename";
$fs = get_file_storage();
if (!$file = $fs->get_file_by_hash(sha1($fullpath))) {
return false;
}
send_stored_file($file, 0, 0, false);
}
The problem is the context id didn't came true. so I added my add_instance function to add a new context id in mdl_files table. This is my function:
function testnew_add_instance($data){
global $DB;
$cmid = $data->coursemodule;
$data->timemodified =time();
$data->id = $DB->insert_record('testnew', $data);
$DB->set_field('course_modules', 'instance', $data->id, array('id'=>$cmid));
$fs = get_file_storage();
$draftitemid = $data->type;
$context = context_module::instance($cmid);
file_save_draft_area_files($draftitemid, $context->id, 'mod_testnew', 'content', 0);
$files = $fs->get_area_files($context->id, 'mod_testnew', 'content', 0, 'sortorder', false);
if (count($files) == 1) {
// only one file attached, set it as main file automatically
$file = reset($files);
file_set_sortorder($context->id, 'mod_testnew', 'content', 0, $file->get_filepath(), $file->get_filename(), 1);
}
return $data->id;
}

SS_HTTPRequest could not be converted to a string

I have a SilverStripe (3.4) Page with a form that would work if I didn't have a DataObject in it.
public function AntwortForm($ID) {
$Nummer = Vortest_Fragen::get()->byID($ID);
if ($Nummer) {
$Art=$Nummer->Art;
}
if ($Art == 'Normal') {
$fields = new FieldList(
TextAreaField::create('Antwort'),
HiddenField::create('ID', 'ID', $ID),
HiddenField::create('VortestID', 'VortestID', $this->request->param('ID')),
HiddenField::create('Aktion', 'Aktion', $this->request->param('Action'))
);
} else {
$Optionen = explode(';', $Nummer->Optionen);
$a = 'A';
for ( $i = 0 ; $i < count ($Optionen); $i++) {
$Op[$a] ='<div style="width:25px;display:inline;">' . $a . ')</div> ' . $Optionen[$i];
$a++;
}
$fields = new FieldList(
CheckboxSetField::create('Antwort', 'Antwort', $Op),
HiddenField::create('ID', 'ID', $ID),
HiddenField::create('VortestID', 'VortestID', $this->request->param('ID')),
HiddenField::create('Aktion', 'Aktion',$this->request->param('Action')),
HiddenField::create('Art', 'Art', $Nummer->Art)
);
}
$actions = new FieldList(
FormAction::create('AntwortEintragen', 'Eintragen')
);
$form = new Form($this, 'AntwortForm', $fields, $actions);
return $form;
}
function AntwortEintragen($data, $form) {
$Antwort = Vortest_Antwort::get()->filter(array('FrageID' => $data['ID'], 'SchreiberID' => Member::currentUserID()));
foreach($Antwort as $item) {
$item->delete();
}
foreach ($data['Antwort'] as $Antwort) {
$Ant .= $Antwort . ',';
}
$Antwort = new Vortest_Antwort();
if ($data['Antwort']) {
$form->saveInto($Antwort);
if ($data['Art'] == 'Mechanics') {
$Antwort->Antwort = $Ant;
}
$Antwort->SchreiberID = Member::currentUserID();
$Antwort->FrageID = $data['ID'];
$Antwort->write();
}
$VID = $data['VortestID'];
if ($data['Aktion'] == 'AlleFragen') {
$this->redirect('/vortest/AlleFragen/' . $VID . '#' . $data['FrageNr']);
} elseif ($data['Aktion'] == 'Einzelfrage') {
$this->redirect('/vortest/Einzelfrage/' . $VID);
} else {
$this->redirect('/vortest/Test/' . $VID.'#' . $data['FrageNr']);
}
}
It works when I change the $ID to a number in this line $Nummer = Vortest_Fragen::get()->byID($ID);
When I don't change it I get the following error:
[Recoverable Error] Object of class SS_HTTPRequest could not be converted to string
How do I fix this problem?
Althought it is not clearly documented, Silverstripe secretly passes a request argument to and form methods on a controller. Your $ID argument is actually not what you think it is, you will find it is actually an SS_HTTPRequest object that Silverstripe has passed (without you realising).
To fix this, change the first line:
public function AntwortForm($ID) {
To:
public function AntwortForm($request, $ID) {
And make sure you update anywhere that you call this method :-)

Call to undefined method Config::getConfig()

I'm testing the Flexpaper plugin on Windows XP running with XAMP, the issue is that it doesn't shows the pdf's, checking the php error log it says:
PHP Fatal error: Call to undefined method Config::getConfig() in
C:\xampp\htdocs\PDFViewer\php\services\view.php on line 24
The folder structure is: (omitting irrelevant files)
htdocs/
|->PDFViewer/
|->php/
|->admin_files/
|->config/
|->config.ini.win.php
|->lib/
|->common.php
|->pdf2json_php5.php
|->pdf2swf_php5.php
|->config.php
|->services/
|->view.php
Snippet of code of view.php
require_once("../lib/common.php");
require_once("../lib/pdf2swf_php5.php");
require_once("../lib/swfrender_php5.php");
require_once("../lib/pdf2json_php5.php");
Snippet of code of pdf2json_php5.php
require_once("config.php");
require_once("common.php");
Snippet of code of pdf2swf_php5.php
require_once("config.php");
require_once("common.php");
Snippet of code of swfrender_php5.php
require_once("config.php");
require_once("common.php");
And before you ask, yes, config.php do have the getConfig method
Edit: Added the config.php
<?php date_default_timezone_set('America/New_York'); ?>
<?php
class Config{
protected $config;
public function __construct()
{
if (!defined('ROOT')) {
define('ROOT', dirname(dirname(dirname(__FILE__))));
}
if (!defined('APP_DIR')) {
define('APP_DIR', basename(dirname(dirname(__FILE__))));
}
if( PHP_OS == "WIN32" || PHP_OS == "WINNT" )
$this->config = parse_ini_file($this->getConfigFilename());
else
$this->config = parse_ini_file($this->getConfigFilename());
}
public function getConfigDir(){
if( PHP_OS == "WIN32" || PHP_OS == "WINNT" )
return dirname(__FILE__) . '\\..\\config';
else
return dirname(__FILE__) . '/../config';
}
public function getConfigs(){
return $this->config;
}
public function getConfig($key = null)
{
if($key !== null)
{
if(isset($this->config[$key]))
{
return $this->config[$key];
}
else
{
return null;
}
}
else
{
return $this->config;
}
}
public function setConfig($config)
{
$this->config = $config;
}
public function getDocUrl(){
return "<br/><br/>Click <a href='http://flexpaper.devaldi.com/docs_php.jsp'>here</a> for more information on configuring FlexPaper with PHP";
}
public function getConfigFilename(){
if( PHP_OS == "WIN32" || PHP_OS == "WINNT" )
return ROOT . '\\' . APP_DIR . '\\config\\config.ini.win.php';
else
return ROOT . '/' . APP_DIR . '/config/config.ini.nix.php';
}
public function saveConfig($array){
$this->write_php_ini($array,$this->getConfigFilename());
}
function write_php_ini($array, $file)
{
$res = array();
foreach($array as $key => $val)
{
if(is_array($val))
{
$res[] = "[$key]";
foreach($val as $skey => $sval) {
$sval = str_replace("\"","\\\"",$sval);
$res[] = "$skey = ".(is_numeric($sval) ? $sval : '"'.$sval.'"');
}
}
else {
$val = str_replace("\"","\\\"",$val);
$res[] = "$key = ".(is_numeric($val) ? $val : '"'.$val.'"');
}
}
$this->safefilerewrite($file, implode("\r\n", $res));
}
function safefilerewrite($fileName, $dataToSave)
{
$dataToSave = "; <?php exit; ?> DO NOT REMOVE THIS LINE\r\n" . $dataToSave;
if ($fp = fopen($fileName, 'w'))
{
$startTime = microtime();
do
{
$canWrite = flock($fp, LOCK_EX);
// If lock not obtained sleep for 0 - 100 milliseconds, to avoid collision and CPU load
if(!$canWrite) usleep(round(rand(0, 100)*1000));
} while ((!$canWrite)and((microtime()-$startTime) < 1000));
//file was locked so now we can store information
if ($canWrite)
{ fwrite($fp, $dataToSave);
flock($fp, LOCK_UN);
}
fclose($fp);
}else{
throw new Exception('Cant write to config ' . $fileName);
}
}
}
Modify the code snippet of view.php into:
$ds = DIRECTORY_SEPARATOR;
require_once("..{$ds}lib{$ds}common.php");
require_once("..{$ds}lib{$ds}pdf2swf_php5.php");
require_once("..{$ds}lib{$ds}swfrender_php5.php");
require_once("..{$ds}lib{$ds}pdf2json_php5.php");
Looks like I've made it work after adding C:/xampp/htdocs to the include_path variable in php.ini, and then just modified the require_once functions.
require_once section in View.php looks like:
require_once("PDFViewer/php/lib/common.php");
require_once("PDFViewer/php/lib/pdf2swf_php5.php");
require_once("PDFViewer/php/lib/swfrender_php5.php");
require_once("PDFViewer/php/lib/pdf2json_php5.php");
And the same for pdf2swf_php5.php, swfrender_php5.php and pdf2json_php5.php.

Pass MySQL Variable to Joomla Module instead of using default field for Twitter Search

It seems I've hit a wall here and could use some help
Would like to pass a MySql variable to a Joomla Module
Im using Yootheme's Widget-kit to display tweets from a search term. Works great and all but you need to enter the twitter search term in the Module back end.
Instead I would like to use a variable ( already used on the page) and pass that variable to the Twitter module so it can display the tweets I want
Here are some lines of PHP with the variable I'd like to use
$document->setTitle(JText::sprintf('COVERAGE_DATA_PLACE', $this->country->country_name, $this->city->city_name));
$text = JString::str_ireplace('%city_name%',$this->city->city_name,$text);
$this->setBreadcrumbs(array('country','city'));
Is there any way to take the "City" variable and send it to the 'word" field found in the twitter module?
Here is the Code for the twitter module
<?php
Class: TwitterWidgetkitHelper
Twitter helper class
*/
class TwitterWidgetkitHelper extends WidgetkitHelper {
/* type */
public $type;
/* options */
public $options;
/*
Function: Constructor
Class Constructor.
*/
public function __construct($widgetkit) {
parent::__construct($widgetkit);
// init vars
$this->type = strtolower(str_replace('WidgetkitHelper', '', get_class($this)));
$this->options = $this['system']->options;
// create cache
$cache = $this['path']->path('cache:');
if ($cache && !file_exists($cache.'/twitter')) {
mkdir($cache.'/twitter', 0777, true);
}
// register path
$this['path']->register(dirname(__FILE__), $this->type);
}
/*
Function: site
Site init actions
Returns:
Void
*/
public function site() {
// add translations
foreach (array('LESS_THAN_A_MINUTE_AGO', 'ABOUT_A_MINUTE_AGO', 'X_MINUTES_AGO', 'ABOUT_AN_HOUR_AGO', 'X_HOURS_AGO', 'ONE_DAY_AGO', 'X_DAYS_AGO') as $key) {
$translations[$key] = $this['system']->__($key);
}
// add stylesheets/javascripts
$this['asset']->addFile('css', 'twitter:styles/style.css');
$this['asset']->addFile('js', 'twitter:twitter.js');
$this['asset']->addString('js', sprintf('jQuery.trans.addDic(%s);', json_encode($translations)));
// rtl
if ($this['system']->options->get('direction') == 'rtl') {
$this['asset']->addFile('css', 'twitter:styles/rtl.css');
}
}
/*
Function: render
Render widget on site
Returns:
String
*/
public function render($options) {
if ($tweets = $this->_getTweets($options)) {
// get options
extract($options);
return $this['template']->render("twitter:styles/$style/template", compact('tweets', 'show_image', 'show_author', 'show_date', 'image_size'));
}
return 'No tweets found.';
}
/*
Function: _getURL
Create Twitter Query URL
Returns:
String
*/
protected function _getURL($options) {
// get options
extract($options);
// clean options
foreach (array('from_user', 'to_user', 'ref_user', 'word', 'nots', 'hashtag') as $var) {
$$var = preg_replace('/[##]/', '', preg_replace('/\s+/', ' ', trim($$var)));
}
// build query
$query = array();
if ($from_user) {
$query[] = 'from:'.str_replace(' ', ' OR from:', $from_user);
}
if ($to_user) {
$query[] = 'to:'.str_replace(' ', ' OR to:', $to_user);
}
if ($ref_user) {
$query[] = '#'.str_replace(' ', ' #', $ref_user);
}
if ($word) {
$query[] = $word;
}
if ($nots) {
$query[] = '-'.str_replace(' ', ' -', $nots);
}
if ($hashtag) {
$query[] = '#'.str_replace(' ', ' #', $hashtag);
}
$limit = min($limit ? intval($limit) : 5, 100);
// build timeline url
if ($from_user && !strpos($from_user, ' ') && count($query) == 1) {
$url = 'http://twitter.com/statuses/user_timeline/'.strtolower($from_user).'.json';
if ($limit > 15) {
$url .= '?count='.$limit;
}
return $url;
}
// build search url
if (count($query)) {
$url = 'http://search.twitter.com/search.json?q='.urlencode(implode(' ', $query));
if ($limit > 15) {
$url .= '&rpp='.$limit;
}
return $url;
}
return null;
}
/*
Function: _getTweets
Get Tweet Object Array
Returns:
Array
*/
protected function _getTweets($options) {
// init vars
$tweets = array();
// query twitter
if ($url = $this->_getURL($options)) {
if ($path = $this['path']->path('cache:twitter')) {
$file = rtrim($path, '/').sprintf('/twitter-%s.php', md5($url));
// is cached ?
if (file_exists($file)) {
$response = file_get_contents($file);
}
// refresh cache ?
if (!file_exists($file) || (time() - filemtime($file)) > 300) {
// send query
$request = $this['http']->get($url);
if (isset($request['status']['code']) && $request['status']['code'] == 200) {
$response = $request['body'];
file_put_contents($file, $response);
}
}
}
}
// create tweets
if (isset($response)) {
$response = json_decode($response, true);
if (is_array($response)) {
if (isset($response['results'])) {
foreach ($response['results'] as $res) {
$tweet = new WidgetkitTweet();
$tweet->user = $res['from_user'];
$tweet->name = $res['from_user'];
$tweet->image = $res['profile_image_url'];
$tweet->text = $res['text'];
$tweet->created_at = $res['created_at'];
$tweets[] = $tweet;
}
} else {
foreach ($response as $res) {
$tweet = new WidgetkitTweet();
$tweet->user = $res['user']['screen_name'];
$tweet->name = $res['user']['name'];
$tweet->image = $res['user']['profile_image_url'];
$tweet->text = $res['text'];
$tweet->created_at = $res['created_at'];
$tweets[] = $tweet;
}
}
}
}
return array_slice($tweets, 0, $options['limit'] ? intval($options['limit']) : 5);
}
}
class WidgetkitTweet {
public $user;
public $name;
public $image;
public $text;
public $created_at;
public function getLink() {
return 'http://twitter.com/'.$this->user;
}
public function getText() {
// format text
$text = preg_replace('#(https?://([-\w\.]+)+(/([\w/_\.]*(\?\S+)?(#\S+)?)?)?)#', '$1', $this->text);
$text = preg_replace('/#(\w+)/', '#$1', $text);
$text = preg_replace('/\s+#(\w+)/', ' #$1', $text);
return $text;
}
}
// bind events
$widgetkit = Widgetkit::getInstance();
$widgetkit['event']->bind('site', array($widgetkit['twitter'], 'site'));
I believe you can do what you want with this:
http://www.j-plant.com/joomla-extensions/free-extensions/26-module-plant.html
This plugin supports module parameters overriding. Use the next code
for overriding parameters:
[moduleplant id="77" <param_name_1>="<param_value_1>" <param_name_N>="<param_value_N>"]
replace and with the necessary parameter name and value.
You can override as many parameters as you want.
Available module parameters can be found in module XML manifest
file. A manifest file is usually located in the next path:
modules/<module_type>/<module_type>.xml

Opencart: CSS (based on route maintenance)

This is my first question here. I'm using Opencart for my webshop. For the looks i'm styling the CSS of my pages e.g. account_login.css. But i also want to do the Maintenance page. I already made the common_maintenance.css file. But when i'm testing my site isn't displaying correct. It is just showing http://www.mywebsite.com instead of http://www.mywebsite.com/index.php?route=common/maintenance. Please can somebody help me with this?
<?php
class ControllerCommonMaintenance extends Controller {
public function index() {
if ($this->config->get('config_maintenance')) { $route = '';
if (isset($this->request->get['route'])) {
$part = explode('/', $this->request->get['route']);
if (isset($part[0])) {
$route .= $part[0];
} }
// Show site if logged in as admin $this->load->library('user');
$this->user = new User($this->registry);
if (($route != 'payment') && !$this->user->isLogged()) {
return $this->forward('common/maintenance/info'); }
}
}
public function info() {
$this->load->language('common/maintenance');
$this->document->setTitle($this->language->get('heading_title'));
$this->data['heading_title'] = $this->language->get('heading_title');
$this->document->breadcrumbs = array();
$this->document->breadcrumbs[] = array(
'text' => $this->language->get('text_maintenance'), 'href' => $this->url->link('common/maintenance'),
'separator' => false
);
$this->data['message'] = $this->language->get('text_message');
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') .
'/template/common/maintenance.tpl')) {
$this->template = $this->config->get('config_template') . '/template/common/maintenance.tpl';
} else {
$this->template = 'default/template/common/maintenance.tpl'; }
$this->children = array( 'common/footer', 'common/header' );
$this->response->setOutput($this->render());
} } ?>
I've fixed the hideous formatting, and added the call to the ->addStyle($css). If the code does not work yet, please check if I got the path to the CSS right (where it says $css = 'blahblah' );
<?php
class ControllerCommonMaintenance extends Controller {
public function index() {
if ($this->config->get('config_maintenance')) {
$route = '';
if (isset($this->request->get['route'])) {
$part = explode('/', $this->request->get['route']);
if (isset($part[0])) {
$route .= $part[0];
}
}
// Show site if logged in as admin
// $this->load->library('user');
$this->user = new User($this->registry);
if (($route != 'payment') && !$this->user->isLogged()) {
return $this->forward('common/maintenance/info');
}
}
}
public function info() {
$this->load->language('common/maintenance');
$this->document->setTitle($this->language->get('heading_title'));
$css = 'catalog/view/theme/' . $this->config->get('config_template') . '/stylesheet/common_maintenance.css';
$this->document->addStyle($css);
$this->data['heading_title'] = $this->language->get('heading_title');
$this->document->breadcrumbs = array();
$this->document->breadcrumbs[] = array(
'text' => $this->language->get('text_maintenance'),
'href' => $this->url->link('common/maintenance'),
'separator' => false
);
$this->data['message'] = $this->language->get('text_message');
$maintenance = $this->config->get('config_template') . '/template/common/maintenance.tpl';
if (file_exists(DIR_TEMPLATE . $maintenance ) ) {
$this->template = $maintenance;
}
else {
$this->template = 'default/template/common/maintenance.tpl'; }
$this->children = array(
'common/footer',
'common/header'
);
$this->response->setOutput($this->render());
}
}
}
The problem is you're using the route, which the maintenance mode doesn't change when it's in maintenance mode. What you need to do is specifically add that stylesheet in the maintenance controller using the $this->document->addStyle() method

Categories