📄 maps.php
字号:
<?phpdefined('WikyBlog') or die("Not an entry point...");if( $_SESSION['userlevel'] !== 4){ global $page; $page->contentA['Admin Only'] = 'You must be an administrator to access this page.'; return;}class enableMaps{ function enableMaps(){ global $page,$dbObject,$pageOwner,$serverName3,$googleMapsKey,$lang; $dbObject->links['Enable Maps'] = $page->formAction = '/Admin/'.$pageOwner['username'].'/EnableMaps'; $page->displayTitle = 'Enable Maps'; if( isset($_POST['key'])){ $googleMapsKey = $_POST['key']; } switch($page->userCmd){ case 'save': $this->save(); break; } ob_start(); echo 'To enable the maps data type for your installation, you must first <a target="_new" href="http://www.google.com/apis/maps/signup.html">sign up</a> for an API Key directly from Google.'; echo '<fieldset style="margin:2em;">'; echo '<table cellpadding="5px">'; echo '<tr>'; echo '<td>Web Site URL: </td>'; echo '<td><tt>'; echo $serverName3.'/include'; echo '</tt></td>'; echo '<tr>'; echo '<td>Get Your Key: </td>'; echo '<td><tt>'; echo '<a target="_new" href="http://www.google.com/apis/maps/signup.html">Google.com</a>'; echo '</tt></td>'; echo '<tr>'; echo '<td>Enter Your Key: </td>'; echo '<td> <input type="text" size="60" name="key" value="'.htmlspecialchars($googleMapsKey).'" /></td>'; echo '</tr>'; echo '<tr>'; echo '<td></td>'; echo '<td>'; echo '<input type="submit" name="cmd" value="Save" />'; echo '</td>'; echo '</tr>'; echo '<tr>'; echo '<td>Test your key.</td>'; echo '<td>'; if( !empty($googleMapsKey)){ $root = '/Map/'.$pageOwner['username'].'/Test_Map'; echo wbLinks::local($root,'Test Map'); }else{ echo 'Please save your key first.'; } echo '</td>'; echo '</tr>'; echo '</table>'; echo '</fieldset>'; echo 'Once you have enabled maps, you can modify your "Create New .." menus via '.wbLinks::admin('ManageTypes','Data Type Management').'.'; $page->contentA['Enable Maps'] = wb::get_clean(); } function save(){ global $dbObject,$dbInfo,$page; $data = $dbObject->getConfiguration(); $data['googleMapsKey'] = $_POST['key']; if( $dbObject->updateConfig($data) ){ $dbInfo = $data['dbInfo']; $page->session = true; //send a new userMenu message('Your Google Maps API Key was saved.'); message('<strong>Remember:</strong> Test your key to make sure it is correct.'); } } }new enableMaps();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -