当前位置: 首页>>代码示例>>PHP>>正文


PHP ModUtil::isHooked方法代码示例

本文整理汇总了PHP中ModUtil::isHooked方法的典型用法代码示例。如果您正苦于以下问题:PHP ModUtil::isHooked方法的具体用法?PHP ModUtil::isHooked怎么用?PHP ModUtil::isHooked使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ModUtil的用法示例。


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

示例1: smarty_function_modishooked

/**
 * Zikula_View function to check for the availability of a module
 *
 * This function calls ModUtil::isHooked to determine if two Zikula modules are
 * hooked together. True is returned if the modules are hooked, false otherwise.
 * The result can also be assigned to a template variable.
 *
 * Available parameters:
 *   - tmodname:  The well-known name of the hook module
 *   - smodname:  The well-known name of the calling module
 *   - assign:    The name of a variable to which the results are assigned
 *
 * Examples
 *   {modishooked tmodname='Ratings' smodname='News'}
 *
 *   {modishooked tmodname='bar' smodname='foo' assign='barishookedtofoo'}
 *   {if $barishookedtofoo}.....{/if}
 *
 * @param array       $params All attributes passed to this function from the template.
 * @param Zikula_View $view   Reference to the Zikula_View object.
 *
 * @see    function.modishooked.php::smarty_function_modishooked()
 *
 * @return boolean True if the module is available; false otherwise.
 */
function smarty_function_modishooked($params, $view)
{
    LogUtil::log(__f('Warning! Template plugin {%1$s} is deprecated.', array('modishooked')), E_USER_DEPRECATED);

    $assign   = isset($params['assign'])   ? $params['assign']   : null;
    $smodname = isset($params['smodname']) ? $params['smodname'] : null;
    $tmodname = isset($params['tmodname']) ? $params['tmodname'] : null;

    if (!$tmodname) {
        $view->trigger_error(__f('Error! in %1$s: the %2$s parameter must be specified.', array('modishooked', 'tmodname')));
        return false;
    }

    if (!$smodname) {
        $view->trigger_error(__f('Error! in %1$s: the %2$s parameter must be specified.', array('modishooked', 'smodname')));
        return false;
    }

    $result = ModUtil::isHooked($tmodname, $smodname);

    if ($assign) {
        $view->assign($params['assign'], $result);
    } else {
        return $result;
    }
}
开发者ID:,项目名称:,代码行数:51,代码来源:

