• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP FormUtil类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中FormUtil的典型用法代码示例。如果您正苦于以下问题:PHP FormUtil类的具体用法?PHP FormUtil怎么用?PHP FormUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了FormUtil类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: mediashare_external_pasteitem

function mediashare_external_pasteitem($args)
{
    // FIXME access check
    $albumId = mediashareGetIntUrl('aid', $args, 0);
    $mediaId = mediashareGetIntUrl('mid', $args, 0);
    $mode = FormUtil::getPassedValue('mode');
    if (isset($_POST['backButton'])) {
        return pnRedirect(pnModUrl('mediashare', 'external', 'finditem', array('aid' => $albumId, 'mid' => $mediaId, 'mode' => $mode)));
    }
    $mediaItem = pnModAPIFunc('mediashare', 'user', 'getMediaItem', array('mediaId' => $mediaId));
    /*
        if (!($handler = pnModAPIFunc('mediashare', 'mediahandler', 'loadHandler', array('handlerName' => $mediaItem['mediaHandler'])))) {
            return false;
        }
    */
    $render =& pnRender::getInstance('mediashare', false);
    mediashareExternalLoadTheme($render);
    $render->assign('albumId', $albumId);
    $render->assign('mediaId', $mediaId);
    $render->assign('mediaItem', $mediaItem);
    if ($mediaItem['mediaHandler'] != 'extapp') {
        $mediadir = pnModAPIFunc('mediashare', 'user', 'getRelativeMediadir');
        $render->assign('thumbnailUrl', $mediadir . $mediaItem['thumbnailRef']);
        $render->assign('previewUrl', $mediadir . $mediaItem['previewRef']);
        $render->assign('originalUrl', $mediadir . $mediaItem['originalRef']);
    } else {
        $render->assign('thumbnailUrl', "{$mediaItem['thumbnailRef']}");
        $render->assign('previewUrl', "{$mediaItem['previewRef']}");
        $render->assign('originalUrl', "{$mediaItem['originalRef']}");
    }
    $render->assign('mode', $mode);
    echo $render->fetch('mediashare_external_pasteitem.html');
    return true;
}
开发者ID:ro0f,项目名称:Mediashare,代码行数:34,代码来源:pnexternal.php


示例2: coreinit

 /**
  * Event listener for 'core.postinit' event.
  * 
  * @param Zikula_Event $event
  *
  * @return void
  */
 public static function coreinit(Zikula_Event $event)
 {
     // get the module name
     $args = array();
     $args['modulename'] = ModUtil::getName();
     $module = $args['modulename'];
     // exit if Content module active - to avoid double loadings if user has given ids and functions
     if ($args['modulename'] == 'content') {
         return;
     }
     // Security check if user has COMMENT permission for scribite
     if (!SecurityUtil::checkPermission('Scribite::', "{$module}::", ACCESS_COMMENT)) {
         return;
     }
     // get passed func
     $func = FormUtil::getPassedValue('func', isset($args['func']) ? $args['func'] : null, 'GET');
     // get config for current module
     $modconfig = array();
     $modconfig = ModUtil::apiFunc('Scribite', 'user', 'getModuleConfig', array('modulename' => $args['modulename']));
     // return if module is not supported or editor is not set
     if (!$modconfig['mid'] || $modconfig['modeditor'] == '-') {
         return;
     }
     // check if current func is fine for editors or funcs is empty (or all funcs)
     if (is_array($modconfig['modfuncs']) && (in_array($func, $modconfig['modfuncs']) || $modconfig['modfuncs'][0] == 'all')) {
         $args['areas'] = $modconfig['modareas'];
         $args['editor'] = $modconfig['modeditor'];
         $scribite = ModUtil::apiFunc('Scribite', 'user', 'loader', array('modulename' => $args['modulename'], 'editor' => $args['editor'], 'areas' => $args['areas']));
         // add the scripts to page header
         if ($scribite) {
             PageUtil::AddVar('header', $scribite);
         }
     }
 }
开发者ID:rmaiwald,项目名称:Scribite,代码行数:41,代码来源:Listeners.php


