Browse Source

Fix #738

pull/749/head
Timothée Jaussoin 7 years ago
parent
commit
ac662944ed
  1. 2
      CHANGELOG.md
  2. 1
      app/controllers/BlogController.php
  3. 1
      app/controllers/NodeController.php
  4. 1
      app/controllers/TagController.php
  5. 2
      app/views/page.tpl
  6. 2
      app/widgets/Blog/blog.tpl
  7. 1
      src/Movim/Controller/Base.php
  8. 31
      src/Movim/Template/Builder.php

2
CHANGELOG.md

@ -10,6 +10,8 @@ v0.14.1 (trunk)
* Don't reload the page when opening chat from Search
* Don't reload the discussion when the WS is reconnecting but only append the new messages
* Add slide-to-close feature in Chats to quickly close one-to-one discussions on touch devices
* Fix Onboarding issues on some devices
* Fix scrolling on iOS
v0.14
---------------------------

1
app/controllers/BlogController.php

@ -12,5 +12,6 @@ class BlogController extends Base
function dispatch()
{
$this->page->setTitle(__('page.blog'));
$this->page->disableJavascriptCheck();
}
}

1
app/controllers/NodeController.php

@ -13,5 +13,6 @@ class NodeController extends Base
function dispatch()
{
$this->page->setTitle(__('page.communities'));
$this->page->disableJavascriptCheck();
}
}

1
app/controllers/TagController.php

@ -12,5 +12,6 @@ class TagController extends Base
function dispatch()
{
$this->page->setTitle(__('page.tag'));
$this->page->disableJavascriptCheck();
}
}

2
app/views/page.tpl

@ -47,6 +47,7 @@
</head>
<body dir="<?php $this->dir();?>"
class="<?php if (!$this->public && \App\User::me()->nightmode) { ?>nightmode<?php } ?>">
<?php if ($this->js_check) { ?>
<noscript>
<style type="text/css">main {display: none;}</style>
<ul class="list" style="color: white;">
@ -55,6 +56,7 @@
</li>
</ul>
</noscript>
<?php } ?>
<div id="hiddendiv"></div>
<div id="snackbar" class="snackbar"></div>
<div id="error_websocket" class="snackbar hide">

2
app/widgets/Blog/blog.tpl

@ -39,7 +39,7 @@
</span>
{else}
<span class="primary icon gray">
<i class="material-icons">category</i>
<i class="material-icons">label</i>
</span>
{/if}
<p>

1
src/Movim/Controller/Base.php

@ -13,6 +13,7 @@ class Base
protected $session_only = false;// The page is protected by a session ?
protected $raw = false; // Display only the content ?
protected $public = false; // It's a public page
protected $js_check = true; // Check is Javascript is enabled
protected $page;
public function __construct()

31
src/Movim/Template/Builder.php

@ -16,6 +16,7 @@ class Builder
private $dir = 'ltr';
private $public;
private $user;
private $js_check = true;
/**
* Constructor. Determines whether to show the login page to the user or the
@ -27,7 +28,7 @@ class Builder
$this->user = \App\User::me();
}
function viewsPath($file)
function viewsPath(string $file)
{
return VIEWS_PATH . '/' . $file;
}
@ -37,21 +38,21 @@ class Builder
* @param file is the path to the file relative to the theme's root
* @param return optionally returns the link instead of printing it if set to true
*/
function linkFile($file, $return = false)
function linkFile(string $file, $return = false)
{
$path = urilize('themes/' . $this->theme . '/' . $file);
if ($return) {
return $path;
} else {
echo $path;
}
echo $path;
}
/**
* Inserts the link tag for a css file.
*/
function themeCss($file)
function themeCss(string $file)
{
echo '<link rel="stylesheet" href="'
. $this->linkFile($file, true) .
@ -61,7 +62,7 @@ class Builder
/**
* Actually generates the page from templates.
*/
function build($view, $public = false)
function build(string $view, $public = false)
{
$this->_view = $view;
$this->public = $public;
@ -87,11 +88,19 @@ class Builder
/**
* Sets the page's title.
*/
function setTitle($name)
function setTitle(string $name)
{
$this->title = APP_TITLE . ' – ' . $name;
}
/**
* Disable Javascript check
*/
function disableJavascriptCheck()
{
$this->js_check = false;
}
/**
* Displays the current title.
*/
@ -216,7 +225,7 @@ class Builder
echo strip_tags($dom->saveXML($dom->documentElement), '<meta><link>');
}
function addScript($script)
function addScript(string $script)
{
$this->scripts[] = urilize('app/assets/js/' . $script);
}
@ -224,7 +233,7 @@ class Builder
/**
* Inserts the link tag for a css file.
*/
function addCss($file)
function addCss(string $file)
{
$this->css[] = $this->linkFile('css/' . $file, true);
}
@ -264,7 +273,7 @@ class Builder
return $out;
}
function setContent($data)
function setContent(string $data)
{
$this->content .= $data;
}
@ -277,7 +286,7 @@ class Builder
/**
* Loads up a widget and prints it at the current place.
*/
function widget($name)
function widget(string $name)
{
$widgets = Wrapper::getInstance();
$widgets->setView($this->_view);

Loading…
Cancel
Save