本文整理匯總了PHP中IPSLib::unpackGroup方法的典型用法代碼示例。如果您正苦於以下問題:PHP IPSLib::unpackGroup方法的具體用法?PHP IPSLib::unpackGroup怎麽用?PHP IPSLib::unpackGroup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類IPSLib
的用法示例。
在下文中一共展示了IPSLib::unpackGroup方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _groupForm
/**
* Show the add/edit group form
*
* @access private
* @param string 'add' or 'edit'
* @return void [Outputs to screen]
*/
private function _groupForm($type = 'edit')
{
//-----------------------------------------
// Grab group data and start us off
//-----------------------------------------
if ($type == 'edit') {
if ($this->request['id'] == "") {
$this->registry->output->showError($this->lang->words['g_whichgroup'], 11210);
}
$group = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'groups', 'where' => "g_id=" . intval($this->request['id'])));
$group = IPSLib::unpackGroup($group);
//-----------------------------------------
// Check restrictions.
//-----------------------------------------
if ($group['g_access_cp']) {
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg('groups_edit_admin');
}
} else {
$group = array();
if ($this->request['id']) {
$group = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'groups', 'where' => "g_id=" . intval($this->request['id'])));
$group = IPSLib::unpackGroup($group);
}
$group['g_title'] = 'New Group';
}
//-----------------------------------------
// Grab permission masks
//-----------------------------------------
$perm_masks = array();
$this->DB->build(array('select' => '*', 'from' => 'forum_perms'));
$this->DB->execute();
while ($r = $this->DB->fetch()) {
$perm_masks[] = array($r['perm_id'], $r['perm_name']);
}
//-----------------------------------------
// Ok? Load interface and child classes
//-----------------------------------------
$blocks = array('tabs' => array(), 'area' => array());
IPSLib::loadInterface('admin/group_form.php');
$tabsUsed = 2;
foreach (ipsRegistry::$applications as $app_dir => $app_data) {
if (!IPSLib::appIsInstalled($app_dir)) {
continue;
}
if (file_exists(IPSLib::getAppDir($app_dir) . '/extensions/admin/group_form.php')) {
require_once IPSLib::getAppDir($app_dir) . '/extensions/admin/group_form.php';
$_class = 'admin_group_form__' . $app_dir;
if (class_exists($_class)) {
$_object = new $_class($this->registry);
$data = $_object->getDisplayContent($group, $tabsUsed);
$blocks['area'][$app_dir] = $data['content'];
$blocks['tabs'][$app_dir] = $data['tabs'];
$tabsUsed = $data['tabsUsed'] ? $tabsUsed + $data['tabsUsed'] : $tabsUsed + 1;
}
}
}
//-----------------------------------------
// And output to form
//-----------------------------------------
$this->registry->output->html .= $this->html->groupsForm($type, $group, $perm_masks, $blocks);
}