本文整理汇总了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);
}