本文整理汇总了PHP中FeatherBB\Core\Utils::generateBreadcrumbs方法的典型用法代码示例。如果您正苦于以下问题:PHP Utils::generateBreadcrumbs方法的具体用法?PHP Utils::generateBreadcrumbs怎么用?PHP Utils::generateBreadcrumbs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FeatherBB\Core\Utils
的用法示例。
在下文中一共展示了Utils::generateBreadcrumbs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: folders
public function folders()
{
$errors = array();
if ($this->request->post('add_folder')) {
$folder = $this->request->post('req_folder') ? Utils::trim(Utils::escape($this->request->post('req_folder'))) : '';
if ($folder == '') {
$errors[] = __('No folder name', 'private_messages');
} else {
if (Utils::strlen($folder) < 4) {
$errors[] = __('Folder too short', 'private_messages');
} else {
if (Utils::strlen($folder) > 30) {
$errors[] = __('Folder too long', 'private_messages');
} else {
if ($this->feather->forum_settings['o_censoring'] == '1' && Utils::censor($folder) == '') {
$errors[] = __('No folder after censoring', 'private_messages');
}
}
}
}
// TODO: Check perms when ready
// $data = array(
// ':uid' => $panther_user['id'],
// );
//
// if ($panther_user['g_pm_folder_limit'] != 0)
// {
// $ps = $db->select('folders', 'COUNT(id)', $data, 'user_id=:uid');
// $num_folders = $ps->fetchColumn();
//
// if ($num_folders >= $panther_user['g_pm_folder_limit'])
// $errors[] = sprintf($lang_pm['Folder limit'], $panther_user['g_pm_folder_limit']);
// }
if (empty($errors)) {
$insert = array('user_id' => $this->feather->user->id, 'name' => $folder);
$this->model->addFolder($insert);
Url::redirect($this->feather->urlFor('Conversations.folders'), __('Folder added', 'private_messages'));
}
} else {
if ($this->request->post('update_folder')) {
$id = intval(key($this->request->post('update_folder')));
var_dump($id);
$errors = array();
$folder = Utils::trim($this->request->post('folder')[$id]);
if ($folder == '') {
$errors[] = __('No folder name', 'private_messages');
} else {
if (Utils::strlen($folder) < 4) {
$errors[] = __('Folder too short', 'private_messages');
} else {
if (Utils::strlen($folder) > 30) {
$errors[] = __('Folder too long', 'private_messages');
} else {
if ($this->feather->forum_settings['o_censoring'] == '1' && Utils::censor($folder) == '') {
$errors[] = __('No folder after censoring', 'private_messages');
}
}
}
}
if (empty($errors)) {
$update = array('name' => $folder);
if ($this->model->updateFolder($this->feather->user->id, $id, $update)) {
Url::redirect($this->feather->urlFor('Conversations.folders'), __('Folder updated', 'private_messages'));
} else {
throw new Error(__('Error'), 403);
}
}
} else {
if ($this->request->post('remove_folder')) {
$id = intval(key($this->request->post('remove_folder')));
// Before we do anything, check we blocked this user
if (!$this->model->checkFolderOwner($id, intval($this->feather->user->id))) {
throw new Error(__('No permission'), 403);
}
if ($this->model->removeFolder($this->feather->user->id, $id)) {
Url::redirect($this->feather->urlFor('Conversations.folders'), __('Folder removed', 'private_messages'));
} else {
throw new Error(__('Error'), 403);
}
}
}
}
Utils::generateBreadcrumbs(array($this->feather->urlFor('Conversations.home') => __('PMS', 'private_messages'), __('Options'), __('My Folders', 'private_messages')));
$this->generateMenu('folders');
$this->feather->template->setPageInfo(array('title' => array(Utils::escape($this->feather->config['o_board_title']), __('PMS', 'private_messages'), __('Blocked Users', 'private_messages')), 'admin_console' => true, 'errors' => $errors))->addTemplate('folders.php')->display();
}