示例3: confupdate

    /**
     * Update the configuration values
     * @author: Sara Arjona Téllez ([email protected])
     * @params	The config values from the form
     * @return	Thue if success
     */
    public function confupdate($args) {
        $skins = FormUtil::getPassedValue('skins', isset($args['skins']) ? $args['skins'] : null, 'POST');
        $langs = FormUtil::getPassedValue('langs', isset($args['langs']) ? $args['langs'] : null, 'POST');
        $maxdelivers = FormUtil::getPassedValue('maxdelivers', isset($args['maxdelivers']) ? $args['maxdelivers'] : null, 'POST');
        $basedisturl = FormUtil::getPassedValue('basedisturl', isset($args['basedisturl']) ? $args['basedisturl'] : null, 'POST');

        // Security check
        if (!SecurityUtil::checkPermission('IWqv::', "::", ACCESS_ADMIN)) {
            throw new Zikula_Exception_Forbidden();
        }

        // Confirm authorisation code
        $this->checkCsrfToken();

        if (isset($skins))
            ModUtil::setVar('IWqv', 'skins', $skins);
        if (isset($langs))
            ModUtil::setVar('IWqv', 'langs', $langs);
        if (isset($maxdelivers))
            ModUtil::setVar('IWqv', 'maxdelivers', $maxdelivers);
        if (isset($basedisturl))
            ModUtil::setVar('IWqv', 'basedisturl', $basedisturl);

        LogUtil::registerStatus($this->__f('Done! %1$s updated.', $this->__('settings')));
        return System::redirect(ModUtil::url('IWqv', 'admin', 'main'));
    }
开发者ID:projectesIF,项目名称:Sirius,代码行数:32,代码来源:Admin.php


示例4: initialize

 public function initialize(Zikula_Form_View $view)
 {
     $this->pageId = FormUtil::getPassedValue('pid', isset($this->args['pid']) ? $this->args['pid'] : null);
     $offset = (int) FormUtil::getPassedValue('offset');
     if ((bool) $this->getVar('inheritPermissions', false) === true) {
         if (!ModUtil::apiFunc('Content', 'page', 'checkPermissionForPageInheritance', array('pageId' => $this->pageId, 'level' => ACCESS_EDIT))) {
             throw new Zikula_Exception_Forbidden(LogUtil::getErrorMsgPermission());
         }
     } else {
         if (!SecurityUtil::checkPermission('Content:page:', $this->pageId . '::', ACCESS_EDIT)) {
             throw new Zikula_Exception_Forbidden(LogUtil::getErrorMsgPermission());
         }
     }
     $page = ModUtil::apiFunc('Content', 'Page', 'getPage', array('id' => $this->pageId, 'editing' => false, 'filter' => array('checkActive' => false), 'enableEscape' => true, 'translate' => false, 'includeContent' => false, 'includeCategories' => false));
     if ($page === false) {
         return $this->view->registerError(null);
     }
     $versionscnt = ModUtil::apiFunc('Content', 'History', 'getPageVersionsCount', array('pageId' => $this->pageId));
     $versions = ModUtil::apiFunc('Content', 'History', 'getPageVersions', array('pageId' => $this->pageId, 'offset' => $offset));
     if ($versions === false) {
         return $this->view->registerError(null);
     }
     $this->view->assign('page', $page);
     $this->view->assign('versions', $versions);
     Content_Util::contentAddAccess($this->view, $this->pageId);
     // Assign the values for the smarty plugin to produce a pager
     $this->view->assign('numitems', $versionscnt);
     PageUtil::setVar('title', $this->__("Page history") . ' : ' . $page['title']);
     if (!$this->view->isPostBack() && FormUtil::getPassedValue('back', 0)) {
         $this->backref = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null;
     }
     return true;
 }
开发者ID:robbrandt,项目名称:Content,代码行数:33,代码来源:HistoryContent.php


示例5: FlashChatBridge_user_showChat

function FlashChatBridge_user_showChat()
{
    // perform permission check
    if (!SecurityUtil::checkPermission('FlashChatBridge::', '::', ACCESS_READ)) {
        return LogUtil::registerPermissionError();
    }
    $popup = FormUtil::getPassedValue('popup', false);
    // Security check
    $render =& pnRender::getInstance('FlashChatBridge', false);
    $UserVars = pnUserGetVars(SessionUtil::getVar('uid'));
    $client_type = FormUtil::getPassedValue('client_type', 'standard');
    $settings = pnModGetVar('FlashChatBridge');
    $settings['init_user'] = $UserVars['uname'];
    $settings['init_password'] = $UserVars['pass'];
    if ($settings['autosize'] == 1) {
        $settings['width'] = "100%";
        $settings['height'] = "100%";
    }
    if ($popup) {
        $settings['width'] = "100%";
        $settings['height'] = "100%";
        $render->assign('settings', $settings);
        $chat = $render->fetch("flashchatbridge_user_chat_{$client_type}.htm");
        $render->assign('chat', $chat);
        echo $render->fetch('flashchatbridge_user_popup.htm');
        exit;
    } else {
        $render->assign('settings', $settings);
        return $render->fetch("flashchatbridge_user_chat_{$client_type}.htm");
    }
}
开发者ID:tempbottle,项目名称:FlashChatBridge,代码行数:31,代码来源:pnuser.php


