本文整理匯總了PHP中DiscussionModel::DiscussionTypes方法的典型用法代碼示例。如果您正苦於以下問題:PHP DiscussionModel::DiscussionTypes方法的具體用法?PHP DiscussionModel::DiscussionTypes怎麽用?PHP DiscussionModel::DiscussionTypes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DiscussionModel
的用法示例。
在下文中一共展示了DiscussionModel::DiscussionTypes方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: AllowedDiscussionTypes
public static function AllowedDiscussionTypes($Category)
{
$Category = self::PermissionCategory($Category);
$Allowed = GetValue('AllowedDiscussionTypes', $Category);
$AllTypes = DiscussionModel::DiscussionTypes();
if (empty($Allowed) || !is_array($Allowed)) {
return $AllTypes;
} else {
return array_intersect_key($AllTypes, array_flip($Allowed));
}
}
示例2: SetupDiscussionTypes
protected function SetupDiscussionTypes($Category)
{
$DiscussionTypes = DiscussionModel::DiscussionTypes();
$this->SetData('DiscussionTypes', $DiscussionTypes);
if (!$this->Form->IsPostBack()) {
$PCatID = GetValue('PermissionCategoryID', $Category, -1);
if ($PCatID == GetValue('CategoryID', $Category)) {
$PCat = $Category;
} else {
$PCat = CategoryModel::Categories($PCatID);
}
$AllowedTypes = GetValue('AllowedDiscussionTypes', $PCat);
if (empty($AllowedTypes)) {
$AllowedTypes = array_keys($DiscussionTypes);
}
$this->Form->SetValue("AllowedDiscussionTypes", $AllowedTypes);
}
}