本文整理汇总了PHP中Wiki::getAllProjectPages方法的典型用法代码示例。如果您正苦于以下问题:PHP Wiki::getAllProjectPages方法的具体用法?PHP Wiki::getAllProjectPages怎么用?PHP Wiki::getAllProjectPages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Wiki
的用法示例。
在下文中一共展示了Wiki::getAllProjectPages方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wiki_select_page
/**
* Renders select page box
*
* @param string $name Name to use in HTML for the select
* @param Project $project
* @param integer $selected Id of selected element
* @param array $attributes Array of additional attributes
* @return string
*/
function wiki_select_page($name, $project, $selected = null, $attributes = null)
{
if (is_array($attributes)) {
if (!isset($attributes['class'])) {
$attributes['class'] = 'wiki_select_page';
}
} else {
$attributes = array('class' => 'wiki_select_page');
}
// if
$options = array(option_tag(lang('none'), 0));
if (logged_user()->isAdministrator()) {
$pages = Wiki::getAllProjectPages($project);
} else {
$pages = Wiki::getAllProjectPages($project);
}
if (is_array($pages)) {
foreach ($pages as $page) {
$option_attributes = $page->getId() == $selected ? array('selected' => 'selected') : null;
$options[] = option_tag($page->getObjectName(), $page->getId(), $option_attributes);
}
// foreach
}
// if
return select_box($name, $options, $attributes);
}
示例2: all_pages
/**
* View all wiki pages
*
* @return void
*/
function all_pages()
{
// There isn't a wiki page for all pages
// So prepare a dummy page
$page = new WikiPage();
// Make a revision for the page
$revision = $page->makeRevision();
$revision->setName(lang('wiki all pages'));
$all_pages = Wiki::getAllProjectPages(active_project());
tpl_assign('all_pages', $all_pages);
tpl_assign('page', $page);
tpl_assign('revision', $revision);
$this->_load_sidebar();
}
示例3: copy
//.........这里部分代码省略.........
$file->setProjectId($project_id);
$file->setFolderId($folder_map[$source_file->getFolderId()]);
$file->setFileName($source_file->getFileName());
$file->setDescription($source_file->getDescription());
$file->setIsPrivate($source_file->getIsPrivate());
$file->setIsImportant($source_file->getIsImportant());
$file->setIsLocked($source_file->getIsLocked());
$file->setIsVisible($source_file->getIsVisible());
$file->setExpirationTime($source_file->getExpirationTime());
$file->setCommentsEnabled($source_file->getCommentsEnabled());
$file->setAnonymousCommentsEnabled($source_file->getAnonymousCommentsEnabled());
$file->save();
$source_revision = $source_file->getLastRevision();
if ($source_revision instanceof ProjectFileRevision) {
$revision = new ProjectFileRevision();
$revision->setFileId($file->getId());
$revision->setRevisionNumber($source_revision->getRevisionNumber());
$revision->setRepositoryId($source_revision->getRepositoryId());
$revision->setFilesize($source_revision->getFilesize());
$revision->setFilename($source_revision->getFileName());
$revision->setTypeString($source_revision->getTypeString());
$revision->setThumbFilename($source_revision->getThumbFilename());
$revision->setFileTypeId($source_revision->getFileTypeId());
$revision->setComment($source_revision->getComment());
$revision->save();
}
}
// foreach
}
// if
}
// if
if ($copy_pages) {
$source_pages = Wiki::getAllProjectPages($source);
if (is_array($source_pages)) {
foreach ($source_pages as $source_page) {
$page = new WikiPage();
$page->setProjectId($project_id);
$page->setProjectIndex($source_page->getProjectIndex());
$page->setProjectSidebar($source_page->getProjectSidebar());
if (plugin_active('tags')) {
//$page->setTags($source_page->getTagNames());
}
//Make a new revision of this page
$revision = $page->makeRevision();
$source_revision = $source_page->getLatestRevision();
//Set attributes
$revision->setName($source_revision->getName());
$revision->setContent($source_revision->getContent());
$revision->setLogMessage($source_revision->getLogMessage());
//Save the page
$page->save();
}
// foreach
}
// if
}
// if
if ($copy_users) {
$source_companies = ProjectCompanies::instance()->getCompaniesByProject($source);
if (is_array($source_companies)) {
foreach ($source_companies as $source_company) {
$project_company = new ProjectCompany();
$project_company->setCompanyId($source_company->getId());
$project_company->setProjectId($project_id);
$project_company->save();