示例2: comment

 /**
  * Display a comment form
  *
  * This function displays a comment form, if you do not want users to
  * comment on the same page as the item is.
  *
  * @param $comment the comment (taken from HTTP put)
  * @param $mod the name of the module the comment is for (taken from HTTP put)
  * @param $objectid ID of the item the comment is for (taken from HTTP put)
  * @param $redirect URL to return to (taken from HTTP put)
  * @param $subject The subject of the comment (if any) (taken from HTTP put)
  * @param $replyto The ID of the comment for which this an anser to (taken from HTTP put)
  * @param $template The name of the template file to use (with extension)
  * @todo Check out it this function can be merged with _view!
  * @since 0.2
  */
 public function comment($args)
 {
     $mod = isset($args['mod']) ? $args['mod'] : FormUtil::getPassedValue('mod', null, 'POST');
     $objectid = isset($args['objectid']) ? $args['objectid'] : FormUtil::getPassedValue('objectid', null, 'POST');
     $areaid = isset($args['areaid']) ? $args['areaid'] : FormUtil::getPassedValue('areaid', null, 'POST');
     $redirect = isset($args['redirect']) ? $args['redirect'] : FormUtil::getPassedValue('redirect', null, 'POST');
     $useurl = isset($args['useurl']) ? $args['useurl'] : FormUtil::getPassedValue('useurl', null, 'POST');
     $comment = isset($args['comment']) ? $args['comment'] : FormUtil::getPassedValue('comment', null, 'POST');
     $subject = isset($args['subject']) ? $args['subject'] : FormUtil::getPassedValue('subject', null, 'POST');
     $replyto = isset($args['replyto']) ? $args['replyto'] : FormUtil::getPassedValue('replyto', null, 'POST');
     $order = isset($args['order']) ? $args['order'] : FormUtil::getPassedValue('order', null, 'POST');
     $owneruid = isset($args['owneruid']) ? $args['owneruid'] : FormUtil::getPassedValue('owneruid', null, 'POST');
     $template = isset($args['template']) ? $args['template'] : FormUtil::getPassedValue('template', null, 'POST');
     $stylesheet = isset($args['ezccss']) ? $args['ezccss'] : FormUtil::getPassedValue('ezccss', null, 'POST');
     if ($order == 1) {
         $sortorder = 'DESC';
     } else {
         $sortorder = 'ASC';
     }
     $status = 0;
     // check if commenting is setup for the input module
     if (!ModUtil::available($mod) || !ModUtil::isHooked('EZComments', $mod)) {
         return LogUtil::registerPermissionError();
     }
     // check if we're using the pager
     $enablepager = $this->getVar('enablepager');
     if ($enablepager) {
         $numitems = $this->getVar('commentsperpage');
         $startnum = FormUtil::getPassedValue('comments_startnum');
         if (!isset($startnum) && !is_numeric($startnum)) {
             $startnum = -1;
         }
     } else {
         $startnum = -1;
         $numitems = -1;
     }
     $items = ModUtil::apiFunc('EZComments', 'user', 'getall', compact('mod', 'objectid', 'sortorder', 'status', 'numitems', 'startnum'));
     if ($items === false) {
         return LogUtil::registerError($this->__('Internal Error.'), null, 'index.php');
     }
     $items = ModUtil::apiFunc('EZComments', 'user', 'prepareCommentsForDisplay', $items);
     if ($enablepager) {
         $commentcount = ModUtil::apiFunc('EZComments', 'user', 'countitems', compact('mod', 'objectid'));
     } else {
         $commentcount = count($items);
     }
     // don't use caching (for now...)
     $this->view->setCaching(false);
     $this->view->assign('comments', $items)->assign('commentcount', $commentcount)->assign('order', $sortorder)->assign('redirect', $redirect)->assign('allowadd', SecurityUtil::checkPermission('EZComments::', "{$mod}:{$objectid}: ", ACCESS_COMMENT))->assign('mod', DataUtil::formatForDisplay($mod))->assign('objectid', DataUtil::formatForDisplay($objectid))->assign('subject', DataUtil::formatForDisplay($subject))->assign('replyto', DataUtil::formatForDisplay($replyto))->assign('owneruid', $owneruid)->assign('useurl', $useurl)->assign(ModUtil::getVar('EZComments'))->assign('ezc_pager', array('numitems' => $commentcount, 'itemsperpage' => $numitems));
     // find out which template to use
     $templateset = isset($args['template']) ? $args['template'] : $template;
     $defaultcss = $this->getVar('css', 'style.css');
     if (!$this->view->template_exists(DataUtil::formatForOS($templateset) . '/ezcomments_user_comment.tpl')) {
         $templateset = $this->getVar('template', 'Standard');
     }
     $this->view->assign('template', $templateset);
     // include stylesheet if there is a style sheet
     $css = $stylesheet ? "{$stylesheet}.css" : $defaultcss;
     if ($css = ModUtil::apiFunc('EZComments', 'user', 'getStylesheet', array('path' => "{$templateset}/{$css}"))) {
         PageUtil::addVar('stylesheet', $css);
     }
     // FIXME comment template missing
     return $this->view->fetch(DataUtil::formatForOS($templateset) . '/ezcomments_user_view.tpl');
 }
开发者ID:rmaiwald,项目名称:EZComments,代码行数:80,代码来源:User.php

示例3: pnModIsHooked

/**
 * Determine if a module is hooked by another module.
 *
 * @deprecated
 * @see ModUtil::isHooked()
 *
 * @param string $tmodule The target module.
 * @param string $smodule The source module - default the current top most module.
 *
 * @return boolean True if the current module is hooked by the target module, false otherwise.
 */
function pnModIsHooked($tmodule, $smodule)
{
    LogUtil::log(__f('Warning! Function %1$s is deprecated. Please use %2$s instead.', array(__FUNCTION__, 'ModUtil::isHooked()')), E_USER_DEPRECATED);
    return ModUtil::isHooked($tmodule, $smodule);
}
开发者ID:,项目名称:,代码行数:16,代码来源:

示例4: main


