function show(&$environment, $option)
 {
     $dirName = $environment->getDirName();
     static $id = 0;
     if (defined('MYGMAP_GMAPI_INCLUDED')) {
         $block['gmapi_include'] = 0;
     } else {
         $block['gmapi_include'] = 1;
         define('MYGMAP_GMAPI_INCLUDED', 1);
     }
     $markerHandler =& NBFrame::getHandler('MyGmapMarker', $environment);
     $markerObject =& $markerHandler->get($option[0]);
     if ($markerObject) {
         $configHandler =& NBFrame::getHandler('NBFrame.xoops.Config', NBFrame::null());
         $block['mygmap_API'] = $configHandler->getModuleConfig($dirName, 'mygmap_api');
         $block['dirname'] = $dirName;
         $block['divid'] = 'mygmap_mini_' . $id;
         $id++;
         $block['id'] = $markerObject->getVar('mygmap_marker_id');
         $block['category_id'] = $markerObject->getVar('mygmap_marker_category_id');
         $block['title'] = $markerObject->getVar('mygmap_marker_title');
         $block['lat'] = $markerObject->getVar('mygmap_marker_lat');
         $block['lng'] = $markerObject->getVar('mygmap_marker_lng');
         $block['zoom'] = $markerObject->getVar('mygmap_marker_zoom');
         $block['maptype'] = $markerObject->getVar('mygmap_marker_maptype');
         return $block;
     } else {
         return null;
     }
 }
 function putIcon($fileName, $contentType)
 {
     error_reporting(E_ERROR);
     $dirName = $this->mEnvironment->getDirName();
     $origDirName = $this->mEnvironment->getOrigDirName();
     if (file_exists($fileName)) {
         header('Content-Type: ' . $contentType);
         NBFrame::using('HTTPOutput');
         NBFrameHTTPOutput::staticContentHeader(filemtime($fileName), $fileName . $dirName);
         if ($contentType == 'image/png' && function_exists('imagecreatefrompng') && function_exists('imagecolorallocate') && function_exists('imagestring') && function_exists('imagepng')) {
             $im = imagecreatefrompng($fileName);
             $this->overlayText($im, $dirName, $origDirName);
             imagepng($im);
             imagedestroy($im);
         } else {
             if ($contentType == 'image/gif' && function_exists('imagecreatefromgif') && function_exists('imagecolorallocate') && function_exists('imagestring') && function_exists('imagegif')) {
                 $im = imagecreatefromgif($fileName);
                 $this->overlayText($im, $dirName, $origDirName);
                 imagegif($im);
                 imagedestroy($im);
             } else {
                 $handle = fopen($fileName, 'rb');
                 $content = '';
                 while (!feof($handle)) {
                     $content .= fread($handle, 16384);
                 }
                 header('Content-Length: ' . strlen($content));
                 echo $content;
             }
         }
         exit;
     }
 }
 function &buildEditForm(&$object)
 {
     $parentCategoryHandler =& NBFrame::getHandler('SimpleLinkCategory', $this->mEnvironment);
     $this->addOptionArray('category_parent_id', $parentCategoryHandler->getParentSelectOptionArray($object->getKey()));
     $form =& parent::buildEditForm($object);
     return $form;
 }
 function _Url($start)
 {
     if ($start) {
         return NBFrame::addQueryArgs($this->mBaseUrl, array($this->mName => $start));
     } else {
         return $this->mBaseUrl;
     }
 }
 function getAdminMenu()
 {
     $constpref = NBFrame::langConstPrefix('MI', '', NBFRAME_TARGET_LOADER);
     $adminmenu = array();
     $adminmenu[] = array('title' => constant($constpref . 'AD_MENU0'), 'link' => $this->mEnvironment->getActionUrl('admin.SimpleLinkLinkAdmin', array(), 'html', true));
     $adminmenu[] = array('title' => constant($constpref . 'AD_MENU1'), 'link' => $this->mEnvironment->getActionUrl('admin.SimpleLinkCategoryAdmin', array(), 'html', true));
     return $adminmenu;
 }
 function _getPreferenceEditUrl(&$environment)
 {
     if (NBFrame::checkAltSys(false) && $environment->getAttribute('UseAltSys')) {
         return $environment->getActionUrl('NBFrame.admin.AltSys', array('page' => 'mypreferences'), 'html', false, false);
     } else {
         $root =& XCube_Root::getSingleton();
         return $root->mController->getHelpViewUrl($this->mXoopsModule);
     }
 }
 function getRSS(&$items)
 {
     $linkHandler =& NBFrame::getHandler('SimpleLinkLink', $this->mEnvironment);
     $linkObjects =& $linkHandler->getObjects();
     foreach ($linkObjects as $linkObject) {
         $item = array('title' => $linkObject->getVar('link_name'), 'link' => $this->mEnvironment->getUrlBase(), 'guid' => $this->mEnvironment->getUrlBase(), 'pubdate' => 0);
         $items[] = $item;
     }
 }
 function executeDefaultOp()
 {
     error_reporting(0);
     $fileName = basename($_GET['file']);
     $fileName = XOOPS_TRUST_PATH . '/data/kml/' . $fileName;
     if (!empty($fileName) && file_exists($fileName)) {
         NBFrame::using('HTTPOutput');
         NBFrameHTTPOutput::putFile($fileName, 'application/vnd.google-earth.kml+xml;charset="UTF-8"', false);
     }
 }
 function bindAction(&$action)
 {
     $this->mAction =& $action;
     $this->mDirName = $action->mDirName;
     if ($action->mHalfAutoList || preg_match('/^NBFrameObjectList$/i', get_class($this))) {
         NBFrame::using('TebleParser');
         $parser =& new NBFrameTebleParser($action->mObjectHandler->db);
         $parser->setListElements($action->mObjectHandler->mTableName, $this);
     }
 }
 function prepare()
 {
     $this->categoryHandler =& NBFrame::getHandler('SimpleLinkCategory', $this->mEnvironment);
     $this->addElement('link_id', '#', 20, array('sort' => true));
     $this->addElement('link_name', $this->__l('link_name'), 200, array('sort' => true));
     $this->addElement('link_category_id', $this->__l('link_category_id'), 150, array('sort' => true));
     $this->addElement('link_weight', $this->__l('link_weight'), 150, array('sort' => true));
     $this->addElement('__SimpleEditLink__', '', 50, array('caption' => $this->__l('Edit')));
     $this->addElement('__SimpleDeleteLink__', '', 50, array('caption' => $this->__l('Delete')));
 }
 function prepare()
 {
     $this->categoryHandler =& NBFrame::getHandler('MyGmapCategory', $this->mEnvironment);
     $this->addElement('mygmap_marker_id', '#', 20, array('sort' => true));
     $this->addElement('mygmap_marker_category_id', $this->__l('mygmap_marker_category_id'), 150, array('sort' => true));
     $this->addElement('mygmap_marker_title', $this->__l('mygmap_marker_title'), 300);
     $this->addElement('mygmap_marker_icontext', $this->__l('mygmap_marker_icontext'), 50, array('sort' => true));
     $this->addElement('mygmap_marker_maptype', $this->__l('mygmap_marker_maptype'), 80, array('sort' => true));
     $this->addElement('__SimpleEditLink__', '', 50, array('caption' => $this->__l('Edit')));
     $this->addElement('__SimpleDeleteLink__', '', 50, array('caption' => $this->__l('Delete')));
 }
 function prepare()
 {
     $this->addElement('mygmap_marker_category_id', new XoopsFormSelect($this->__l('mygmap_marker_category_id'), 'mygmap_marker_category_id'));
     $this->addElement('mygmap_marker_icontext', new XoopsFormSelect($this->__l('mygmap_marker_icontext'), 'mygmap_marker_icontext'));
     $this->addElement('mygmap_marker_zoom', new XoopsFormSelect($this->__l('mygmap_marker_zoom'), 'mygmap_marker_zoom'));
     $this->addElement('mygmap_marker_maptype', new XoopsFormSelect($this->__l('mygmap_marker_maptype'), 'mygmap_marker_maptype'));
     $this->addObjectOptionArray('mygmap_marker_category_id', 'MyGmapCategory');
     $markerHandler =& NBFrame::getHandler('MyGmapMarker', $this->mEnvironment);
     $this->addOptionArray('mygmap_marker_icontext', $markerHandler->getIconListArray());
     $this->addOptionArray('mygmap_marker_zoom', array('0' => '0', '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', '10' => '10', '11' => '11', '12' => '12', '13' => '13', '14' => '14', '15' => '15', '16' => '16', '17' => '17', '18' => '18', '19' => '19', '20' => '20', '21' => '21', '22' => '22', '23' => '23', '24' => '24'));
     $this->addOptionArray('mygmap_marker_maptype', array('0' => '----', '1' => $this->__l('Maptype Map'), '2' => $this->__l('Maptype Satelite'), '3' => $this->__l('Maptype Hybrid')));
 }
 function checkGroupPerm($mode, $bypassAdminCheck = false)
 {
     $categoryHandler =& NBFrame::getHandler('MyGmapCategory', $this->mHandler->mEnvironment);
     if ($categoryObject =& $categoryHandler->get($this->getVar('mygmap_marker_category_id'))) {
         if ($categoryObject->checkGroupPerm($mode, $bypassAdminCheck)) {
             return true;
         }
         $this->setErrors('Category Permission Error');
         return false;
     }
     return true;
 }
 function setValue($value = 0)
 {
     $value = intval($value) > 0 ? intval($value) : time();
     $value = NBFrame::convServerToLocalTime($value);
     $datetime = getdate($value);
     $hourvalue = $datetime['hours'] * 3600;
     $minutevalue = 300 * ceil($datetime['minutes'] / 5);
     $this->_mDateElement->setValue($value);
     $this->_mHourElement->_value = array();
     $this->_mHourElement->setValue($hourvalue);
     $this->_mMinuteElement->_value = array();
     $this->_mMinuteElement->setValue($minutevalue);
 }
 function insert(&$record, $force = false, $updateOnlyChanged = false)
 {
     if ($result = parent::insert($record, $force, $updateOnlyChanged)) {
         $id = $record->get('tpl_id');
         $tplSourceHandler =& NBFrame::getHandler('NBFrame.xoops.TplSource', $this->mEnvironment);
         if (!($tplSourceObject =& $tplSourceHandler->get($id))) {
             $tplSourceObject =& $tplSourceHandler->create();
             $tplSourceObject->set('tpl_id', $id);
         }
         $tplSourceObject->set('tpl_source', $record->get('tpl_source'));
         $result = $tplSourceHandler->insert($tplSourceObject, $force);
     }
     return $result;
 }
 function executeDefaultOp()
 {
     error_reporting(E_ERROR);
     if (isset($_GET['NBContentFile'])) {
         $fileBaseName = basename($_GET['NBContentFile']);
     } else {
         return;
     }
     $fileName = $this->mEnvironment->findFile($fileBaseName, '/contents', false, '=');
     if (!empty($fileName) && preg_match('/\\.(html|htm)$/', strtolower($fileBaseName), $match)) {
         $this->mFileName = $fileName;
     } else {
         NBFrame::display404Page();
     }
     return NBFRAME_ACTION_VIEW_DEFAULT;
 }
 function renderMyMenu()
 {
     $adminmenu = array();
     include $this->mAction->mEnvironment->findFile('NBFrameAdminMenu.inc.php', 'include');
     $module =& $GLOBALS['xoopsModule'];
     if ($module->getVar('hasconfig')) {
         if (NBFrame::checkAltSys(false) && $this->mAction->mEnvironment->getAttribute('UseAltSys')) {
             array_push($adminmenu, array('title' => _PREFERENCES, 'link' => $this->mAction->mEnvironment->getActionUrl('NBFrame.admin.AltSys', array('page' => 'mypreferences'), 'html', true)));
         } else {
             if (class_exists('XCube_Root')) {
                 if (is_dir(XOOPS_ROOT_PATH . '/modules/legacy/')) {
                     $sysDir = 'legacy';
                 } else {
                     $sysDir = 'base';
                 }
                 array_push($adminmenu, array('title' => _PREFERENCES, 'absolute' => true, 'link' => XOOPS_URL . '/modules/' . $sysDir . '/admin/?action=PreferenceEdit&confmod_id=' . $module->getvar('mid')));
             } else {
                 array_push($adminmenu, array('title' => _PREFERENCES, 'absolute' => true, 'link' => XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $module->getvar('mid')));
             }
         }
     }
     $menuitem_count = 0;
     $mymenu_uri = empty($mymenu_fake_uri) ? $_SERVER['REQUEST_URI'] : $mymenu_fake_uri;
     $mymenu_link = substr(strstr($mymenu_uri, '/admin/'), 1);
     // hilight
     foreach (array_keys($adminmenu) as $i) {
         if (!isset($adminmenu[$i]['absolute'])) {
             $adminmenu[$i]['absolute'] = false;
         }
         if ($mymenu_link == $adminmenu[$i]['link']) {
             $adminmenu[$i]['color'] = '#FFCCCC';
             $adminmenu_hilighted = true;
         } else {
             $adminmenu[$i]['color'] = '#DDDDDD';
         }
     }
     if (empty($adminmenu_hilighted)) {
         foreach (array_keys($adminmenu) as $i) {
             if (stristr($mymenu_uri, $adminmenu[$i]['link'])) {
                 $adminmenu[$i]['color'] = '#FFCCCC';
             }
         }
     }
     $this->mXoopsTpl->assign('adminmenu', $adminmenu);
     $this->mXoopsTpl->assign('myurlbase', XOOPS_URL . '/modules/' . $this->mDirName);
     $this->mXoopsTpl->display('admin/NBFrameAdminMyMenu.html');
 }
 function prepare()
 {
     $this->addElement('mygmap_marker_id', new XoopsFormHidden('mygmap_marker_id', 0));
     $this->addElement('mygmap_marker_category_id', new XoopsFormSelect($this->__l('mygmap_marker_category_id'), 'mygmap_marker_category_id'));
     $this->addElement('mygmap_marker_title', new XoopsFormText($this->__l('mygmap_marker_title'), 'mygmap_marker_title', 35, 255));
     $this->addElement('mygmap_marker_desc', new XoopsFormDhtmlTextArea($this->__l('mygmap_marker_desc'), 'mygmap_marker_desc', '', 8, 25));
     $this->addElement('mygmap_marker_icontext', new XoopsFormSelect($this->__l('mygmap_marker_icontext'), 'mygmap_marker_icontext'));
     $this->addElement('mygmap_marker_maptype', new XoopsFormSelect($this->__l('mygmap_marker_maptype'), 'mygmap_marker_maptype'));
     $this->addElement('mygmap_marker_lat', new XoopsFormHidden('mygmap_marker_lat', 0));
     $this->addElement('mygmap_marker_lng', new XoopsFormHidden('mygmap_marker_lng', 0));
     $this->addElement('mygmap_marker_zoom', new XoopsFormHidden('mygmap_marker_zoom', 0));
     $categoryHandler =& NBFrame::getHandler('MyGmapCategory', $this->mEnvironment);
     $this->addOptionArray('mygmap_marker_category_id', $categoryHandler->getSelectOptionArray(null, 'markereditlist'));
     $markerHandler =& NBFrame::getHandler('MyGmapmarker', $this->mEnvironment);
     $this->addOptionArray('mygmap_marker_icontext', $markerHandler->getIconListArray());
     $this->addOptionArray('mygmap_marker_maptype', array('0' => '----', '1' => $this->__l('Maptype Map'), '2' => $this->__l('Maptype Satelite'), '3' => $this->__l('Maptype Hybrid')));
 }
 function setModuleConfig($dirName, $confName, $confValue, $categoryId = 0)
 {
     $moduleHandler =& NBFrame::getHandler('NBFrame.xoops.Module', NBFrame::null());
     $moduleObject =& $moduleHandler->getByDirname($dirName);
     $moduleId = $moduleObject->getVar('mid');
     $criteria = new CriteriaCompo(new Criteria('conf_modid', $moduleId));
     $criteria->add(new Criteria('conf_catid', $categoryId));
     $criteria->add(new Criteria('conf_name', $confName));
     $configObjects = $this->getObjects($criteria, false);
     if (count($configObjects) == 1) {
         $configObjects[0]->setVar('conf_value', $confValue);
         $this->insert($configObjects[0]);
     }
     if (empty($this->_moduleConfigCache[$dirName])) {
         $this->_moduleConfigCache[$moduleId][$categoryId][$confName] = $confValue;
     }
     return $value;
 }
 function setCaption($caption)
 {
     $this->mCaptionOrig = $caption;
     $nullLanguageManager =& new NBFrameLanguage(NBFrame::null());
     $url = NBFrame::getCurrentURL();
     $url = NBFrame::removeQueryArgs($url, array($this->mGetPrefix . '_html', $this->mGetPrefix . '_xcode'));
     if ($this->mUseHtmlEditor) {
         $url = NBFrame::addQueryArgs($url, array($this->mGetPrefix . '_xcode' => '1'));
         $desc = '<br /><small>&nbsp;<a href="' . $url . '">' . $nullLanguageManager->__l('Switching to XCode Editor') . '</a></small>';
     } else {
         if ($this->mCanUseHtmlEditor) {
             $url = NBFrame::addQueryArgs($url, array($this->mGetPrefix . '_html' => '1'));
             $desc = '<br /><small>&nbsp;<a href="' . $url . '">' . $nullLanguageManager->__l('Switching to HTML Editor') . '</a></small>';
         } else {
             $desc = '';
         }
     }
     parent::setCaption($this->mCaptionOrig . $desc);
 }
 function executePluginOp()
 {
     $fileName = basename($_GET['file']);
     $place = basename($_GET['place']);
     switch ($place) {
         case 'module':
             $fileName = XOOPS_ROOT_PATH . '/modules/' . $this->mEnvironment->getDirName() . '/plugins/' . $fileName;
             break;
         case 'trust':
             $fileName = XOOPS_TRUST_PATH . '/modules/mygmap/plugins/' . $fileName;
             break;
         default:
             $fileName = '';
     }
     if (!empty($fileName)) {
         NBFrame::using('HTTPOutput');
         NBFrameHTTPOutput::putFile($fileName, 'application/x-javascript;charset="EUC-JP"');
     }
 }
 function executeDefaultOp()
 {
     error_reporting(E_ERROR);
     $fileBaseName = basename($_GET['file']);
     $fileName = $this->mEnvironment->findFile($fileBaseName, '/images', false, '=');
     if (!empty($fileName) && preg_match('/\\.(jpeg|jpg|gif|png)$/', strtolower($fileBaseName), $match)) {
         $fileExt = $match[1];
         if ($fileExt == 'jpeg' || $fileExt == 'jpg') {
             $mimeType = 'image/jpeg';
         } else {
             if ($fileExt == 'gif') {
                 $mimeType = 'image/gif';
             } else {
                 if ($fileExt == 'png') {
                     $mimeType = 'image/png';
                 }
             }
         }
         NBFrame::using('HTTPOutput');
         NBFrameHTTPOutput::putFile($fileName, $mimeType);
     }
 }
 function search(&$environment, $queryarray, $andor, $limit, $offset, $userid)
 {
     $ret = array();
     $markerHandler =& NBFrame::getHandler('MyGmapMarker', $environment);
     if (is_array($queryarray) && ($count = count($queryarray))) {
         $criteria0 = new CriteriaCompo(new Criteria('mygmap_marker_title', '%' . $queryarray[0] . '%', 'LIKE'));
         $criteria0->add(new Criteria('mygmap_marker_desc', '%' . $queryarray[0] . '%', 'LIKE'), 'OR');
         $criteria =& new CriteriaCompo($criteria0);
         for ($i = 1; $i < $count; $i++) {
             $criteria0 = new CriteriaCompo(new Criteria('mygmap_marker_title', '%' . $queryarray[$i] . '%', 'LIKE'));
             $criteria0->add(new Criteria('mygmap_marker_desc', '%' . $queryarray[$i] . '%', 'LIKE'), 'OR');
             $criteria->add($criteria0, $andor);
         }
     } else {
         $criteria =& new CriteriaCompo(new CriteriaElement());
     }
     if ($userid) {
         $criteria->add(new Criteria('_NBsys_create_user', $userid));
     }
     $criteria->setLimit($limit);
     $criteria->setStart($offset);
     $markerObjects = $markerHandler->getObjects($criteria);
     foreach ($markerObjects as $markerObject) {
         $desc = $markerObject->getVar('mygmap_marker_desc');
         if (!empty($desc) && function_exists('xoops_make_context')) {
             $context = xoops_make_context(strip_tags($desc), $queryarray);
         } else {
             if (!empty($desc) && function_exists('search_make_context')) {
                 if (!empty($_GET['showcontext']) && $_GET['showcontext'] == 1) {
                     $context = search_make_context(strip_tags($desc), $queryarray);
                 }
             } else {
                 $context = '';
             }
         }
         $ret[] = array('title' => $markerObject->getVar('mygmap_marker_title'), 'uid' => $markerObject->getVar('_NBsys_create_user'), 'time' => $markerObject->getVar('_NBsys_update_time'), 'page' => $markerObject->getVar('mygmap_marker_title'), 'link' => $environment->getActionUrl('MyGmapMain', array('cat' => $markerObject->getVar('mygmap_marker_category_id'), 'id' => $markerObject->getVar('mygmap_marker_id')), 'html', true), 'context' => $context);
     }
     return $ret;
 }
 function executeDefaultOp()
 {
     $this->mList = array();
     $this->mModuleObject =& $this->mEnvironment->getModule();
     $linkHandler =& NBFrame::getHandler('SimpleLinkLink', $this->mEnvironment);
     $categoryHandler =& NBFrame::getHandler('SimpleLinkCategory', $this->mEnvironment);
     $category = $this->mRequest->getParam('cat');
     if (!empty($category)) {
         $criteria =& $categoryHandler->getChildrenCriteria('category_id', $category);
     } else {
         $criteria =& new CriteriaElement();
     }
     $criteria->setSort('category_weight');
     $categoryObjects =& $categoryHandler->getNestedObjects($criteria, '');
     foreach ($categoryObjects as $categoryObject) {
         $criteria =& new Criteria('link_category_id', $categoryObject->getVar('category_id'));
         $criteria->setSort('link_weight');
         $linkObjects = $linkHandler->getObjects($criteria);
         $categoryObject->assignVar('link_objects', $linkObjects);
         $this->mList[] = $categoryObject;
     }
     return NBFRAME_ACTION_VIEW_DEFAULT;
 }
 function search(&$environment, $queryarray, $andor, $limit, $offset, $userid)
 {
     $ret = array();
     $linkHandler =& NBFrame::getHandler('SimpleLinkLink', $environment);
     if (is_array($queryarray) && ($count = count($queryarray))) {
         $criteria =& new CriteriaCompo(new Criteria('link_name', '%' . $queryarray[0] . '%', 'LIKE'));
         for ($i = 1; $i < $count; $i++) {
             $criteria->add(new Criteria('link_name', '%' . $queryarray[$i] . '%', 'LIKE'), $andor);
         }
     } else {
         if ($userid) {
             return array();
         }
         $criteria =& new CriteriaCompo(new CriteriaElement());
     }
     $criteria->setLimit($limit);
     $criteria->setStart($offset);
     $linkObjects = $linkHandler->getObjects($criteria);
     foreach ($linkObjects as $linkObject) {
         $ret[] = array('title' => $linkObject->getVar('link_name'), 'page' => $linkObject->getVar('link_name'), 'uid' => 0);
     }
     return $ret;
 }
 function executeDefaultOp()
 {
     if ($GLOBALS['xoopsUserIsAdmin']) {
         $this->mRequest->defParam('lat', 'POST', 'float', NBFRAME_NO_DEFAULT_PARAM, true);
         $this->mRequest->defParam('lng', 'POST', 'float', NBFRAME_NO_DEFAULT_PARAM, true);
         $this->mRequest->defParam('zoom', 'POST', 'int', NBFRAME_NO_DEFAULT_PARAM, true);
         if (!$this->mRequest->hasError()) {
             $params = $this->mRequest->getParam();
             $update_configs = array('mygmap_lat', 'mygmap_lng', 'mygmap_zoom');
             $update_vars = array('mygmap_lat' => $params['lat'], 'mygmap_lng' => $params['lng'], 'mygmap_zoom' => $params['zoom']);
             $configHandler =& NBFrame::getHandler('NBFrame.xoops.Config', NBFrame::null());
             foreach ($update_vars as $conf_name => $conf_value) {
                 $configHandler->setModuleConfig($this->mDirName, $conf_name, $conf_value);
             }
             return NBFRAME_ACTION_SUCCESS;
         } else {
             $this->mErrorMsg = $this->__e('Invalid Operation');
             return NBFRAME_ACTION_ERROR;
         }
     } else {
         $this->mErrorMsg = $this->__e('Permission Error');
         return NBFRAME_ACTION_ERROR;
     }
 }
 function executeGpermOp()
 {
     $mid = $GLOBALS['xoopsModule']->getVar('mid');
     $criteria =& new Criteria('mid', $mid);
     $this->mObjects =& $this->mObjectHandler->getObjects($criteria);
     $groupPermHandler =& NBFrame::getHandler('NBFrame.xoops.GroupPerm', NBFrame::null());
     foreach ($this->mGroupPermSysKeys as $groupPermKey) {
         $this->mRequest->defParam('gperm_' . $groupPermKey, 'POST', 'array-int', array());
         $groups = $this->mRequest->getParam('gperm_' . $groupPermKey);
         $groupPermHandler->setRight($groupPermKey, $mid, $groups, 1);
     }
     foreach ($this->mGroupPermModuleKeys as $groupPermKey) {
         $this->mRequest->defParam('gperm_' . $groupPermKey, 'POST', 'array-int', array());
         $groups = $this->mRequest->getParam('gperm_' . $groupPermKey);
         $groupPermHandler->setRight($groupPermKey, 1, $groups, $mid);
     }
     foreach ($this->mObjects as $object) {
         $bid = $object->getKey();
         $this->mRequest->defParam('gperm_block_read_' . $bid, 'POST', 'array-int', array());
         $groups = $this->mRequest->getParam('gperm_block_read_' . $bid);
         $groupPermHandler->setRight('block_read', $bid, $groups, 1);
     }
     return NBFRAME_ACTION_SUCCESS;
 }
 function executeDefaultOp()
 {
     error_reporting(E_ERROR);
     if (isset($_GET['NBImgFile'])) {
         $fileBaseName = basename($_GET['NBImgFile']);
     } else {
         if (isset($_GET['file'])) {
             $fileBaseName = basename($_GET['file']);
         } else {
             return;
         }
     }
     $fileName = $this->mEnvironment->findFile($fileBaseName, '/images', false, '=');
     if (!empty($fileName) && preg_match('/\\.(jpeg|jpg|gif|png|swf)$/', strtolower($fileBaseName), $match)) {
         $fileExt = $match[1];
         if ($fileExt == 'jpeg' || $fileExt == 'jpg') {
             $mimeType = 'image/jpeg';
         } else {
             if ($fileExt == 'gif') {
                 $mimeType = 'image/gif';
             } else {
                 if ($fileExt == 'png') {
                     $mimeType = 'image/png';
                 } else {
                     if ($fileExt == 'swf') {
                         $mimeType = 'application/x-shockwave-flash';
                     }
                 }
             }
         }
         NBFrame::using('HTTPOutput');
         NBFrameHTTPOutput::putFile($fileName, $mimeType);
     } else {
         NBFrame::display404Page();
     }
 }
