smartymarkup - Consistence changes
This commit is contained in:
parent
1caafa18b2
commit
0e4de59153
|
@ -1,3 +1,7 @@
|
|||
1.14:
|
||||
----
|
||||
* Consistence changes
|
||||
|
||||
1.13:
|
||||
----
|
||||
* try/catch Exception to not break the flow
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
# lang_cs.inc.php 1.2 2012-02-02 20:46:40 VladaAjgl $
|
||||
|
||||
/**
|
||||
* @version 1.2
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
# lang_cz.inc.php 1.2 2012-02-02 20:46:38 VladaAjgl $
|
||||
|
||||
/**
|
||||
* @version 1.2
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
# lang_cs.inc.php 1.2 2012-02-02 20:46:40 VladaAjgl $
|
||||
|
||||
/**
|
||||
* @version 1.2
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
# lang_cz.inc.php 1.2 2012-02-02 20:46:38 VladaAjgl $
|
||||
|
||||
/**
|
||||
* @version 1.2
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @version $Revision$
|
||||
* @version
|
||||
* @author Translator Name <yourmail@example.com>
|
||||
* EN-Revision: Revision of lang_en.inc.php
|
||||
*/
|
||||
|
|
|
@ -19,7 +19,7 @@ class serendipity_event_smartymarkup extends serendipity_event
|
|||
$propbag->add('description', PLUGIN_EVENT_SMARTYMARKUP_DESC);
|
||||
$propbag->add('stackable', false);
|
||||
$propbag->add('author', 'Garvin Hicking');
|
||||
$propbag->add('version', '1.13');
|
||||
$propbag->add('version', '1.14');
|
||||
$propbag->add('requirements', array(
|
||||
'serendipity' => '1.7',
|
||||
'smarty' => '3.1.0',
|
||||
|
@ -63,16 +63,19 @@ class serendipity_event_smartymarkup extends serendipity_event
|
|||
$propbag->add('configuration', $conf_array);
|
||||
}
|
||||
|
||||
function install() {
|
||||
function install()
|
||||
{
|
||||
serendipity_plugin_api::hook_event('backend_cache_entries', $this->title);
|
||||
}
|
||||
|
||||
function uninstall(&$propbag) {
|
||||
function uninstall(&$propbag)
|
||||
{
|
||||
serendipity_plugin_api::hook_event('backend_cache_purge', $this->title);
|
||||
serendipity_plugin_api::hook_event('backend_cache_entries', $this->title);
|
||||
}
|
||||
|
||||
function generate_content(&$title) {
|
||||
function generate_content(&$title)
|
||||
{
|
||||
$title = $this->title;
|
||||
}
|
||||
|
||||
|
@ -85,7 +88,8 @@ class serendipity_event_smartymarkup extends serendipity_event
|
|||
return true;
|
||||
}
|
||||
|
||||
function smarty_resource_smartymarkupplugin_template($tpl_name, &$tpl_source) {
|
||||
function smarty_resource_smartymarkupplugin_template($tpl_name, &$tpl_source)
|
||||
{
|
||||
global $serendipity;
|
||||
|
||||
// return the template content via referenced argument
|
||||
|
@ -98,21 +102,25 @@ class serendipity_event_smartymarkup extends serendipity_event
|
|||
return true;
|
||||
}
|
||||
|
||||
function smarty_resource_smartymarkupplugin_timestamp($tpl_name, &$tpl_timestamp) {
|
||||
function smarty_resource_smartymarkupplugin_timestamp($tpl_name, &$tpl_timestamp)
|
||||
{
|
||||
global $serendipity;
|
||||
|
||||
$tpl_timestamp = crc32($serendipity['plugindata']['smartymarkupplugin']);
|
||||
return true;
|
||||
}
|
||||
|
||||
function smarty_resource_smartymarkupplugin_secure($tpl_name) {
|
||||
function smarty_resource_smartymarkupplugin_secure($tpl_name)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
function smarty_resource_smartymarkupplugin_trusted($tpl_name) {
|
||||
function smarty_resource_smartymarkupplugin_trusted($tpl_name)
|
||||
{
|
||||
}
|
||||
|
||||
function smartymarkup($input, &$eventData) {
|
||||
function smartymarkup($input, &$eventData)
|
||||
{
|
||||
global $serendipity;
|
||||
|
||||
if (!isset($serendipity['smarty'])) {
|
||||
|
@ -136,13 +144,16 @@ class serendipity_event_smartymarkup extends serendipity_event
|
|||
}
|
||||
}
|
||||
|
||||
function event_hook($event, &$bag, &$eventData, $addData=null) {
|
||||
function event_hook($event, &$bag, &$eventData, $addData=null)
|
||||
{
|
||||
global $serendipity;
|
||||
|
||||
$hooks = &$bag->get('event_hooks');
|
||||
|
||||
if (isset($hooks[$event])) {
|
||||
|
||||
switch($event) {
|
||||
|
||||
case 'frontend_display':
|
||||
|
||||
if ($_GET['serendipity']['is_iframe'] == 'true' && $_GET['serendipity']['iframe_mode'] == 'save') {
|
||||
|
@ -157,7 +168,8 @@ class serendipity_event_smartymarkup extends serendipity_event
|
|||
foreach ($this->markup_elements as $temp) {
|
||||
if (serendipity_db_bool($this->get_config($temp['name'], true)) && isset($eventData[$temp['element']]) &&
|
||||
!$eventData['properties']['ep_disable_markup_' . $this->instance] &&
|
||||
!isset($serendipity['POST']['properties']['disable_markup_' . $this->instance])) {
|
||||
!isset($serendipity['POST']['properties']['disable_markup_' . $this->instance]))
|
||||
{
|
||||
|
||||
if (isset($eventData['ctitle']) && $temp['element'] == 'body') {
|
||||
// s9y doesn't properly distinct between BODY and COMMENT fields and could be executed for both.
|
||||
|
@ -204,19 +216,22 @@ class serendipity_event_smartymarkup extends serendipity_event
|
|||
}
|
||||
|
||||
$element = $temp['element'];
|
||||
try { $eventData[$element] = $this->smartymarkup($eventData[$element], $eventData); } catch (Exception $e) { echo '<span class="msg-error"><span class="icon-attention-circled"></span> ' . ERROR_SOMETHING . ': '.$e->getMessage() . "</span>\n"; }
|
||||
try {
|
||||
$eventData[$element] = $this->smartymarkup($eventData[$element], $eventData);
|
||||
} catch (Exception $e) {
|
||||
echo '<span class="msg-error"><span class="icon-attention-circled"></span> ' . ERROR_SOMETHING . ': '.$e->getMessage() . "</span>\n";
|
||||
}
|
||||
if ($element == 'staticpage') {
|
||||
$eventData['markup_staticpage'] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue