mirror of
https://framagit.org/hubzilla/core.git
synced 2026-06-21 17:07:39 -04:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8896ebf7cb | ||
|
|
9bd11afc62 | ||
|
|
b7d92d3a09 | ||
|
|
e6315d252a | ||
|
|
46e079beea | ||
|
|
4048cb67d2 | ||
|
|
e9fe258b5e | ||
|
|
abce12ccd9 | ||
|
|
867d8510ca | ||
|
|
d53fb9d1b5 | ||
|
|
58b5c4cc16 |
@@ -1,3 +1,6 @@
|
||||
Hubzilla 2.4.1 (2017-07-06)
|
||||
- Fix the wiki bug preventing page list display to observers other than the channel owner
|
||||
|
||||
Hubzilla 2.4 (2017-05-31)
|
||||
- Silence php warning during install
|
||||
- Implemented switch statement logic in Comanche layout parser
|
||||
|
||||
@@ -689,7 +689,7 @@ class Photos extends \Zotlabs\Web\Controller {
|
||||
(SELECT resource_id, max(imgscale) imgscale FROM photo left join attach on folder = '%s' and photo.resource_id = attach.hash WHERE attach.uid = %d AND imgscale <= 4 AND photo_usage IN ( %d, %d ) and is_nsfw = %d $sql_extra GROUP BY resource_id) ph
|
||||
ON (p.resource_id = ph.resource_id AND p.imgscale = ph.imgscale)
|
||||
ORDER BY created $order LIMIT %d OFFSET %d",
|
||||
dbesc($datum),
|
||||
dbesc($x['hash']),
|
||||
intval($owner_uid),
|
||||
intval(PHOTO_NORMAL),
|
||||
intval(PHOTO_PROFILE),
|
||||
|
||||
@@ -197,7 +197,23 @@ class Wiki extends \Zotlabs\Web\Controller {
|
||||
// Fetch the wiki info and determine observer permissions
|
||||
|
||||
$wikiUrlName = urldecode(argv(2));
|
||||
$pageUrlName = urldecode(argv(3));
|
||||
|
||||
$page_name = '';
|
||||
$ignore_language = false;
|
||||
|
||||
for($x = 3; $x < argc(); $x ++) {
|
||||
if($page_name === '' && argv($x) === '-') {
|
||||
$ignore_language = true;
|
||||
continue;
|
||||
}
|
||||
if($page_name) {
|
||||
$page_name .= '/';
|
||||
}
|
||||
$page_name .= argv($x);
|
||||
}
|
||||
|
||||
$pageUrlName = urldecode($page_name);
|
||||
$langPageUrlName = urldecode(\App::$language . '/' . $page_name);
|
||||
|
||||
$w = Zlib\NativeWiki::exists_by_name($owner['channel_id'], $wikiUrlName);
|
||||
|
||||
@@ -274,7 +290,8 @@ class Wiki extends \Zotlabs\Web\Controller {
|
||||
'$showPageControls' => $showPageControls,
|
||||
'$editOrSourceLabel' => (($showPageControls) ? t('Edit') : t('Source')),
|
||||
'$tools_label' => 'Page Tools',
|
||||
'$channel' => $owner['channel_address'],
|
||||
'$channel_address' => $owner['channel_address'],
|
||||
'$channel_id' => $owner['channel_id'],
|
||||
'$resource_id' => $resource_id,
|
||||
'$page' => $pageUrlName,
|
||||
'$mimeType' => $mimeType,
|
||||
@@ -473,10 +490,12 @@ class Wiki extends \Zotlabs\Web\Controller {
|
||||
|
||||
$x = new \Zotlabs\Widget\Wiki_pages();
|
||||
|
||||
$page_list_html = $x->widget(array(
|
||||
'resource_id' => $resource_id,
|
||||
'refresh' => true,
|
||||
'channel' => argv(1)));
|
||||
$page_list_html = $x->widget([
|
||||
'resource_id' => $resource_id,
|
||||
'channel_id' => $owner['channel_id'],
|
||||
'channel_address' => $owner['channel_address'],
|
||||
'refresh' => true
|
||||
]);
|
||||
json_return_and_die(array('pages' => $page_list_html, 'message' => '', 'success' => true));
|
||||
}
|
||||
|
||||
|
||||
@@ -7,58 +7,57 @@ class Wiki_pages {
|
||||
|
||||
function widget($arr) {
|
||||
|
||||
$channelname = ((array_key_exists('channel',$arr)) ? $arr['channel'] : '');
|
||||
$c = channelx_by_nick($channelname);
|
||||
if(argc() < 3)
|
||||
return;
|
||||
|
||||
if(! $arr['resource_id']) {
|
||||
|
||||
if(! $c)
|
||||
$c = \App::get_channel();
|
||||
|
||||
if(! $c)
|
||||
return '';
|
||||
if(! $c)
|
||||
$c = channelx_by_nick(argv(1));
|
||||
|
||||
$w = \Zotlabs\Lib\NativeWiki::exists_by_name($c['channel_id'],argv(2));
|
||||
|
||||
$arr = array(
|
||||
'resource_id' => $w['resource_id'],
|
||||
'channel_id' => $c['channel_id'],
|
||||
'channel_address' => $c['channel_address'],
|
||||
'refresh' => false
|
||||
);
|
||||
}
|
||||
|
||||
$wikiname = '';
|
||||
if(array_key_exists('refresh', $arr)) {
|
||||
$not_refresh = (($arr['refresh']=== true) ? false : true);
|
||||
}
|
||||
else {
|
||||
$not_refresh = true;
|
||||
}
|
||||
|
||||
$pages = array();
|
||||
if(! array_key_exists('resource_id', $arr)) {
|
||||
$hide = true;
|
||||
}
|
||||
else {
|
||||
$p = \Zotlabs\Lib\NativeWikiPage::page_list($c['channel_id'],get_observer_hash(),$arr['resource_id']);
|
||||
|
||||
if($p['pages']) {
|
||||
$pages = $p['pages'];
|
||||
$w = $p['wiki'];
|
||||
// Wiki item record is $w['wiki']
|
||||
$wikiname = $w['urlName'];
|
||||
if (!$wikiname) {
|
||||
$wikiname = '';
|
||||
}
|
||||
$p = \Zotlabs\Lib\NativeWikiPage::page_list($arr['channel_id'],get_observer_hash(),$arr['resource_id']);
|
||||
|
||||
if($p['pages']) {
|
||||
$pages = $p['pages'];
|
||||
$w = $p['wiki'];
|
||||
// Wiki item record is $w['wiki']
|
||||
$wikiname = $w['urlName'];
|
||||
if (!$wikiname) {
|
||||
$wikiname = '';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$can_create = perm_is_allowed(\App::$profile['uid'],get_observer_hash(),'write_wiki');
|
||||
|
||||
$can_delete = ((local_channel() && (local_channel() == \App::$profile['uid'])) ? true : false);
|
||||
|
||||
return replace_macros(get_markup_template('wiki_page_list.tpl'), array(
|
||||
'$hide' => $hide,
|
||||
'$resource_id' => $arr['resource_id'],
|
||||
'$not_refresh' => $not_refresh,
|
||||
'$header' => t('Wiki Pages'),
|
||||
'$channel' => $channelname,
|
||||
'$channel_address' => $arr['channel_address'],
|
||||
'$wikiname' => $wikiname,
|
||||
'$pages' => $pages,
|
||||
'$canadd' => $can_create,
|
||||
'$candel' => $can_delete,
|
||||
'$addnew' => t('Add new page'),
|
||||
'$pageName' => array('pageName', t('Page name')),
|
||||
'$refresh' => $arr['refresh']
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
2
boot.php
2
boot.php
@@ -50,7 +50,7 @@ require_once('include/attach.php');
|
||||
|
||||
|
||||
define ( 'PLATFORM_NAME', 'hubzilla' );
|
||||
define ( 'STD_VERSION', '2.4' );
|
||||
define ( 'STD_VERSION', '2.4.2' );
|
||||
define ( 'ZOT_REVISION', '1.2' );
|
||||
|
||||
define ( 'DB_UPDATE_VERSION', 1191 );
|
||||
|
||||
@@ -215,18 +215,6 @@ EOT;
|
||||
$nav['admin'] = array('admin/', t('Admin'), "", t('Site Setup and Configuration'),'admin_nav_btn');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Provide a banner/logo/whatever
|
||||
*
|
||||
*/
|
||||
|
||||
$banner = get_config('system','banner');
|
||||
|
||||
if($banner === false)
|
||||
$banner = get_config('system','sitename');
|
||||
|
||||
$x = array('nav' => $nav, 'usermenu' => $userinfo );
|
||||
|
||||
call_hooks('nav', $x);
|
||||
|
||||
@@ -300,7 +300,7 @@ function photo_upload($channel, $observer, $args) {
|
||||
|
||||
$photo_link = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo_hash . ']' . t('a new photo') . '[/zrl]';
|
||||
|
||||
$album_link = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/album/' . bin2hex($album) . ']' . ((strlen($album)) ? $album : '/') . '[/zrl]';
|
||||
$album_link = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/album/' . $args['directory']['hash'] . ']' . ((strlen($album)) ? $album : '/') . '[/zrl]';
|
||||
|
||||
$activity_format = sprintf(t('%1$s posted %2$s to %3$s','photo_upload'), $author_link, $photo_link, $album_link);
|
||||
|
||||
@@ -592,6 +592,15 @@ function photos_album_exists($channel_id, $observer_hash, $album) {
|
||||
intval($channel_id)
|
||||
);
|
||||
|
||||
// partial backward compatibility with Hubzilla < 2.4 when we used the filename only
|
||||
// (ambiguous which would get chosen if you had two albums of the same name in different directories)
|
||||
if(!$r) {
|
||||
$r = q("SELECT folder, hash, is_dir, filename, os_path, display_path FROM attach WHERE filename = '%s' AND is_dir = 1 AND uid = %d $sql_extra limit 1",
|
||||
dbesc(hex2bin($album)),
|
||||
intval($channel_id)
|
||||
);
|
||||
}
|
||||
|
||||
return (($r) ? $r[0] : false);
|
||||
}
|
||||
|
||||
|
||||
@@ -36,9 +36,9 @@ CREATE TABLE IF NOT EXISTS `abook` (
|
||||
`abook_feed` tinyint(4) NOT NULL DEFAULT 0 ,
|
||||
`abook_not_here` tinyint(4) NOT NULL DEFAULT 0 ,
|
||||
`abook_profile` char(64) NOT NULL DEFAULT '',
|
||||
`abook_incl` TEXT NOT NULL DEFAULT '',
|
||||
`abook_excl` TEXT NOT NULL DEFAULT '',
|
||||
`abook_instance` TEXT NOT NULL DEFAULT '',
|
||||
`abook_incl` text NOT NULL,
|
||||
`abook_excl` text NOT NULL,
|
||||
`abook_instance` text NOT NULL,
|
||||
PRIMARY KEY (`abook_id`),
|
||||
KEY `abook_account` (`abook_account`),
|
||||
KEY `abook_channel` (`abook_channel`),
|
||||
@@ -116,7 +116,7 @@ CREATE TABLE IF NOT EXISTS `app` (
|
||||
`app_sig` char(255) NOT NULL DEFAULT '',
|
||||
`app_author` char(255) NOT NULL DEFAULT '',
|
||||
`app_name` char(255) NOT NULL DEFAULT '',
|
||||
`app_desc` text NOT NULL DEFAULT '',
|
||||
`app_desc` text NOT NULL,
|
||||
`app_url` char(255) NOT NULL DEFAULT '',
|
||||
`app_photo` char(255) NOT NULL DEFAULT '',
|
||||
`app_version` char(255) NOT NULL DEFAULT '',
|
||||
@@ -1067,7 +1067,7 @@ CREATE TABLE IF NOT EXISTS `profile` (
|
||||
`photo` char(255) NOT NULL DEFAULT '',
|
||||
`thumb` char(255) NOT NULL DEFAULT '',
|
||||
`publish` tinyint(1) NOT NULL DEFAULT 0 ,
|
||||
`profile_vcard` text NOT NULL DEFAULT '',
|
||||
`profile_vcard` text NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `guid` (`profile_guid`,`uid`),
|
||||
KEY `uid` (`uid`),
|
||||
@@ -1163,7 +1163,7 @@ CREATE TABLE IF NOT EXISTS `site` (
|
||||
`site_type` smallint NOT NULL DEFAULT 0 ,
|
||||
`site_project` char(255) NOT NULL DEFAULT '',
|
||||
`site_version` varchar(32) NOT NULL DEFAULT '',
|
||||
`site_crypto` text NOT NULL DEFAULT '',
|
||||
`site_crypto` text NOT NULL,
|
||||
PRIMARY KEY (`site_url`),
|
||||
KEY `site_flags` (`site_flags`),
|
||||
KEY `site_update` (`site_update`),
|
||||
|
||||
@@ -5,10 +5,20 @@ namespace Zotlabs\Theme;
|
||||
class RedbasicConfig {
|
||||
|
||||
function get_schemas() {
|
||||
$scheme_choices = array();
|
||||
$scheme_choices["---"] = t("Focus (Hubzilla default)");
|
||||
$files = glob('view/theme/redbasic/schema/*.php');
|
||||
|
||||
$scheme_choices = [];
|
||||
|
||||
if($files) {
|
||||
|
||||
if(in_array('view/theme/redbasic/schema/default.php', $files)) {
|
||||
$scheme_choices['---'] = t('Default');
|
||||
$scheme_choices['focus'] = t('Focus (Hubzilla default)');
|
||||
}
|
||||
else {
|
||||
$scheme_choices['---'] = t('Focus (Hubzilla default)');
|
||||
}
|
||||
|
||||
foreach($files as $file) {
|
||||
$f = basename($file, ".php");
|
||||
if($f != 'default') {
|
||||
@@ -17,6 +27,7 @@ class RedbasicConfig {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $scheme_choices;
|
||||
}
|
||||
|
||||
|
||||
@@ -56,10 +56,9 @@ if (($schema) && ($schema != '---')) {
|
||||
|
||||
}
|
||||
|
||||
// If we haven't got a schema, load the default. We shouldn't touch this - we
|
||||
// should leave it for admins to define for themselves.
|
||||
// default.php and default.css MUST be symlinks to existing schema files.
|
||||
if (! $schema) {
|
||||
// Allow admins to set a default schema for the hub.
|
||||
// default.php and default.css MUST be symlinks to existing schema files in view/theme/redbasic/schema
|
||||
if ((!$schema) || ($schema == '---')) {
|
||||
|
||||
if(file_exists('view/theme/redbasic/schema/default.php')) {
|
||||
$schemefile = 'view/theme/redbasic/schema/default.php';
|
||||
|
||||
@@ -270,26 +270,20 @@ nav .dropdown-menu {
|
||||
background: #999;
|
||||
}
|
||||
|
||||
.nav-tabs{
|
||||
.nav-tabs {
|
||||
border-bottom:1px solid #333;
|
||||
}
|
||||
|
||||
.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{
|
||||
border:1px solid #333;
|
||||
}
|
||||
|
||||
.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus {
|
||||
.nav-tabs .nav-link.active {
|
||||
color: #fff;
|
||||
background-color: #111;
|
||||
background-color: #111;
|
||||
border-color: #333;
|
||||
}
|
||||
|
||||
.nav-tabs.nav-justified > li > a {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.nav-tabs > li > a:hover, .nav-tabs > li > a:focus {
|
||||
text-decoration: underline;
|
||||
background-color: #222;
|
||||
.nav-tabs .nav-link:hover,
|
||||
.nav-tabs .nav-link:focus {
|
||||
text-decoration: underline;
|
||||
background-color: #222;
|
||||
color: #ccc;
|
||||
border-color: #333;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<div class="wall-item-outside-wrapper{{if $indent}} {{$indent}}{{/if}}" id="wall-item-outside-wrapper-{{$id}}" >
|
||||
<div class="wall-item-content-wrapper{{if $indent}} {{$indent}}{{/if}}" id="wall-item-content-wrapper-{{$id}}" style="clear:both;">
|
||||
<div class="wall-item-head">
|
||||
<div class="clearfix wall-item-content-wrapper{{if $indent}} {{$indent}}{{/if}}" id="wall-item-content-wrapper-{{$id}}">
|
||||
<div class="p-2 clearfix wall-item-head">
|
||||
<div class="wall-item-info" id="wall-item-info-{{$id}}" >
|
||||
<div class="wall-item-photo-wrapper" id="wall-item-photo-wrapper-{{$id}}" >
|
||||
<a href="{{$profile_url}}" title="View {{$name}}'s profile" class="wall-item-photo-link" id="wall-item-photo-link-{{$id}}">
|
||||
<img src="{{$thumb}}" class="wall-item-photo" id="wall-item-photo-{{$id}}" style="height: 80px; width: 80px;" alt="{{$name}}" /></a>
|
||||
<img src="{{$thumb}}" class="wall-item-photo" id="wall-item-photo-{{$id}}" alt="{{$name}}" /></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wall-item-wrapper" id="wall-item-wrapper-{{$id}}" >
|
||||
@@ -14,20 +14,18 @@
|
||||
<div class="wall-item-ago" id="wall-item-ago-{{$id}}">{{$ago}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wall-item-content" id="wall-item-content-{{$id}}" >
|
||||
<div class="p-2 clearfix wall-item-content" id="wall-item-content-{{$id}}" >
|
||||
<div class="wall-item-title" id="wall-item-title-{{$id}}">{{$title}}</div>
|
||||
<div class="wall-item-body" id="wall-item-body-{{$id}}" >{{$body}}</div>
|
||||
|
||||
</div>
|
||||
{{if $drop}}
|
||||
<div class="wall-item-tools" id="wall-item-tools-{{$id}}" >
|
||||
<div class="p-2 clearfix wall-item-tools" id="wall-item-tools-{{$id}}" >
|
||||
<div class="wall-item-tools-right pull-right">
|
||||
{{$drop}}
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="clear"></div>
|
||||
{{$comment}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
});
|
||||
|
||||
$( "#rename-page-form" ).submit(function( event ) {
|
||||
$.post("wiki/{{$channel}}/rename/page",
|
||||
$.post("wiki/{{$channel_address}}/rename/page",
|
||||
{
|
||||
oldName: window.wiki_page_name,
|
||||
newName: $('#id_pageRename').val(),
|
||||
@@ -177,7 +177,7 @@
|
||||
});
|
||||
|
||||
$('#wiki-get-preview').click(function (ev) {
|
||||
$.post("wiki/{{$channel}}/preview", {
|
||||
$.post("wiki/{{$channel_address}}/preview", {
|
||||
{{if !$mimeType || $mimeType == 'text/markdown'}}
|
||||
content: editor.getValue(),
|
||||
{{else}}
|
||||
@@ -200,7 +200,7 @@
|
||||
});
|
||||
|
||||
$('#wiki-get-history').click(function (ev) {
|
||||
$.post("wiki/{{$channel}}/history/page", {name: window.wiki_page_name, resource_id: window.wiki_resource_id}, function (data) {
|
||||
$.post("wiki/{{$channel_address}}/history/page", {name: window.wiki_page_name, resource_id: window.wiki_resource_id}, function (data) {
|
||||
if (data.success) {
|
||||
$('#page-history-list').html(data.historyHTML);
|
||||
$('#page-tools').hide();
|
||||
@@ -215,10 +215,9 @@
|
||||
if (window.wiki_resource_id === '') {
|
||||
return false;
|
||||
}
|
||||
$.post("wiki/{{$channel}}/get/page/list/", {resource_id: window.wiki_resource_id}, function (data) {
|
||||
$.post("wiki/{{$channel_address}}/get/page/list/", {channel_id: '{{$channel_id}}', resource_id: window.wiki_resource_id}, function (data) {
|
||||
if (data.success) {
|
||||
$('#wiki_page_list_container').html(data.pages);
|
||||
$('#wiki_page_list_container').show();
|
||||
$('#wiki_page_list').html(data.pages);
|
||||
} else {
|
||||
alert('Error fetching page list!');
|
||||
window.console.log('Error fetching page list!');
|
||||
@@ -245,7 +244,7 @@
|
||||
ev.preventDefault();
|
||||
return false;
|
||||
}
|
||||
$.post("wiki/{{$channel}}/save/page", {
|
||||
$.post("wiki/{{$channel_address}}/save/page", {
|
||||
content: currentContent,
|
||||
commitMsg: $('#id_commitMsg').val(),
|
||||
name: window.wiki_page_name,
|
||||
@@ -276,7 +275,7 @@
|
||||
window.console.log('You must have a wiki page open in order to revert pages.');
|
||||
return false;
|
||||
}
|
||||
$.post("wiki/{{$channel}}/revert/page", {commitHash: commitHash, name: window.wiki_page_name, resource_id: window.wiki_resource_id},
|
||||
$.post("wiki/{{$channel_address}}/revert/page", {commitHash: commitHash, name: window.wiki_page_name, resource_id: window.wiki_resource_id},
|
||||
function (data) {
|
||||
if (data.success) {
|
||||
$('button[id^=revert-]').removeClass('btn-success');
|
||||
@@ -299,7 +298,7 @@
|
||||
window.console.log('You must have a wiki page open in order to revert pages.');
|
||||
return false;
|
||||
}
|
||||
$.post("wiki/{{$channel}}/compare/page", {
|
||||
$.post("wiki/{{$channel_address}}/compare/page", {
|
||||
compareCommit: compareCommit,
|
||||
currentCommit: window.wiki_page_commit,
|
||||
name: window.wiki_page_name,
|
||||
@@ -442,8 +441,6 @@
|
||||
};
|
||||
|
||||
$(document).ready(function () {
|
||||
wiki_refresh_page_list();
|
||||
|
||||
{{if !$mimeType || $mimeType == 'text/markdown'}}
|
||||
$("#wiki-toc").toc({content: "#wiki-preview", headings: "h1,h2,h3,h4"});
|
||||
window.editor.on("input", function() {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{{if $not_refresh}}<div id="wiki_page_list_container" {{if $hide}} style="display: none;" {{/if}}>{{/if}}
|
||||
{{if ! $refresh}}
|
||||
<div id="wiki_page_list" class="widget" >
|
||||
{{/if}}
|
||||
<h3>{{$header}}</h3>
|
||||
<ul class="nav nav-pills flex-column">
|
||||
{{if $pages}}
|
||||
@@ -8,7 +9,7 @@
|
||||
{{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>
|
||||
{{/if}}
|
||||
<a class="nav-link" href="/wiki/{{$channel}}/{{$wikiname}}/{{$page.url}}">{{$page.title}}</a>
|
||||
<a class="nav-link" href="/wiki/{{$channel_address}}/{{$wikiname}}/{{$page.url}}">{{$page.title}}</a>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
@@ -18,19 +19,21 @@
|
||||
</ul>
|
||||
{{if $canadd}}
|
||||
<div id="new-page-form-wrapper" class="sub-menu" style="display:none;">
|
||||
<form id="new-page-form" action="wiki/{{$channel}}/create/page" method="post" >
|
||||
<form id="new-page-form" action="wiki/{{$channel_address}}/create/page" method="post" >
|
||||
<input type="hidden" name="resource_id" value="{{$resource_id}}">
|
||||
{{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 $not_refresh}}</div>{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{if $canadd}}
|
||||
<script>
|
||||
$('#new-page-submit').click(function (ev) {
|
||||
$.post("wiki/{{$channel}}/create/page", {pageName: $('#id_pageName').val(), resource_id: window.wiki_resource_id},
|
||||
$.post("wiki/{{$channel_address}}/create/page", {pageName: $('#id_pageName').val(), resource_id: window.wiki_resource_id},
|
||||
function(data) {
|
||||
if(data.success) {
|
||||
window.location = data.url;
|
||||
@@ -45,7 +48,7 @@
|
||||
if(!confirm('Are you sure you want to delete the page: ' + wiki_page_name)) {
|
||||
return;
|
||||
}
|
||||
$.post("wiki/{{$channel}}/delete/page", {name: wiki_page_url, resource_id: wiki_resource_id},
|
||||
$.post("wiki/{{$channel_address}}/delete/page", {name: wiki_page_url, resource_id: wiki_resource_id},
|
||||
function (data) {
|
||||
if (data.success) {
|
||||
window.console.log('Page deleted successfully.');
|
||||
@@ -74,3 +77,4 @@
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
{{/if}}
|
||||
|
||||
Reference in New Issue
Block a user