Skip to content

Commit

Permalink
Merge branch 'dev' into f/releaseNotes
Browse files Browse the repository at this point in the history
  • Loading branch information
lastlink authored Aug 19, 2024
2 parents 100daad + 453bef3 commit c9ab34d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 22 deletions.
10 changes: 4 additions & 6 deletions Helper/WikiHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@ public function getWikipages($project_id)
/**
* Add a Javascript asset
*
* @param string $filename Filename
* @param string $filepath Filepath
* @param bool $async
* @return string
*/
public function js($filename, $async = false)
public function js($filepath, $async = false)
{
$dir = dirname(__DIR__,2);
$filepath = $dir.'/'.$filename;
return '<script '.($async ? 'async' : '').' defer type="text/javascript" src="'.$this->helper->url->dir()."plugins".$filename.'?'.filemtime($filepath).'"></script>';
return '<script '.($async ? 'async' : '').' defer type="text/javascript" src="'.$this->helper->url->dir().$filepath.'?'.filemtime($filepath).'"></script>';
}
/**
* render wiki page html children recursively
Expand Down Expand Up @@ -76,4 +74,4 @@ public function renderChildren($children, $parent_id, $project, $not_editable){
// {
// return 'foobar';
// }
}
}
7 changes: 3 additions & 4 deletions Model/WikiFileModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Kanboard\Plugin\Wiki\Model;

use Kanboard\Model\FileModel;
use Kanboard\Plugin\Wiki\Model\Wiki;

/**
* Wiki File Model
Expand All @@ -26,7 +25,7 @@ class WikiFileModel extends FileModel
* @var string
*/
const EVENT_CREATE = 'wiki.file.create';


/**
* Get the table
Expand All @@ -39,7 +38,7 @@ protected function getTable()
{
return self::TABLE;
}


/**
* Define the foreign key
Expand Down Expand Up @@ -105,7 +104,7 @@ protected function fireCreationEvent($file_id)
{
return null;
}

protected function fireDestructionEvent($file_id)
{
return null;
Expand Down
9 changes: 4 additions & 5 deletions Model/WikiModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Kanboard\Core\Base;
use Kanboard\Core\Controller\PageNotFoundException;
use Kanboard\Core\Controller\AccessForbiddenException;
// use Kanboard\Model\WikiModel;
use Kanboard\Model\UserModel;
use SimpleValidator\Validator;
use SimpleValidator\Validators;
Expand Down Expand Up @@ -53,7 +52,7 @@ public function getEditions($wiki_id)
const EVENT_UPDATE = 'wikipage.update';
const EVENT_CREATE = 'wikipage.create';
const EVENT_DELETE = 'wikipage.delete';


/**
* retrieve wikipages by parent id
Expand Down Expand Up @@ -178,7 +177,7 @@ public function reorderPagesByIndex($project_id, $src_wiki_id, $index, $parent_i

// echo json_encode($wikiPages), true;

// echo "project_id: " . $project_id . " src_wiki_id: " . $src_wiki_id . " index: " .
// echo "project_id: " . $project_id . " src_wiki_id: " . $src_wiki_id . " index: " .
$index . " parent_id: " . $parent_id ." count list: " . count($wikiPages) . "<br>";
// change order of each in for loop, move matching id to one before target
$orderColumn = 0;
Expand Down Expand Up @@ -260,7 +259,7 @@ public function reorderPages($project_id, $src_wiki_id, $target_wiki_id){
if(!$result){
return false;
}
}
}
}
$orderColumn++;
}
Expand Down Expand Up @@ -436,7 +435,7 @@ public function updatepage($paramvalues, $editions, $date = '')
if ($this->userSession->isLogged()) {
$values['modifier_id'] = $this->userSession->getId();
}

$wikiEventJob = new WikiEventJob($this->container);
$wikiEventJob->executeWithId($paramvalues['id'], self::EVENT_UPDATE);
// $wikiEventJob = new WikiEventJob($this->container);
Expand Down
4 changes: 2 additions & 2 deletions Template/wiki/detail.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php (isset($not_editable)) ?: $not_editable = false;
?>
<?php if (!$not_editable): ?>
<?=$this->wikiHelper->js("/Wiki/Asset/vendor/jquery-sortable/jquery-sortable.js")?>
<?=$this->wikiHelper->js("/Wiki/Asset/Javascript/wiki.js")?>
<?=$this->wikiHelper->js("plugins/Wiki/Asset/vendor/jquery-sortable/jquery-sortable.js")?>
<?=$this->wikiHelper->js("plugins/Wiki/Asset/Javascript/wiki.js")?>
<?= $this->projectHeader->render($project, 'TaskListController', 'show') ?>
<?php endif ?>
<div class="page-header">
Expand Down
10 changes: 5 additions & 5 deletions Template/wiki_list/sort_menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
<a href="#" class="dropdown-menu dropdown-menu-link-icon"><strong><?= t('Sort') ?> <i class="fa fa-caret-down"></i></strong></a>
<ul>
<li>
<?= $paginator->order(t('Project ID'), \Kanboard\Plugin\Wiki\Model\Wiki::WIKITABLE.'.id') ?>
<?= $paginator->order(t('Project ID'), \Kanboard\Plugin\Wiki\Model\WikiModel::WIKITABLE.'.id') ?>
</li>
<li>
<?= $paginator->order(t('Wiki page Title'), \Kanboard\Plugin\Wiki\Model\Wiki::WIKITABLE.'.title') ?>
<?= $paginator->order(t('Wiki page Title'), \Kanboard\Plugin\Wiki\Model\WikiModel::WIKITABLE.'.title') ?>
</li>
<li>
<?= $paginator->order(t('Date Created'), \Kanboard\Plugin\Wiki\Model\Wiki::WIKITABLE.'.date_creation') ?>
<?= $paginator->order(t('Date Created'), \Kanboard\Plugin\Wiki\Model\WikiModel::WIKITABLE.'.date_creation') ?>
</li>
<li>
<?= $paginator->order(t('Date Modified'), \Kanboard\Plugin\Wiki\Model\Wiki::WIKITABLE.'.date_modification') ?>
</li>
<?= $paginator->order(t('Date Modified'), \Kanboard\Plugin\Wiki\Model\WikiModel::WIKITABLE.'.date_modification') ?>
</li>
</ul>
</div>

0 comments on commit c9ab34d

Please sign in to comment.