示例6: updateConfig

    public function updateConfig($args)
    {
        // Security check
        if (!SecurityUtil::checkPermission('SiriusXtecAuth::', '::', ACCESS_ADMIN)) {
            return LogUtil::registerPermissionError();
        }
        $items = array( 'ldap_active' => FormUtil::getPassedValue('ldap_active', false, 'POST')?true:false,
                'users_creation' => FormUtil::getPassedValue('users_creation', false, 'POST')?true:false,
                'new_users_activation' => FormUtil::getPassedValue('new_users_activation', false, 'POST')?true:false,
                'iw_write' => FormUtil::getPassedValue('iw_write', false, 'POST')?true:false,
                'iw_lastnames' => FormUtil::getPassedValue('iw_lastnames', false, 'POST')?true:false,
                'new_users_groups' => FormUtil::getPassedValue('new_users_groups', array(), 'POST'),
                'ldap_server' => FormUtil::getPassedValue('ldap_server', false, 'POST'),
                'ldap_basedn' => FormUtil::getPassedValue('ldap_basedn', false, 'POST'),
                'ldap_searchattr' => FormUtil::getPassedValue('ldap_searchattr', false, 'POST'),
                'loginXtecApps' => FormUtil::getPassedValue('loginXtecApps', false, 'POST'),
                'logoutXtecApps' => FormUtil::getPassedValue('logoutXtecApps', false, 'POST'),
                'gtafProtocol' => FormUtil::getPassedValue('gtafProtocol', false, 'POST'),
                'e13Protocol' => FormUtil::getPassedValue('e13Protocol', false, 'POST'),
                'gtafURL' => FormUtil::getPassedValue('gtafURL', false, 'POST'),
                'e13URL' => FormUtil::getPassedValue('e13URL', false, 'POST'),
				'loginTime' => FormUtil::getPassedValue('loginTime', false, 'POST'),
				'logoutTime' => FormUtil::getPassedValue('logoutTime', false, 'POST'));
        ModUtil::setVars($this->name,$items);
        LogUtil::registerStatus($this->__('S\'ha actualitzat la configuració del mòdul.'));
        return System::redirect(ModUtil::url('SiriusXtecAuth', 'admin', 'main'));
    }
开发者ID:projectesIF,项目名称:Sirius,代码行数:27,代码来源:Admin.php


示例7: modifyconfig

 public function modifyconfig()
 {
     $this->throwForbiddenUnless(SecurityUtil::checkPermission('Scribite::', '::', ACCESS_ADMIN), LogUtil::getErrorMsgPermission());
     // Create form
     $form = FormUtil::newForm('Scribite', $this);
     return $form->execute('admin/modifyconfig.tpl', new Scribite_FormHandler_ModifyConfig());
 }
开发者ID:pheski,项目名称:Scribite,代码行数:7,代码来源:Admin.php


示例8: 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;
 }
开发者ID:rmaiwald,项目名称:EZComments,代码行数:34,代码来源:Modify.php


示例9: decode

 public function decode(Zikula_Form_View $view)
 {
     $this->value = FormUtil::getPassedValue($this->inputName, null, 'POST');
     if (get_magic_quotes_gpc()) {
         $this->value = stripslashes($this->value);
     }
 }
开发者ID:robbrandt,项目名称:Content,代码行数:7,代码来源:PositionSelector.php


示例10: update

 function update($blockinfo)
 {
     $vars = BlockUtil::varsFromContent($blockinfo['content']);
     $vars['page'] = FormUtil::getPassedValue('page', 0, 'POST');
     $blockinfo['content'] = BlockUtil::varsToContent($vars);
     return $blockinfo;
 }
