Merge pull request #792 from ArthurHoaro/feature/private-filter-visual
Display private only filter as search criteria
This commit is contained in:
commit
9c5daad19c
7 changed files with 36 additions and 21 deletions
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
namespace Shaarli\Config;
|
||||
|
||||
use Shaarli\Config\Exception\PluginConfigOrderException;
|
||||
|
||||
/**
|
||||
* Plugin configuration helper functions.
|
||||
|
@ -110,17 +111,3 @@ function load_plugin_parameter_values($plugins, $conf)
|
|||
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Exception used if an error occur while saving plugin configuration.
|
||||
*/
|
||||
class PluginConfigOrderException extends \Exception
|
||||
{
|
||||
/**
|
||||
* Construct exception.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->message = 'An error occurred while trying to save plugins loading order.';
|
||||
}
|
||||
}
|
||||
|
|
17
application/config/exception/PluginConfigOrderException.php
Normal file
17
application/config/exception/PluginConfigOrderException.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Shaarli\Config\Exception;
|
||||
|
||||
/**
|
||||
* Exception used if an error occur while saving plugin configuration.
|
||||
*/
|
||||
class PluginConfigOrderException extends \Exception
|
||||
{
|
||||
/**
|
||||
* Construct exception.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->message = 'An error occurred while trying to save plugins loading order.';
|
||||
}
|
||||
}
|
|
@ -29,7 +29,8 @@
|
|||
"Shaarli\\Api\\": "application/api/",
|
||||
"Shaarli\\Api\\Controllers\\": "application/api/controllers",
|
||||
"Shaarli\\Api\\Exceptions\\": "application/api/exceptions",
|
||||
"Shaarli\\Config\\": "application/config/"
|
||||
"Shaarli\\Config\\": "application/config/",
|
||||
"Shaarli\\Config\\Exception\\": "application/config/exception"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,6 +62,7 @@
|
|||
require_once 'application/ApplicationUtils.php';
|
||||
require_once 'application/Cache.php';
|
||||
require_once 'application/CachedPage.php';
|
||||
require_once 'application/config/ConfigPlugin.php';
|
||||
require_once 'application/FeedBuilder.php';
|
||||
require_once 'application/FileUtils.php';
|
||||
require_once 'application/HttpUtils.php';
|
||||
|
@ -1681,6 +1682,7 @@ function buildLinkList($PAGE,$LINKSDB, $conf, $pluginManager)
|
|||
'result_count' => count($linksToDisplay),
|
||||
'search_term' => $searchterm,
|
||||
'search_tags' => $searchtags,
|
||||
'visibility' => ! empty($_SESSION['privateonly']) ? 'private' : '',
|
||||
'redirector' => $conf->get('redirector.url'), // Optional redirector URL.
|
||||
'links' => $linkDisp,
|
||||
'tags' => $LINKSDB->allTags(),
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
<?php
|
||||
namespace Shaarli\Config;
|
||||
|
||||
/**
|
||||
* Config' tests
|
||||
*/
|
||||
use Shaarli\Config\Exception\PluginConfigOrderException;
|
||||
|
||||
require_once 'application/config/ConfigPlugin.php';
|
||||
|
||||
|
@ -41,7 +39,7 @@ public function testSavePluginConfigValid()
|
|||
/**
|
||||
* Test save_plugin_config with invalid data.
|
||||
*
|
||||
* @expectedException Shaarli\Config\PluginConfigOrderException
|
||||
* @expectedException Shaarli\Config\Exception\PluginConfigOrderException
|
||||
*/
|
||||
public function testSavePluginConfigInvalid()
|
||||
{
|
||||
|
|
|
@ -985,6 +985,10 @@ div.awesomplete > ul {
|
|||
margin: 0 0 0 5px;
|
||||
}
|
||||
|
||||
.search-result .label-private {
|
||||
border: 1px solid white;
|
||||
}
|
||||
|
||||
/**
|
||||
* TOOLS
|
||||
*/
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
<div id="searchcriteria">{'Nothing found.'|t}</div>
|
||||
</div>
|
||||
</div>
|
||||
{elseif="!empty($search_term) or !empty($search_tags)"}
|
||||
{elseif="!empty($search_term) or !empty($search_tags) or !empty($visibility)"}
|
||||
<div class="pure-g pure-alert pure-alert-success search-result">
|
||||
<div class="pure-u-2-24"></div>
|
||||
<div class="pure-u-20-24">
|
||||
|
@ -106,6 +106,12 @@
|
|||
</span>
|
||||
{/loop}
|
||||
{/if}
|
||||
{if="!empty($visibility)"}
|
||||
{'with status'|t}
|
||||
<span class="label label-private">
|
||||
{$visibility|t}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
|
Loading…
Reference in a new issue