Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save smeghead/879109 to your computer and use it in GitHub Desktop.
Save smeghead/879109 to your computer and use it in GitHub Desktop.
pukiwikiの新規ページ作成でデフォルト値を設定するpatch。pluginディレクトリで適応すればいい。
--- newpage.inc.php.org 2011-03-21 15:07:44.000000000 +0900
+++ newpage.inc.php 2011-03-21 15:06:35.000000000 +0900
@@ -13,6 +13,10 @@
$newpage = '';
if (func_num_args()) list($newpage) = func_get_args();
if (! preg_match('/^' . $BracketName . '$/', $newpage)) $newpage = '';
+ #set new page default.
+ if (!$newpage) {
+ $newpage = $_GET['refer'] . '/';
+ }
$s_page = htmlspecialchars(isset($vars['refer']) ? $vars['refer'] : $vars['page']);
$s_newpage = htmlspecialchars($newpage);
@@ -28,6 +32,7 @@
<input type="submit" value="$_btn_edit" />
</div>
</form>
+<script>document.getElementById('_p_newpage_$id').focus();</script>
EOD;
return $ret;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment