first commit
This commit is contained in:
37
admin/class/smarty_plugins/function.insert_wysiwyg.php
Normal file
37
admin/class/smarty_plugins/function.insert_wysiwyg.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Smarty plugin.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Smarty {insert_wysiwyg} plugin.
|
||||
*
|
||||
* Type: function<br>
|
||||
* Name: url<br>
|
||||
* Purpose: insert wysiwyg editor
|
||||
*
|
||||
* @param array $params parameters
|
||||
* @param Smarty_Internal_Template $smarty template object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function smarty_function_insert_wysiwyg($params, $smarty)
|
||||
{
|
||||
static $index = 0;
|
||||
|
||||
$defaults = [
|
||||
'type' => 'BasicTable',
|
||||
'index' => $index,
|
||||
];
|
||||
|
||||
$params = array_merge($defaults, $params);
|
||||
|
||||
if (empty($params['target'])) {
|
||||
throw new InvalidArgumentException('insert_wysiwyg: \'target\' parameter empty');
|
||||
}
|
||||
|
||||
echo $smarty->_subTemplateRender('utils/wysiwyg.tpl', $smarty->cache_id, $smarty->compile_id, 0, null, $params, 0, false);
|
||||
|
||||
$index++;
|
||||
}
|
||||
Reference in New Issue
Block a user