开发者ID:robbrandt,项目名称:Content,代码行数:7,代码来源:OnePage.php


示例11: deleteidsentry

    /**
     * Function to delete an ids log entry
     */
    public function deleteidsentry()
    {
        // verify auth-key
        $this->checkCsrfToken();

        // Security check
        if (!SecurityUtil::checkPermission('SecurityCenter::', '::', ACCESS_DELETE)) {
            return LogUtil::registerPermissionError();
        }

        // get paramters
        $id = (int)FormUtil::getPassedValue('id', 0, 'GETPOST');

        // sanity check
        if (!is_numeric($id)) {
            return LogUtil::registerError($this->__f("Error! Received a non-numeric object ID '%s'.", $id));
        }

        $class = 'SecurityCenter_DBObject_Intrusion';
        $object = new $class();
        $data = $object->get($id);

        // check for valid object
        if (!$data) {
            return LogUtil::registerError($this->__f('Error! Invalid %s received.', "object ID [$id]"));
        } else {
            // delete object
            $object->delete();
        }

        // redirect back to view function
        $this->redirect(ModUtil::url('SecurityCenter', 'admin', 'viewidslog'));
    }
开发者ID:projectesIF,项目名称:Sirius,代码行数:36,代码来源:Adminform.php


示例12: initialize

    public function initialize(Zikula_Form_View $view)
    {
        $this->pageId = FormUtil::getPassedValue('pid', isset($this->args['pid']) ? $this->args['pid'] : null);

        if (!SecurityUtil::checkPermission('Content:page:', '::', ACCESS_ADD)) {
            throw new Zikula_Exception_Forbidden(LogUtil::getErrorMsgPermission());
        }
        if (!SecurityUtil::checkPermission('Content:page:', $this->pageId . '::', ACCESS_EDIT)) {
            throw new Zikula_Exception_Forbidden(LogUtil::getErrorMsgPermission());
        }

        $page = ModUtil::apiFunc('Content', 'Page', 'getPage', array('id' => $this->pageId, 'filter' => array('checkActive' => false), 'includeContent' => false));
        if ($page === false) {
            throw new Zikula_Exception_Fatal($this->__('Page not found'));
        }

        // Only allow subpages if edit access on parent page
        if (!SecurityUtil::checkPermission('Content:page:', $page['id'] . '::', ACCESS_EDIT)) {
            throw new Zikula_Exception_Forbidden(LogUtil::getErrorMsgPermission());
        }

        PageUtil::setVar('title', $this->__('Clone page') . ' : ' . $page['title']);

        $this->view->assign('page', $page);
        Content_Util::contentAddAccess($this->view, $this->pageId);

        return true;
    }
开发者ID:projectesIF,项目名称:Sirius,代码行数:28,代码来源:ClonePage.php


示例13: initialize

 /**
  * Setup form.
  *
  * @param Zikula_Form_View $view Current Zikula_Form_View instance.
  *
  * @return boolean
  */
 public function initialize(Zikula_Form_View $view)
 {
     // load and assign registred categories
     $categories = CategoryRegistryUtil::getRegisteredModuleCategories('ExampleDoctrine', 'User', 'id');
     $view->assign('registries', $categories);
     $id = FormUtil::getPassedValue('id', null, "GET", FILTER_SANITIZE_NUMBER_INT);
     if ($id) {
         // load user with id
         $user = $this->entityManager->find('ExampleDoctrine_Entity_User', $id);
         if ($user) {
             // switch to edit mode
             $this->_id = $id;
         } else {
             return LogUtil::registerError($this->__f('User with id %s not found', $id));
         }
     } else {
         $user = new ExampleDoctrine_Entity_User();
     }
     $userData = $user->toArray();
     // overwrite attributes array entry with a form compitable format
     $field1 = $user->getAttributes()->get('field1') ? $user->getAttributes()->get('field1')->getValue() : '';
     $field2 = $user->getAttributes()->get('field2') ? $user->getAttributes()->get('field2')->getValue() : '';
     $userData['attributes'] = array('field1' => $field1, 'field2' => $field2);
     // assign current values to form fields
     $view->assign('user', $user)->assign('meta', $user->getMetadata() != null ? $user->getMetadata()->toArray() : array())->assign($userData);
     $this->_user = $user;
     return true;
 }
开发者ID:projectesIF,项目名称:Sirius,代码行数:35,代码来源:Edit.php


