本文整理汇总了PHP中ModUtil::getVar方法的典型用法代码示例。如果您正苦于以下问题:PHP ModUtil::getVar方法的具体用法?PHP ModUtil::getVar怎么用?PHP ModUtil::getVar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModUtil
的用法示例。
在下文中一共展示了ModUtil::getVar方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: settingsAction
/**
* @Route("/settings", options={"expose" = true})
* @Template()
* @Theme("admin")
*
* @param Request $request
*
* @return array|RedirectResponse
*/
public function settingsAction(Request $request)
{
if (!$this->get('cmfcmf_media_module.security_manager')->hasPermission('settings', 'admin')) {
throw new AccessDeniedException();
}
if ($request->query->get('update', false)) {
$this->get('zikula.doctrine.schema_tool')->update(MediaModuleInstaller::getEntities());
}
$collectionTemplateCollection = $this->get('cmfcmf_media_module.collection_template_collection');
$form = $this->createForm(new SettingsType($collectionTemplateCollection->getCollectionTemplateTitles()));
$form->handleRequest($request);
if ($form->isValid()) {
$data = $form->getData();
foreach ($data as $name => $value) {
\ModUtil::setVar('CmfcmfMediaModule', $name, $value);
}
$this->addFlash('status', $this->__('Settings saved!'));
}
$scribiteInstalled = \ModUtil::available('Scribite');
$descriptionEscapingStrategyForCollectionOk = true;
$descriptionEscapingStrategyForMediaOk = true;
if ($scribiteInstalled) {
$mediaBinding = $this->get('hook_dispatcher')->getBindingBetweenAreas("subscriber.cmfcmfmediamodule.ui_hooks.media", "provider.scribite.ui_hooks.editor");
$collectionBinding = $this->get('hook_dispatcher')->getBindingBetweenAreas("subscriber.cmfcmfmediamodule.ui_hooks.collection", "provider.scribite.ui_hooks.editor");
$descriptionEscapingStrategyForCollectionOk = !is_object($collectionBinding) || \ModUtil::getVar('CmfcmfMediaModule', 'descriptionEscapingStrategyForCollection') == 'raw';
$descriptionEscapingStrategyForMediaOk = !is_object($mediaBinding) || \ModUtil::getVar('CmfcmfMediaModule', 'descriptionEscapingStrategyForMedia') == 'raw';
}
return ['form' => $form->createView(), 'scribiteInstalled' => $scribiteInstalled, 'descriptionEscapingStrategyForCollectionOk' => $descriptionEscapingStrategyForCollectionOk, 'descriptionEscapingStrategyForMediaOk' => $descriptionEscapingStrategyForMediaOk];
}
示例2: install
public function install()
{
if (!SecurityUtil::checkPermission('Files::', '::', ACCESS_ADMIN)) {
return LogUtil::registerPermissionError();
}
// set content of the files .htaccess and .locked
$htaccessContent = "# Avoid direct web access to folder files\r\nOrder deny,allow\r\nDeny from all\r\n";
$lockedContent = "# Avoid direct web access with the file file.php\r\n";
// Create module table
if (!DBUtil::createTable('Files')) {
return false;
}
//Create indexes
$pntable = DBUtil::getTables();
$c = $pntable['Files_column'];
DBUtil::createIndex($c['userId'], 'Files', 'userId');
// create security files
FileUtil::writeFile(ModUtil::getVar('Files', 'folderPath') . '/.htaccess', $htaccessContent, true);
FileUtil::writeFile(ModUtil::getVar('Files', 'folderPath') . '/.locked', $lockedContent, true);
FileUtil::writeFile(ModUtil::getVar('Files', 'folderPath') . '/' . ModUtil::getVar('Files', 'usersFolder') . '/.htaccess', $htaccessContent, true);
FileUtil::writeFile(ModUtil::getVar('Files', 'folderPath') . '/' . ModUtil::getVar('Files', 'usersFolder') . '/.locked', $lockedContent, true);
//Create module vars
ModUtil::setVar('Files', 'showHideFiles', '0');
ModUtil::setVar('Files', 'allowedExtensions', 'gif,png,jpg,odt,doc,pdf,zip');
ModUtil::setVar('Files', 'defaultQuota', 1);
ModUtil::setVar('Files', 'groupsQuota', 's:0:"";');
ModUtil::setVar('Files', 'filesMaxSize', '1000000');
ModUtil::setVar('Files', 'maxWidth', '250');
ModUtil::setVar('Files', 'maxHeight', '250');
ModUtil::setVar('Files', 'editableExtensions', 'php,htm,html,htaccess,css,js,tpl');
// Set up module hook
ModUtil::registerHook('item', 'display', 'GUI', 'Files', 'user', 'Files');
return true;
}
示例3: Feeds_tables
/**
* This function is called internally by the core whenever the module is
* loaded. It adds in the information
*/
function Feeds_tables()
{
// Initialise table array
$dbtable = array();
// Full table definition
$dbtable['feeds'] = 'feeds';
$dbtable['feeds_column'] = array('fid' => 'fid',
'name' => 'name',
'urltitle' => 'urltitle',
'url' => 'url');
$dbtable['feeds_column_def'] = array('fid' => 'I(10) NOTNULL AUTOINCREMENT PRIMARY',
'name' => "C(255) NOTNULL DEFAULT ''",
'urltitle' => "C(255) NOTNULL DEFAULT ''",
'url' => "C(255) NOTNULL DEFAULT ''");
// Enable categorization services
$dbtable['feeds_db_extra_enable_categorization'] = ModUtil::getVar('Feeds', 'enablecategorization');
$dbtable['feeds_primary_key_column'] = 'fid';
// add standard data fields
ObjectUtil::addStandardFieldsToTableDefinition($dbtable['feeds_column']);
ObjectUtil::addStandardFieldsToTableDataDefinition($dbtable['feeds_column_def']);
// Return the table information
return $dbtable;
}
示例4: initialize
function initialize(Zikula_Form_View $view)
{
$this->id = (int) FormUtil::getPassedValue('id', -1, 'GETPOST');
$objectid = FormUtil::getPassedValue('objectid', '', 'GETPOST');
$redirect = base64_decode(FormUtil::getPassedValue('redirect', '', 'GETPOST'));
$view->caching = false;
$comment = ModUtil::apiFunc('EZComments', 'user', 'get', array('id' => $this->id));
if ($comment == false || !is_array($comment)) {
return LogUtil::registerError($this->__('No such comment found.'), ModUtil::url('EZComments', 'user', 'main'));
}
// check if user is allowed to modify this content
$modifyowntime = (int) ModUtil::getVar('EZComments', 'modifyowntime');
$ts = strtotime($comment['date']);
if (!SecurityUtil::checkPermission('EZComments::', '::', ACCESS_ADMIN)) {
// user has no admin permissions. Only commenting user should be able to modify
if ($comment['uid'] != UserUtil::getVar('uid')) {
// foreign content and no admin permissions
$view->assign('nomodify', 1);
$this->nomodify = 1;
} else {
if ($modifyowntime > 0 && $ts + $modifyowntime * 60 * 60 < time()) {
$view->assign('nomodify', 1);
$this->nomodify = 1;
}
}
} else {
$view->assign('nomodify', 0);
$this->nomodify = 0;
}
$view->assign('redirect', isset($redirect) && !empty($redirect) ? true : false);
// finally asign the comment information
$view->assign($comment);
return true;
}
示例5: upgrade
/**
* Avatar_upgrade()
*
* Upgrade the Module
*
* @param integer $oldversion old version of the module
* @return boolean success or not
**/
public function upgrade($oldversion)
{
// Upgrade dependent on old version number
switch ($oldversion) {
case '1.1':
$this->delVar('prefix_group_1');
$this->delVar('prefix_group_2');
$this->delVar('prefix_group_3');
$this->delVar('prefix_prefix_1');
$this->delVar('prefix_prefix_2');
$this->delVar('prefix_prefix_3');
$this->setVar('allow_multiple', true);
// for PHP5: if jpg is allowed, also allow jpeg if needed
// this is needed because image_type_to_extension() always returns 'jpeg' in case
// of jpg images in PHP5
$exts = explode(';', $this->getVar('allowed_extensions'));
if (is_array($exts) && in_array('jpg', $exts) && !in_array('jpeg', $exts)) {
$exts[] = 'jpeg';
$this->setVar('allowed_extensions', implode(';', $exts));
}
case '2.0':
case '2.1':
ModUtil::setVar('Users', 'avatarpath', ModUtil::getVar('Avatar', 'avatardir'));
$this->delVar('avatardir');
case '2.2':
}
return true;
}
示例6: initialize
public function initialize(Zikula_Form_View $view)
{
if (!SecurityUtil::checkPermission('Content::', '::', ACCESS_ADMIN)) {
throw new Zikula_Exception_Forbidden(LogUtil::getErrorMsgPermission());
}
$catoptions = array( array('text' => $this->__('Use 2 category levels (1st level single, 2nd level multi selection)'), 'value' => '1'),
array('text' => $this->__('Use 2 category levels (both single selection)'), 'value' => '2'),
array('text' => $this->__('Use 1 category level'), 'value' => '3'),
array('text' => $this->__("Don't use Categories at all"), 'value' => '4') );
$this->view->assign('catoptions', $catoptions);
$this->view->assign('categoryusage', 1);
$activeoptions = array( array('text' => $this->__('New pages will be active and available in the menu'), 'value' => '1'),
array('text' => $this->__('New pages will be inactive and available in the menu'), 'value' => '2'),
array('text' => $this->__('New pages will be active and not available in the menu'), 'value' => '3'),
array('text' => $this->__('New pages will be inactive and not available in the menu'), 'value' => '4') );
$this->view->assign('activeoptions', $activeoptions);
$pageinfolocationoptions = array( array('text' => $this->__('Top of the page, left of the page title'), 'value' => 'top'),
array('text' => $this->__('Bottom of the page'), 'value' => 'bottom') );
$this->view->assign('pageinfolocationoptions', $pageinfolocationoptions);
// Assign all module vars
$this->view->assign('config', ModUtil::getVar('Content'));
return true;
}
示例7: preSave
/**
* Sets the value of the Registry Relation.
*
* @param Doctrine_Event $event Event.
*
* @return void
*/
public function preSave($event)
{
$subclasses = ModUtil::getVar('Categories', 'EntityCategorySubclasses', array());
// get the registry object
$registry = Doctrine::getTable('Zikula_Doctrine_Model_Registry')->findOneByModuleAndTableAndProperty($subclasses[get_class($this)]['module'], $subclasses[get_class($this)]['table'], $this->reg_property);
$this['Registry'] = $registry;
}
示例8: initialize
/**
* Initialize form handler.
*
* This method takes care of all necessary initialisation of our data and form states.
*
* @return boolean False in case of initialization errors, otherwise true.
*/
public function initialize(Zikula_Form_View $view)
{
// permission check
if (!SecurityUtil::checkPermission('MUBoard::', '::', ACCESS_ADMIN)) {
return $view->registerError(LogUtil::registerPermissionError());
}
// retrieve module vars
$modVars = ModUtil::getVar('MUBoard');
// initialise list entries for the 'number images' setting
$modVars['numberImagesItems'] = array(array('value' => '1', 'text' => '1'), array('value' => '2', 'text' => '2'), array('value' => '3', 'text' => '3'));
// initialise list entries for the 'number files' setting
$modVars['numberFilesItems'] = array(array('value' => '1', 'text' => '1'), array('value' => '2', 'text' => '2'), array('value' => '3', 'text' => '3'));
// initialise list entries for the 'sorting postings' setting
$modVars['sortingPostingsItems'] = array(array('value' => 'descending', 'text' => 'Descending'), array('value' => 'ascending', 'text' => 'Ascending'));
// initialise list entries for the 'icon set' setting
$modVars['iconSetItems'] = array(array('value' => '1', 'text' => '1'), array('value' => '2', 'text' => '2'), array('value' => '3', 'text' => '3'));
// initialise list entries for the 'template' setting
$modVars['templateItems'] = array(array('value' => 'normal', 'text' => 'Normal'), array('value' => 'jquery', 'text' => 'JQuery'));
// assign all module vars
$this->view->assign('config', $modVars);
// custom initialisation aspects
$this->initializeAdditions();
// everything okay, no initialization errors occured
return true;
}
示例9: AddressBook_tables
/**
* AddressBook
*
* @copyright (c) AddressBook Development Team
* @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
* @package AddressBook
*/
function AddressBook_tables()
{
// Initialise table array
$tables = array();
$tables['addressbook_address'] = 'addressbook_address';
$tables['addressbook_address_column'] = array('id' => 'adr_id', 'cat_id' => 'adr_catid', 'prefix' => 'adr_prefix', 'lname' => 'adr_name', 'fname' => 'adr_fname', 'sortname' => 'adr_sortname', 'title' => 'adr_title', 'company' => 'adr_company', 'sortcompany' => 'adr_sortcompany', 'img' => 'adr_img', 'zip' => 'adr_zip', 'city' => 'adr_city', 'address1' => 'adr_address1', 'address2' => 'adr_address2', 'state' => 'adr_state', 'country' => 'adr_country', 'geodata' => 'adr_geodata', 'contact_1' => 'adr_contact_1', 'contact_2' => 'adr_contact_2', 'contact_3' => 'adr_contact_3', 'contact_4' => 'adr_contact_4', 'contact_5' => 'adr_contact_5', 'c_label_1' => 'adr_c_label_1', 'c_label_2' => 'adr_c_label_2', 'c_label_3' => 'adr_c_label_3', 'c_label_4' => 'adr_c_label_4', 'c_label_5' => 'adr_c_label_5', 'c_main' => 'adr_c_main', 'custom_1' => 'adr_custom_1', 'custom_2' => 'adr_custom_2', 'custom_3' => 'adr_custom_3', 'custom_4' => 'adr_custom_4', 'note' => 'adr_note', 'user_id' => 'adr_user', 'private' => 'adr_private', 'date' => 'adr_date', 'counter' => 'adr_counter', 'language' => 'adr_language', 'status' => 'adr_status');
// Enable categorization services
$tables['addressbook_address_db_extra_enable_categorization'] = ModUtil::getVar('AddressBook', 'enablecategorization');
$tables['addressbook_address_primary_key_column'] = 'id';
ObjectUtil::addStandardFieldsToTableDefinition($tables['addressbook_address_column'], 'adr_');
// add potential custom_fields
addCustomFieldsToTableDefinition($tables['addressbook_address_column']);
$tables['addressbook_address_column_def'] = array('id' => "I AUTO PRIMARY", 'cat_id' => "I NOTNULL DEFAULT 0", 'prefix' => "I NOTNULL DEFAULT 0", 'lname' => "C(100) DEFAULT NULL", 'fname' => "C(60) DEFAULT NULL", 'sortname' => "C(180) DEFAULT NULL", 'title' => "C(100) DEFAULT NULL", 'company' => "C(100) DEFAULT NULL", 'sortcompany' => "C(100) DEFAULT NULL", 'img' => "C(100) DEFAULT NULL", 'zip' => "C(30) DEFAULT NULL", 'city' => "C(100) DEFAULT NULL", 'address1' => "C(100) DEFAULT NULL", 'address2' => "C(100) DEFAULT NULL", 'state' => "C(60) DEFAULT NULL", 'country' => "C(60) DEFAULT NULL", 'geodata' => "C(180) DEFAULT NULL", 'contact_1' => "C(100) DEFAULT NULL", 'contact_2' => "C(100) DEFAULT NULL", 'contact_3' => "C(100) DEFAULT NULL", 'contact_4' => "C(100) DEFAULT NULL", 'contact_5' => "C(100) DEFAULT NULL", 'c_label_1' => "I2 DEFAULT NULL", 'c_label_2' => "I2 DEFAULT NULL", 'c_label_3' => "I2 DEFAULT NULL", 'c_label_4' => "I2 DEFAULT NULL", 'c_label_5' => "I2 DEFAULT NULL", 'c_main' => "I2 DEFAULT NULL", 'custom_1' => "X DEFAULT NULL", 'custom_2' => "X DEFAULT NULL", 'custom_3' => "X DEFAULT NULL", 'custom_4' => "X DEFAULT NULL", 'note' => "X DEFAULT NULL", 'user_id' => "I DEFAULT NULL", 'private' => "I2 DEFAULT NULL", 'date' => "I NOTNULL DEFAULT 0", 'counter' => "I NOTNULL DEFAULT 0", 'language' => "C(30) NOTNULL DEFAULT ''", 'status' => "I1 DEFAULT '1'");
ObjectUtil::addStandardFieldsToTableDataDefinition($tables['addressbook_address_column_def'], 'adr_');
$tables['addressbook_labels'] = 'addressbook_labels';
$tables['addressbook_labels_column'] = array('id' => 'lab_id', 'name' => 'lab_name', 'name1' => 'lab_name1');
$tables['addressbook_labels_primary_key_column'] = 'id';
ObjectUtil::addStandardFieldsToTableDefinition($tables['addressbook_labels_column'], 'lab_');
$tables['addressbook_labels_column_def'] = array('id' => "I AUTO PRIMARY", 'name' => "C(30) DEFAULT NULL", 'name1' => "C(30) DEFAULT NULL");
ObjectUtil::addStandardFieldsToTableDataDefinition($tables['addressbook_labels_column_def'], 'lab_');
$tables['addressbook_customfields'] = 'addressbook_customfields';
$tables['addressbook_customfields_column'] = array('id' => 'cus_id', 'name' => 'cus_name', 'name1' => 'cus_name1', 'type' => 'cus_type', 'position' => 'cus_pos', 'option' => 'cus_option');
$tables['addressbook_customfields_primary_key_column'] = 'id';
ObjectUtil::addStandardFieldsToTableDefinition($tables['addressbook_customfields_column'], 'cus_');
$tables['addressbook_customfields_column_def'] = array('id' => "I AUTO PRIMARY", 'name' => "C(30) DEFAULT NULL", 'name1' => "C(30) DEFAULT NULL", 'type' => "C(30) DEFAULT NULL", 'position' => "I NOTNULL DEFAULT 0", 'option' => "X DEFAULT NULL");
ObjectUtil::addStandardFieldsToTableDataDefinition($tables['addressbook_customfields_column_def'], 'cus_');
$tables['addressbook_favourites'] = 'addressbook_favourites';
$tables['addressbook_favourites_column'] = array('favadr_id' => 'fav_adr_id', 'favuser_id' => 'fav_user_id');
$tables['addressbook_favourites_column_def'] = array('favadr_id' => "I NOTNULL DEFAULT 0", 'favuser_id' => "I NOTNULL DEFAULT 0");
// Return the table information
return $tables;
}
示例10: escapeDescription
/**
* @param CollectionEntity|AbstractMediaEntity $entity
*
* @return string
*/
public function escapeDescription($entity)
{
$description = $entity->getDescription();
$strategy = null;
$hookName = null;
if ($entity instanceof CollectionEntity) {
$strategy = \ModUtil::getVar('CmfcmfMediaModule', 'descriptionEscapingStrategyForCollection');
$hookName = 'collections';
} elseif ($entity instanceof AbstractMediaEntity) {
$strategy = \ModUtil::getVar('CmfcmfMediaModule', 'descriptionEscapingStrategyForMedia');
$hookName = 'media';
} else {
throw new \LogicException();
}
$eventName = "cmfcmfmediamodule.filter_hooks.{$hookName}.filter";
$hook = new \Zikula_FilterHook($eventName, $description);
$description = $this->hookDispatcher->dispatch($eventName, $hook)->getData();
switch ($strategy) {
case 'raw':
return $description;
case 'text':
return htmlentities($description);
case 'markdown':
return $this->markdownExtra->transform($description);
default:
throw new \LogicException();
}
}
示例11: smarty_function_modgetvar
/**
* Zikula_View function to get module variable
*
* This function obtains a module-specific variable from the Zikula system.
*
* Note that the results should be handled by the safetext or the safehtml
* modifier before being displayed.
*
*
* Available parameters:
* - module: The well-known name of a module from which to obtain the variable
* - name: The name of the module variable to obtain
* - assign: If set, the results are assigned to the corresponding variable instead of printed out
* - html: If true then result will be treated as html content
* - default: The default value to return if the config variable is not set
*
* Example
* {modgetvar module='Example' name='foobar' assign='foobarOfExample'}
*
* @param array $params All attributes passed to this function from the template.
* @param Zikula_View $view Reference to the Zikula_View object.
*
* @return string The module variable.
*/
function smarty_function_modgetvar($params, Zikula_View $view)
{
$assign = isset($params['assign']) ? $params['assign'] : null;
$default = isset($params['default']) ? $params['default'] : null;
$module = isset($params['module']) ? $params['module'] : null;
$html = isset($params['html']) ? (bool) $params['html'] : false;
$name = isset($params['name']) ? $params['name'] : null;
if (!$module) {
$view->trigger_error(__f('Error! in %1$s: the %2$s parameter must be specified.', array('modgetvar', 'module')));
return false;
}
if (!$name && !$assign) {
$view->trigger_error(__f('Error! in %1$s: the %2$s parameter must be specified.', array('modgetvar', 'name')));
return false;
}
if (!$name) {
$result = ModUtil::getVar($module);
} else {
$result = ModUtil::getVar($module, $name, $default);
}
if ($assign) {
$view->assign($assign, $result);
} else {
if ($html) {
return DataUtil::formatForDisplayHTML($result);
} else {
return DataUtil::formatForDisplay($result);
}
}
}
示例12: getAvatars
/**
* Avatar_userapi_GetAvatars()
*
* returns all possible avatars for the current user.
*
* @param integer $args['uid'] the user ID (if missing, the current user is assumed)
* @param integer $args['startnum'] int the number where to start (for paging)
* @param integer $args['perpage'] int items per page
* @return array a list of avatar file names
**/
public function getAvatars($args)
{
$uid = isset($args['uid']) ? $args['uid'] : UserUtil::getVar('uid');
$page = isset($args['page']) ? $args['page'] : -1;
$perpage = isset($args['perpage']) ? $args['perpage'] : -1;
$realimages = isset($args['realimages']) ? true : false;
$avatarpath = ModUtil::getVar('Users', 'avatarpath');
$allavatars = FileUtil::getFiles($avatarpath, true, true, null, false);
if ($realimages == true) {
$allavatars = array_diff($allavatars, array('blank.gif', 'gravatar.gif'));
}
$avatars = array();
foreach ($allavatars as $avatar) {
// imagename is like pers_XXXX.gif (with XXXX = user id)
if (ModUtil::apiFunc('Avatar', 'user', 'checkAvatar', array('avatar' => $avatar, 'uid' => $uid)) == true) {
$avatars[] = $avatar;
}
}
sort($avatars);
$allcount = count($avatars);
// paging
if ($page != -1 && $perpage != -1) {
$start = ($page - 1) * $perpage;
$stop = $start + $perpage;
if ($stop > $allcount) {
$stop = $allcount;
}
$pagedavatars = array();
for ($idx = $start; $idx < $stop; $idx++) {
$pagedavatars[] = $avatars[$idx];
}
return array($pagedavatars, $allcount);
}
return array($avatars, $allcount);
}
示例13: addParameters
/**
* called near end of loader() before template is fetched
* @return array
*/
public static function addParameters()
{
// get plugins for tinymce
$tinymce_listplugins = ModUtil::getVar('moduleplugin.scribite.tinymce', 'activeplugins');
$tinymce_buttonmap = array('paste' => 'pastetext,pasteword,selectall', 'insertdatetime' => 'insertdate,inserttime', 'table' => 'tablecontrols,table,row_props,cell_props,delete_col,delete_row,col_after,col_before,row_after,row_before,split_cells,merge_cells', 'directionality' => 'ltr,rtl', 'layer' => 'moveforward,movebackward,absolute,insertlayer', 'save' => 'save,cancel', 'style' => 'styleprops', 'xhtmlxtras' => 'cite,abbr,acronym,ins,del,attribs', 'searchreplace' => 'search,replace');
if (is_array($tinymce_listplugins)) {
// Buttons/controls: http://www.tinymce.com/wiki.php/Buttons/controls
// We have some plugins with the button name same as plugin name
// and a few plugins with custom button names, so we have to check the mapping array.
$tinymce_buttons = array();
foreach ($tinymce_listplugins as $tinymce_button) {
if (array_key_exists($tinymce_button, $tinymce_buttonmap)) {
$tinymce_buttons = array_merge($tinymce_buttons, explode(",", $tinymce_buttonmap[$tinymce_button]));
} else {
$tinymce_buttons[] = $tinymce_button;
}
}
// TODO: I really would like to split this into multiple row, but I do not know how
// $tinymce_buttons_splitted = array_chunk($tinymce_buttons, 20);
// foreach ($tinymce_buttons_splitted as $key => $tinymce_buttonsrow) {
// $tinymce_buttonsrows[] = DataUtil::formatForDisplay(implode(',', $tinymce_buttonsrow));
// }
$tinymce_buttons = DataUtil::formatForDisplay(implode(',', $tinymce_buttons));
return array('buttons' => $tinymce_buttons);
}
return array('buttons' => '');
}
示例14: get_geodata
function get_geodata()
{
if (!SecurityUtil::checkPermission('AddressBook::', "::", ACCESS_EDIT)) {
AjaxUtil::error($this->__('Error! No authorization to access this module.'));
}
$val_1 = FormUtil::getPassedValue('val_1', NULL, 'GETPOST');
$val_2 = FormUtil::getPassedValue('val_2', NULL, 'GETPOST');
$val_3 = FormUtil::getPassedValue('val_3', NULL, 'GETPOST');
$val_4 = FormUtil::getPassedValue('val_4', NULL, 'GETPOST');
//GMaps test
include_once 'modules/AddressBook/lib/vendor/GMaps/GoogleMapV3.php';
$key = ModUtil::getVar('AddressBook', 'google_api_key');
$map = new GoogleMapAPI();
$map->setApiKey($key);
$geocode = $map->getGeocode($val_1 . ', ' . $val_2 . ', ' . $val_3 . ', ' . $val_4);
if (isset($geocode['lat']) && isset($geocode['lon'])) {
$result = $geocode['lat'] . ',' . $geocode['lon'];
} else {
$result = '';
}
if (FormUtil::getPassedValue('plane', NULL, 'GETPOST')) {
return $result;
}
return new Zikula_Response_Ajax(array('lat_lon' => $result, 'result' => $result ? true : false));
}
示例15: install
/**
* Initialise SiriusXtecAuth module.
*/
public function install()
{
// create module vars
// ldap configuration
$this->setVars(array('ldap_server' => 'host.domain',
'ldap_basedn' => 'cn=users,dc=host,dc=domain',
'ldap_searchattr' => 'cn'));
// module configutation
$defaultGroupId = ModUtil::getVar('Groups', 'defaultgroup');
$initGroups = array($defaultGroupId);
$this->setVars(array('ldap_active' => false,
'users_creation' => false,
'new_users_activation' => false,
'new_users_groups' => $initGroups,
'iw_write' => false,
'iw_lastnames' => false,
'loginXtecApps' => false,
'logoutXtecApps' => false,
'gtafProtocol' => 'http',
'e13Protocol' => 'http',
'gtafURL' => 'aplitic.xtec.cat/pls/gafoas/pk_for_mod_menu.p_for_opcions_menu?p_perfil=RES',
'e13URL' => 'aplitic.xtec.cat/pls/e13_formacio_gaf/formacio_gaf.inici',
'loginTime' => 200,
'logoutTime' => 200));
// register handler
EventUtil::registerPersistentModuleHandler('SiriusXtecAuth', 'module.users.ui.login.failed', array('SiriusXtecAuth_Listeners', 'trySiriusXtecAuth'));
EventUtil::registerPersistentModuleHandler('SiriusXtecAuth', 'module.users.ui.logout.succeeded', array('SiriusXtecAuth_Listeners', 'logoutXtecApps'));
// finish
return true;
}