function _actionDispatch() { if (!empty($this->mExecutePermission) && !NBFrame::checkRight($this->mExecutePermission)) { $this->mErrorMsg = $this->__e('Permission Error'); return NBFRAME_ACTION_ERROR; } $this->mOp = $this->mRequest->getParam('op'); $executeMethod = 'execute' . ucfirst($this->mOp) . 'Op'; if (in_array($this->mOp, $this->mAllowedOp)) { if (method_exists($this, $executeMethod)) { return $this->{$executeMethod}(); } else { return NBFRAME_ACTION_VIEW_DEFAULT; } } else { $this->mErrorMsg = $this->__e('Invalid Operation'); return NBFRAME_ACTION_ERROR; } }
function viewDefaultOp() { //---------------------------------------------- $this->mXoopsTpl->assign('mygmap_API', $GLOBALS['xoopsModuleConfig']['mygmap_api']); $this->mXoopsTpl->assign('mygmap_dirname', $this->mDirName); $this->mXoopsTpl->assign('mygmap_center_lat', $this->elements['center_lat']); $this->mXoopsTpl->assign('mygmap_center_lng', $this->elements['center_lng']); $this->mXoopsTpl->assign('mygmap_zoom', $this->elements['zoom']); $this->mXoopsTpl->assign('mygmap_maptype', $this->elements['maptype']); $this->mXoopsTpl->assign('mygmap_category', $this->elements['category']); $this->mXoopsTpl->assign('mygmap_catlist', $this->elements['catlist']); $this->mXoopsTpl->assign('mygmap_markers', $this->elements['markers']); $this->mXoopsTpl->assign('mygmap_areas', $this->elements['areas']); $this->mXoopsTpl->assign('mygmap_overlays', $this->elements['overlay']); $this->mXoopsTpl->assign('mygmap_search', $GLOBALS['xoopsModuleConfig']['mygmap_search']); $this->mXoopsTpl->assign('mygmap_addr', $this->elements['addr']); $this->mXoopsTpl->assign('mygmap_station', $this->elements['station']); $this->mXoopsTpl->assign('mygmap_invgeo', $GLOBALS['xoopsModuleConfig']['mygmap_invgeo']); $this->mXoopsTpl->assign('mygmap_link', $GLOBALS['xoopsModuleConfig']['mygmap_link']); $this->mXoopsTpl->assign('mygmap_wiki', $GLOBALS['xoopsModuleConfig']['mygmap_wiki']); $this->mXoopsTpl->assign('mygmap_blog', $GLOBALS['xoopsModuleConfig']['mygmap_blog']); $this->mXoopsTpl->assign('mygmap_width', $GLOBALS['xoopsModuleConfig']['mygmap_width']); $this->mXoopsTpl->assign('mygmap_height', $GLOBALS['xoopsModuleConfig']['mygmap_height']); $this->mXoopsTpl->assign('mygmap_setdef_show', $GLOBALS['xoopsModuleConfig']['mygmap_setdef_show']); $this->mXoopsTpl->assign('mygmap_debug', $GLOBALS['xoopsModuleConfig']['mygmap_debug']); $credit = $GLOBALS['mygmap_credit']; if ($GLOBALS['xoopsModuleConfig']['mygmap_search']) { $credit .= '<br />' . $GLOBALS['mygmap_csis_credit']; } if ($GLOBALS['xoopsModuleConfig']['mygmap_invgeo']) { $credit .= '<br />' . $GLOBALS['mygmap_invgeo_credit']; } $this->mXoopsTpl->assign('xoopsUserIsAdmin', $GLOBALS['xoopsUserIsAdmin']); $this->mXoopsTpl->assign('mygmap_can_edit_area', NBFrame::checkRight('area_edit')); $this->mXoopsTpl->assign('mygmap_can_edit_category', NBFrame::checkRight('category_edit')); if (!empty($this->elements['category']) && $this->elements['category']['id'] > 0) { $this->mXoopsTpl->assign('mygmap_can_add_marker', NBFrame::checkRight('marker_edit') && $this->elements['category']['can_edit']); } else { $this->mXoopsTpl->assign('mygmap_can_add_marker', $GLOBALS['xoopsUserIsAdmin']); } $this->mXoopsTpl->assign('mygmap_setdef_show', $GLOBALS['xoopsModuleConfig']['mygmap_setdef_show']); NBFrame::using('MyGmapUtils', $this->mEnvironment); foreach (MyGmapUtils::getPluginFiles($this->mDirName, 'php') as $file) { require_once $file; $class = basename($file); $class = substr($class, 0, strlen($class) - 4); if (class_exists($class)) { call_user_func_array(array($class, 'viewDefaultOp'), array(&$this)); } } $extra = ''; foreach (MyGmapUtils::getPluginFiles($this->mDirName, 'html') as $file) { $extra .= $this->mXoopsTpl->fetch($file); } $this->mXoopsTpl->assign('mygmap_extra_info', $extra); if (!empty($GLOBALS['mygmap_plugin_credit'])) { $credit .= $GLOBALS['mygmap_plugin_credit']; } $this->mXoopsTpl->assign('mygmap_credit', $credit); }