aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xboot.php2
-rw-r--r--install/schema_mysql.sql1
-rw-r--r--install/schema_postgres.sql1
-rw-r--r--install/update.php18
-rw-r--r--view/tpl/wiki_page_list.tpl36
5 files changed, 37 insertions, 21 deletions
diff --git a/boot.php b/boot.php
index aeb3ec8b6..2b290862b 100755
--- a/boot.php
+++ b/boot.php
@@ -52,7 +52,7 @@ define ( 'PLATFORM_NAME', 'hubzilla' );
define ( 'STD_VERSION', '2.7.3' );
define ( 'ZOT_REVISION', '1.3' );
-define ( 'DB_UPDATE_VERSION', 1195 );
+define ( 'DB_UPDATE_VERSION', 1196 );
define ( 'PROJECT_BASE', __DIR__ );
diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql
index 0988bfa4a..3143854f5 100644
--- a/install/schema_mysql.sql
+++ b/install/schema_mysql.sql
@@ -656,6 +656,7 @@ CREATE TABLE IF NOT EXISTS `item` (
KEY `aid` (`aid`),
KEY `owner_xchan` (`owner_xchan`),
KEY `author_xchan` (`author_xchan`),
+ KEY `resource_id` (`resource_id`),
KEY `resource_type` (`resource_type`),
KEY `item_restrict` (`item_restrict`),
KEY `item_flags` (`item_flags`),
diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql
index 381c262a7..65acb644b 100644
--- a/install/schema_postgres.sql
+++ b/install/schema_postgres.sql
@@ -627,6 +627,7 @@ create index "item_comments_closed" on item ("comments_closed");
create index "item_aid" on item ("aid");
create index "item_owner_xchan" on item ("owner_xchan");
create index "item_author_xchan" on item ("author_xchan");
+create index "item_resource_id" on item ("resource_id");
create index "item_resource_type" on item ("resource_type");
create index "item_restrict" on item ("item_restrict");
create index "item_flags" on item ("item_flags");
diff --git a/install/update.php b/install/update.php
index 8c9f83033..07675a973 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1195 );
+define( 'UPDATE_VERSION' , 1196 );
/**
*
@@ -3007,4 +3007,18 @@ function update_r1194() {
}
return UPDATE_SUCCESS;
-} \ No newline at end of file
+}
+
+function update_r1195() {
+
+ if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
+ $r1 = q("CREATE INDEX item_resource_id ON item (resource_id)");
+ }
+ else {
+ $r1 = q("ALTER TABLE item ADD INDEX (resource_id)");
+ }
+
+ if($r1)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
diff --git a/view/tpl/wiki_page_list.tpl b/view/tpl/wiki_page_list.tpl
index 3d38a0b81..bf5f6697d 100644
--- a/view/tpl/wiki_page_list.tpl
+++ b/view/tpl/wiki_page_list.tpl
@@ -3,34 +3,34 @@
{{/if}}
<h3>{{$header}}</h3>
<ul class="nav nav-pills flex-column">
+ {{if $canadd}}
+ <li class="nav-item"><a class="nav-link" href="#" onclick="wiki_show_new_page_form(); return false;"><i class="fa fa-plus-circle"></i>&nbsp;{{$addnew}}</a></li>
+ {{/if}}
+ {{if $canadd}}
+ <div id="new-page-form-wrapper" class="sub-menu" style="display:none;">
+ <form id="new-page-form" action="wiki/{{$channel_address}}/create/page" method="post" >
+ <input type="hidden" name="resource_id" value="{{$resource_id}}">
+ {{if $typelock}}
+ <input type="hidden" name="mimetype" value="{{$lockedtype}}">
+ {{else}}
+ {{$mimetype}}
+ {{/if}}
+ {{include file="field_input.tpl" field=$pageName}}
+ <button id="new-page-submit" class="btn btn-primary" type="submit" name="submit" >Submit</button>
+ </form>
+ </div>
+ {{/if}}
{{if $pages}}
{{foreach $pages as $page}}
<li class="nav-item nav-item-hack" id="{{$page.link_id}}">
{{if $page.resource_id && $candel}}
- <i class="nav-link widget-nav-pills-icons fa fa-trash-o drop-icons" onclick="wiki_delete_page('{{$page.title}}', '{{$page.url}}', '{{$page.resource_id}}', '{{$page.link_id}}')"></i>
+ <i class="nav-link widget-nav-pills-icons fa fa-trash-o drop-icons" onclick="wiki_delete_page('{{$page.title}}', '{{$page.title}}', '{{$page.resource_id}}', '{{$page.link_id}}')"></i>
{{/if}}
<a class="nav-link" href="/wiki/{{$channel_address}}/{{$wikiname}}/{{$page.url}}">{{$page.title}}</a>
</li>
{{/foreach}}
{{/if}}
- {{if $canadd}}
- <li class="nav-item"><a class="nav-link" href="#" onclick="wiki_show_new_page_form(); return false;"><i class="fa fa-plus-circle"></i>&nbsp;{{$addnew}}</a></li>
- {{/if}}
</ul>
- {{if $canadd}}
- <div id="new-page-form-wrapper" class="sub-menu" style="display:none;">
- <form id="new-page-form" action="wiki/{{$channel_address}}/create/page" method="post" >
- <input type="hidden" name="resource_id" value="{{$resource_id}}">
- {{if $typelock}}
- <input type="hidden" name="mimetype" value="{{$lockedtype}}">
- {{else}}
- {{$mimetype}}
- {{/if}}
- {{include file="field_input.tpl" field=$pageName}}
- <button id="new-page-submit" class="btn btn-primary" type="submit" name="submit" >Submit</button>
- </form>
- </div>
- {{/if}}
{{if ! $refresh}}
</div>
{{/if}}