//.........这里部分代码省略.........
                    $pot_editar = true;
                }

                // The user can delete his/her notes
                $pot_esborrar = false;
                if (($permissions['nivell'] > 5 &&
                        $registre['informa'] == $uid) ||
                        $permissions['nivell'] == 7) {
                    $pot_esborrar = true;
                }

                // Get file extension
                $fileExtension = strtolower(substr(strrchr($registre['fitxer'], "."), 1));

                // get file icon
                $ctypeArray = ModUtil::func('IWmain', 'user', 'getMimetype', array('extension' => $fileExtension));
                $fileIcon = $ctypeArray['icon'];

                $edited = '';

                if ($registre['edited'] != '' &&
                        ModUtil::getVar('IWnoteboard', 'editPrintAfter') != '-1' &&
                        $registre['data'] + ModUtil::getVar('IWnoteboard', 'editPrintAfter') * 60 < $registre['edited']) {
                    $edited = date('d/m/y H:i', $registre['edited']);
                }

                $usersList .= $registre['informa'] . '$$';

                $anotacions[] = array('nid' => $registre['nid'],
                    'bgcolor' => $bgcolor,
                    'data' => date('d/m/y H:i', $registre['data']),
                    'acces_tema' => $acces_tema,
                    'tema_anotacio' => $tema_anotacio['nomtema'],
                    'noticia' => DataUtil::formatForDisplayHTML($registre['noticia']),
                    'mes_info' => $registre['mes_info'],
                    'text' => $registre['text'],
                    'textfitxer' => $registre['textfitxer'],
                    'fitxer' => $registre['fitxer'],
                    'fileIcon' => $fileIcon,
                    'informa' => $informa,
                    'photo' => $photo,
                    'verifica' => $registre['verifica'],
                    'pot_editar' => $pot_editar,
                    'pot_esborrar' => $pot_esborrar,
                    'admet_comentaris' => $registre['admet_comentaris'],
                    'n_comentaris' => count($comentaris),
                    'comentaris' => $comentaris_array,
                    'marca' => $marca,
                    'edited' => $edited,
                    'created_by' => $registre['informa'],
                    'edited_by' => UserUtil::getVar('uname', $registre['edited_by']),
                );
                $vistes .= '$' . $registre['nid'] . '$';
            }
        }

        if ($saved != 1 && UserUtil::isLoggedIn()) {
            $sv = ModUtil::func('IWmain', 'user', 'genSecurityValue');

            if ($tema == 0 && $nid == 0 && $marked == 0 && ModUtil::getVar('IWnoteboard', 'multiLanguage') == 0) {
                ModUtil::func('IWmain', 'user', 'userSetVar', array('module' => 'IWnoteboard',
                            'name' => 'viewed',
                            'value' => $vistes,
                            'sv' => $sv));
            } else {
                ModUtil::func('IWmain', 'user', 'userSetVar', array('module' => 'IWnoteboard',
                            'name' => 'viewed',
                            'value' => $havist . $vistes,
                            'sv' => $sv));
            }

            $sv = ModUtil::func('IWmain', 'user', 'genSecurityValue');
            ModUtil::func('IWmain', 'user', 'userDelVar', array('module' => 'IWmain_block_news',
                        'name' => 'news',
                        'sv' => $sv));
        }

        // Count the use of the module
        if (ModUtil::available('iw_visits') &&
                ModUtil::isHooked('iw_visits', 'IWnoteboard')) {
            // Insert the record
            ModUtil::apiFunc('iw_visits', 'user', 'visita');
        }

        $sv = ModUtil::func('IWmain', 'user', 'genSecurityValue');
        $users = ModUtil::func('IWmain', 'user', 'getAllUsersInfo', array('info' => 'ccn',
                    'sv' => $sv,
                    'list' => $usersList));

        return $this->view->assign('temes_MS', $temes_MS)
                ->assign('users', $users)
                ->assign('tema', $tema)
                ->assign('saved', $saved)
                ->assign('permisos', $permissions)
                ->assign('saved', $saved)
                ->assign('anotacions', $anotacions)
                ->assign('loggedIn', UserUtil::isLoggedIn())
                ->assign('notRegisteredSeeRedactors', ModUtil::getVar('IWnoteboard', 'notRegisteredSeeRedactors'))
                ->fetch('IWnoteboard_user_main.tpl');
    }
开发者ID:projectesIF,项目名称:Sirius,代码行数:101,代码来源:User.php


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