示例14: delete

 function delete()
 {
     // security check
     if (!SecurityUtil::checkPermission('AddressBook::', '::', ACCESS_ADMIN)) {
         return LogUtil::registerPermissionError();
     }
     $ot = FormUtil::getPassedValue('ot', 'categories', 'GETPOST');
     $id = (int) FormUtil::getPassedValue('id', 0, 'GETPOST');
     $url = ModUtil::url('AddressBook', 'admin', 'view', array('ot' => $ot));
     $class = 'AddressBook_DBObject_' . ucfirst($ot);
     if (!class_exists($class)) {
         return z_exit(__f('Error! Unable to load class [%s]', $ot));
     }
     $object = new $class();
     $data = $object->get($id);
     if (!$data) {
         LogUtil::registerError(__f('%1$s with ID of %2$s doesn\'\\t seem to exist', array($ot, $id)));
         return System::redirect($url);
     }
     $object->delete();
     if ($ot == "customfield") {
         $sql = "ALTER TABLE addressbook_address DROP adr_custom_" . $id;
         try {
             DBUtil::executeSQL($sql, -1, -1, true, true);
         } catch (Exception $e) {
         }
     }
     LogUtil::registerStatus($this->__('Done! Item deleted.'));
     return System::redirect($url);
 }
开发者ID:nmpetkov,项目名称:AddressBook,代码行数:30,代码来源:Admin.php


示例15: updateConf

    /**
     * Update the module configuration
     * @author:     Albert Pérez Monfort ([email protected])
     * @param:	Configuration values
     * @return:	The form with needed to change the parameters
     */
    public function updateConf($args) {
        $jclicJarBase = FormUtil::getPassedValue('jclicJarBase', isset($args['jclicJarBase']) ? $args['jclicJarBase'] : null, 'POST');
        $timeLap = FormUtil::getPassedValue('timeLap', isset($args['timeLap']) ? $args['timeLap'] : null, 'POST');
        $groups = FormUtil::getPassedValue('groups', isset($args['groups']) ? $args['groups'] : null, 'POST');
        $jclicUpdatedFiles = FormUtil::getPassedValue('jclicUpdatedFiles', isset($args['jclicUpdatedFiles']) ? $args['jclicUpdatedFiles'] : null, 'POST');

        // Security check
        if (!SecurityUtil::checkPermission('IWjclic::', "::", ACCESS_ADMIN)) {
            throw new Zikula_Exception_Forbidden();
        }

        // Confirm authorisation code
        $this->checkCsrfToken();

        $groupsString = '$';
        foreach ($groups as $group)
            $groupsString .= '$' . $group . '$';

        $this->setVar('jclicUpdatedFiles', $jclicUpdatedFiles)
                ->setVar('jclicJarBase', $jclicJarBase)
                ->setVar('timeLap', $timeLap)
                ->setVar('groupsProAssign', $groupsString);

        LogUtil::registerStatus($this->__('The module configuration has changed'));

        return System::redirect(ModUtil::url('IWjclic', 'admin', 'main'));
    }
开发者ID:projectesIF,项目名称:Sirius,代码行数:33,代码来源:Admin.php


示例16: configure

 /**
  * Configuration screen.
  *
  * @return string Plugin configuration output.
  */
 public function configure()
 {
     // Create form
     $form = FormUtil::newForm($this->pluginName, $this);
     $form->setCompileId($this->pluginName);
     return $form->execute('configure.tpl', new Scribite_FormHandler_ModifyEditor());
 }
开发者ID:pheski,项目名称:Scribite,代码行数:12,代码来源:Controller.php


示例17: 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));
 }
开发者ID:nmpetkov,项目名称:AddressBook,代码行数:25,代码来源:Ajax.php


示例18: display

 /**
  * display items for a day
  *
  * @param $args array Arguments array.
  *
  * @return string html string
  */
 public function display($args)
 {
     $eid = FormUtil::getPassedValue('eid', isset($args['eid']) ? $args['eid'] : null, 'REQUEST');
     $objectid = FormUtil::getPassedValue('objectid', isset($args['objectid']) ? $args['objectid'] : null, 'REQUEST');
     if (!empty($objectid)) {
         $eid = $objectid;
     }
     if (!isset($args['eid']) and !empty($eid)) {
         $args['eid'] = $eid;
     }
     // Chek permissions
     $this->throwForbiddenUnless(SecurityUtil::checkPermission('Ephemerides::', '::', ACCESS_READ), LogUtil::getErrorMsgPermission());
     // check if the contents are cached.
     $template = 'ephemerides_user_display.tpl';
     if ($this->view->is_cached($template)) {
         return $this->view->fetch($template);
     }
     // get items
     if (isset($args['eid']) and $args['eid'] > 0) {
         $items = ModUtil::apiFunc($this->name, 'user', 'getall', $args);
     } else {
         $items = ModUtil::apiFunc($this->name, 'user', 'gettoday', $args);
     }
     $this->view->assign('items', $items);
     return $this->view->fetch($template);
 }