<?php

/**
 *
 * @package MyGmap
 * @version $Id$
 * @copyright Copyright 2006-2008 NobuNobuXOOPS Project <http://sourceforge.net/projects/nobunobuxoops/>
 * @author NobuNobu <*****@*****.**>
 * @license http://www.gnu.org/licenses/gpl.txt GNU GENERAL PUBLIC LICENSE Version 2
 *
 */
if (!class_exists('MyGmapMarkerAction')) {
    NBFrame::using('ObjectAction');
    class MyGmapMarkerAction extends NBFrameObjectAction
    {
        function prepare()
        {
            $this->mHalfAutoForm = true;
            parent::prepare('MyGmapMarker', 'mygmap_markedit', $this->__l('Marker'));
            $this->setObjectForm('MyGmapMarker');
            $this->setFormTemplate($this->prefix('marker.html'));
            $this->setExecutePermission('marker_edit');
        }
        function viewFormOp()
        {
            parent::viewFormOp();
            $this->mXoopsTpl->assign('mygmap_API', $GLOBALS['xoopsModuleConfig']['mygmap_api']);
            $this->mXoopsTpl->assign('mygmap_dirname', $this->mDirName);
            $this->mXoopsTpl->assign('mygmap_center_lat', $this->mObject->getVar('mygmap_marker_lat'));
            $this->mXoopsTpl->assign('mygmap_center_lng', $this->mObject->getVar('mygmap_marker_lng'));
            $this->mXoopsTpl->assign('mygmap_zoom', $this->mObject->getVar('mygmap_marker_zoom'));
<?php

$NBFrame_ini_short_open_tag = ini_set('short_open_tag', 'On');
$environment =& NBFrame::getEnvironment();
?>
<script src="<?php 
echo $environment->getActionUrl('NBFrame.LoadCalendarJS', array('lang' => $GLOBALS['xoopsConfig']['language']));
?>
" type="text/javascript"></script>
<input type="text" name="<?php 
echo $field['name'];
?>
" id="<?php 
echo $field['id'];
?>
" size="<?php 
echo $field['size'];
?>
" maxlength="<?php 
echo $field['maxlength'];
?>
" value="<?php 
echo $field['date'];
?>
" <?php 
echo $field['extra'];
?>
 />
<input type="reset" value=" ... " onclick="return NBFrameCalendarShow('<?php 
echo $field['name'];
?>