开发者ID:nmpetkov,项目名称:Ephemerides,代码行数:33,代码来源:User.php


示例19: main

    /**
     * display theme changing user interface
     */
    public function main()
    {
        // check if theme switching is allowed
        if (!System::getVar('theme_change')) {
            LogUtil::registerError($this->__('Notice: Theme switching is currently disabled.'));
            $this->redirect(ModUtil::url('Users', 'user', 'main'));
        }

        if (!SecurityUtil::checkPermission('Theme::', '::', ACCESS_COMMENT)) {
            return LogUtil::registerPermissionError();
        }

        // get our input
        $startnum = FormUtil::getPassedValue('startnum', isset($args['startnum']) ? $args['startnum'] : 1, 'GET');

        // we need this value multiple times, so we keep it
        $itemsperpage = $this->getVar('itemsperpage');

        // get some use information about our environment
        $currenttheme = ThemeUtil::getInfo(ThemeUtil::getIDFromName(UserUtil::getTheme()));

        // get all themes in our environment
        $allthemes = ThemeUtil::getAllThemes(ThemeUtil::FILTER_USER);

        $previewthemes = array();
        $currentthemepic = null;
        foreach ($allthemes as $key => $themeinfo) {
            $themename = $themeinfo['name'];
            if (file_exists($themepic = 'themes/'.DataUtil::formatForOS($themeinfo['directory']).'/images/preview_medium.png')) {
                $themeinfo['previewImage'] = $themepic;
                $themeinfo['largeImage'] = 'themes/'.DataUtil::formatForOS($themeinfo['directory']).'/images/preview_large.png';
            } else {
                $themeinfo['previewImage'] = 'system/Theme/images/preview_medium.png';
                $themeinfo['largeImage'] = 'system/Theme/images/preview_large.png';
            }
            if ($themename == $currenttheme['name']) {
                $currentthemepic = $themepic;
                unset($allthemes[$key]);
            } else {
                $previewthemes[$themename] = $themeinfo;
            }
        }

        $previewthemes = array_slice($previewthemes, $startnum-1, $itemsperpage);

        $this->view->setCaching(Zikula_View::CACHE_DISABLED);

        $this->view->assign('currentthemepic', $currentthemepic)
                   ->assign('currenttheme', $currenttheme)
                   ->assign('themes', $previewthemes)
                   ->assign('defaulttheme', ThemeUtil::getInfo(ThemeUtil::getIDFromName(System::getVar('Default_Theme'))));

        // assign the values for the pager plugin
        $this->view->assign('pager', array('numitems' => sizeof($allthemes),
                                           'itemsperpage' => $itemsperpage));

        // Return the output that has been generated by this function
        return $this->view->fetch('theme_user_main.tpl');
    }
开发者ID:projectesIF,项目名称:Sirius,代码行数:62,代码来源:User.php


示例20: prepareItemActions

 /**
  * Collect available actions for this entity.
  */
 protected function prepareItemActions()
 {
     if (!empty($this->_actions)) {
         return;
     }
     $currentType = FormUtil::getPassedValue('type', 'user', 'GETPOST', FILTER_SANITIZE_STRING);
     $currentFunc = FormUtil::getPassedValue('func', 'main', 'GETPOST', FILTER_SANITIZE_STRING);
     $dom = ZLanguage::getModuleDomain('Reviews');
     if ($currentType == 'admin') {
         if (in_array($currentFunc, array('main', 'view'))) {
             $this->_actions[] = array('url' => array('type' => 'user', 'func' => 'display', 'arguments' => array('ot' => 'review', 'id' => $this['id'], 'slug' => $this->slug)), 'icon' => 'preview', 'linkTitle' => __('Open preview page', $dom), 'linkText' => __('Preview', $dom));
             $this->_actions[] = array('url' => array('type' => 'admin', 'func' => 'display', 'arguments' => array('ot' => 'review', 'id' => $this['id'], 'slug' => $this->slug)), 'icon' => 'display', 'linkTitle' => str_replace('"', '', $this->getTitleFromDisplayPattern()), 'linkText' => __('Details', $dom));
         }
         if (in_array($currentFunc, array('main', 'view', 'display'))) {
             $component = 'Reviews:Review:';
             $instance = $this->id . '::';
             if (SecurityUtil::checkPermission($component, $instance, ACCESS_EDIT)) {
                 $this->_actions[] = array('url' => array('type' => 'admin', 'func' => 'edit', 'arguments' => array('ot' => 'review', 'id' => $this['id'])), 'icon' => 'edit', 'linkTitle' => __('Edit', $dom), 'linkText' => __('Edit', $dom));
                 $this->_actions[] = array('url' => array('type' => 'admin', 'func' => 'edit', 'arguments' => array('ot' => 'review', 'astemplate' => $this['id'])), 'icon' => 'saveas', 'linkTitle' => __('Reuse for new item', $dom), 'linkText' => __('Reuse', $dom));
             }
             if (SecurityUtil::checkPermission($component, $instance, ACCESS_DELETE)) {
                 $this->_actions[] = array('url' => array('type' => 'admin', 'func' => 'delete', 'arguments' => array('ot' => 'review', 'id' => $this['id'])), 'icon' => 'delete', 'linkTitle' => __('Delete', $dom), 'linkText' => __('Delete', $dom));
             }
         }
         if ($currentFunc == 'display') {
             $this->_actions[] = array('url' => array('type' => 'admin', 'func' => 'view', 'arguments' => array('ot' => 'review')), 'icon' => 'back', 'linkTitle' => __('Back to overview', $dom), 'linkText' => __('Back to overview', $dom));
         }
     }
     if ($currentType == 'user') {
         if (in_array($currentFunc, array('main', 'view'))) {
             if (ModUtil::getVar('Reviews', 'addcategorytitletopermalink') == 1 && ModUtil::getVar('Reviews', 'enablecategorization') == 1) {
                 $this->_actions[] = array('url' => array('type' => 'user', 'func' => 'display', 'arguments' => array('ot' => 'review', 'id' => $this['id'], 'slug' => $this->slug)), 'icon' => 'display', 'linkTitle' => str_replace('"', '', $this->getTitleFromDisplayPattern()), 'linkText' => __('Details', $dom));
             } else {
                 $this->_actions[] = array('url' => array('type' => 'user', 'func' => 'display', 'arguments' => array('ot' => 'review', 'id' => $this['id'], 'slug' => $this->slug)), 'icon' => 'display', 'linkTitle' => str_replace('"', '', $this->getTitleFromDisplayPattern()), 'linkText' => __('Details', $dom));
             }
         }
         /* if (in_array($currentFunc, array('main', 'view', 'display'))) {
             $component = 'Reviews:Review:';
            $instance = $this->id . '::';
            if (SecurityUtil::checkPermission($component, $instance, ACCESS_EDIT)) {
            $this->_actions[] = array(
                    'url' => array('type' => 'user', 'func' => 'edit', 'arguments' => array('ot' => 'review', 'id' => $this['id'])),
                    'icon' => 'edit',
                    'linkTitle' => __('Edit', $dom),
                    'linkText' => __('Edit', $dom)
            );
            $this->_actions[] = array(
                    'url' => array('type' => 'user', 'func' => 'edit', 'arguments' => array('ot' => 'review', 'astemplate' => $this['id'])),
                    'icon' => 'saveas',
                    'linkTitle' => __('Reuse for new item', $dom),
                    'linkText' => __('Reuse', $dom)
            );
            }
            } */
         if ($currentFunc == 'display') {
             $this->_actions[] = array('url' => array('type' => 'user', 'func' => 'view', 'arguments' => array('ot' => 'review')), 'icon' => 'back', 'linkTitle' => __('Back to overview', $dom), 'linkText' => __('Back to overview', $dom));
         }
     }
 }
开发者ID:rmaiwald,项目名称:Reviews,代码行数:62,代码来源:Review.php



注:本文中的FormUtil类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP FormValidator类代码示例发布时间:2022-05-23
下一篇:
PHP FormUI类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap