本文整理汇总了PHP中XoopsLists::getSubjectsList方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsLists::getSubjectsList方法的具体用法?PHP XoopsLists::getSubjectsList怎么用?PHP XoopsLists::getSubjectsList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XoopsLists
的用法示例。
在下文中一共展示了XoopsLists::getSubjectsList方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: die
// You should have received a copy of the GNU General Public License //
// along with this program; if not, write to the Free Software //
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
// ------------------------------------------------------------------------ //
if (!defined("XOOPS_ROOT_PATH")) {
die("XOOPS root path not defined");
}
include_once XOOPS_ROOT_PATH . "/class/xoopslists.php";
include XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
$cform = new XoopsThemeForm(_CM_POSTCOMMENT, "commentform", "postcomment.php", "post", true);
if (!preg_match("/^re:/i", $subject)) {
$subject = "Re: " . xoops_substr($subject, 0, 56);
}
$cform->addElement(new XoopsFormText(_CM_TITLE, 'subject', 50, 255, $subject), true);
$icons_radio = new XoopsFormRadio(_MESSAGEICON, 'icon', $icon);
$subject_icons = XoopsLists::getSubjectsList();
foreach ($subject_icons as $iconfile) {
$icons_radio->addOption($iconfile, '<img src="' . XOOPS_URL . '/images/subject/' . $iconfile . '" alt="" />');
}
$cform->addElement($icons_radio);
$cform->addElement(new XoopsFormDhtmlTextArea(_CM_MESSAGE, 'message', $message, 10, 50), true);
$option_tray = new XoopsFormElementTray(_OPTIONS, '<br />');
if ($xoopsUser) {
if ($xoopsConfig['anonpost'] == 1) {
$noname_checkbox = new XoopsFormCheckBox('', 'noname', $noname);
$noname_checkbox->addOption(1, _POSTANON);
$option_tray->addElement($noname_checkbox);
}
if ($xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
$nohtml_checkbox = new XoopsFormCheckBox('', 'nohtml', $nohtml);
$nohtml_checkbox->addOption(1, _DISABLEHTML);
示例2: XoopsSubjecticonHandler
function XoopsSubjecticonHandler(&$db)
{
require_once XOOPS_ROOT_PATH . "/class/xoopslists.php";
$this->_mResult =& XoopsLists::getSubjectsList();
}
示例3: b_commentany_hook_execute
/**
@brief $xoopsTpl のコンパイルロジックを交換し、コンテンツの下にコメントフォームを表示できるようにする
*/
function b_commentany_hook_execute($options)
{
global $xoopsUser;
global $xoopsTpl;
global $xoopsModule, $xoopsModuleConfig;
global $xoopsConfig;
include_once XOOPS_ROOT_PATH . "/class/xoopslists.php";
include_once XOOPS_ROOT_PATH . '/include/comment_constants.php';
if (!is_object($xoopsModule)) {
return null;
}
$config = $xoopsModule->getInfo('comments');
if (!count($config)) {
return null;
}
// このまま進んではいけないケースの判断
if (empty($xoopsModuleConfig['com_rule'])) {
return null;
}
switch ($xoopsModuleConfig['com_rule']) {
case XOOPS_COMMENT_APPROVENONE:
return null;
/* case XOOPS_COMMENT_APPROVEUSER:
case XOOPS_COMMENT_APPROVEADMIN: // FIXME: ホント??
if(!is_object($xoopsUser))
return null; */
}
// パスを取り出す
$xoops_root_path = strtr(XOOPS_ROOT_PATH, "\\", "/");
$path = $_SERVER['SCRIPT_FILENAME'];
if ($pos = strrpos($path, "/")) {
$path = substr($path, $pos + 1);
}
if ($path == $config['pageName']) {
// 言語ファイルの読み込み
require_once XOOPS_ROOT_PATH . '/language/' . $xoopsConfig['language'] . '/comment.php';
$arr = array();
require_once dirname(__FILE__) . "/../include/Smarty_CustomCompiler.php";
$xoopsTpl->compiler_class = "CommentAnyTplHookCompiler";
$arr['com_itemid'] = intval($_REQUEST[$config['itemName']]);
// 権限を見よう
switch ($xoopsModuleConfig['com_rule']) {
case XOOPS_COMMENT_APPROVEALL:
$arr['rule_text'] = _CM_COMAPPROVEALL;
break;
case XOOPS_COMMENT_APPROVEUSER:
$arr['rule_text'] = _CM_COMAPPROVEUSER;
break;
case XOOPS_COMMENT_APPROVEADMIN:
default:
$arr['rule_text'] = _CM_COMAPPROVEADMIN;
break;
}
// check com_itemid
if (!is_object($xoopsUser) && empty($xoopsModuleConfig['com_anonpost'])) {
$arr['com_itemid'] = 0;
}
$icons = XoopsLists::getSubjectsList();
foreach ($icons as $k => $v) {
$arr['com_icon'][] = $v;
}
// for XOOPS >= 2.0.10
if (is_object(@$GLOBALS['xoopsSecurity'])) {
$arr['xoops_token_request'] = $GLOBALS['xoopsSecurity']->createToken();
} else {
$arr['xoops_token_request'] = '';
}
$xoopsTpl->assign("commentany", $arr);
}
return null;
}
示例4: xoopsValidate
include_once XOOPS_ROOT_PATH . "/class/xoopslists.php";
include XOOPS_ROOT_PATH . "/include/xoopscodes.php";
echo "<form action='post.php' method='post' name='forumform' id='forumform' onsubmit='return xoopsValidate(\"subject\", \"message\", \"contents_submit\", \"" . htmlspecialchars(_PLZCOMPLETE, ENT_QUOTES) . "\", \"" . htmlspecialchars(_MESSAGETOOLONG, ENT_QUOTES) . "\", \"" . htmlspecialchars(_ALLOWEDCHAR, ENT_QUOTES) . "\", \"" . htmlspecialchars(_CURRCHAR, ENT_QUOTES) . "\");'><table cellspacing='1' class='outer' width='100%'><tr><td class='head' width='25%' valign='top'>" . _MD_ABOUTPOST . ":</td>";
if ($forumdata['forum_type'] == 1) {
echo "<td class='even'>" . _MD_PRIVATE . "</td>";
} elseif ($forumdata['forum_access'] == 1) {
echo "<td class='even'>" . _MD_REGCANPOST . "</td>";
} elseif ($forumdata['forum_access'] == 2) {
echo "<td class='even'>" . _MD_ANONCANPOST . "</td>";
} elseif ($forumdata['forum_access'] == 3) {
echo "<td class='even'>" . _MD_MODSCANPOST . "</td>";
}
echo "</tr>\r\n<tr>\r\n<td class='head' valign='top' nowrap='nowrap'>" . _MD_SUBJECTC . "</td>\r\n<td class='odd'>";
echo "<input type='text' id='subject' name='subject' size='60' maxlength='100' value='{$subject}' /></td></tr>\r\n<tr>\r\n<td class='head' valign='top' nowrap='nowrap'>" . _MD_MESSAGEICON . "</td>\r\n<td class='even'>\r\n";
$lists = new XoopsLists();
$filelist = $lists->getSubjectsList();
$count = 1;
while (list($key, $file) = each($filelist)) {
$checked = "";
if (isset($icon) && $file == $icon) {
$checked = " checked='checked'";
}
echo "<input type='radio' value='{$file}' name='icon'{$checked} /> ";
echo "<img src='" . XOOPS_URL . "/images/subject/{$file}' alt='' /> ";
if ($count == 8) {
echo "<br />";
$count = 0;
}
$count++;
}
echo "</td></tr>\r\n<tr align='left'>\r\n<td class='head' valign='top' nowrap='nowrap'>" . _MD_MESSAGEC . "\r\n</td>\r\n<td class='odd'>";
示例5: __construct
/**
* @param CommentsComment $obj
*/
public function __construct(CommentsComment $obj)
{
$xoops = Xoops::getInstance();
$helper = Comments::getInstance();
$module = $xoops->getModuleById($obj->getVar('modid'));
if (!is_object($module)) {
$xoops->redirect(\XoopsBaseConfig::get('url'), 1, XoopsLocale::E_NO_ACCESS_PERMISSION);
}
$dirname = $module->getVar('dirname');
// create form
if ($xoops->isAdminSide) {
$url = $helper->url("admin/comment_post.php");
} else {
$url = $helper->url("comment_post.php");
}
parent::__construct(_MD_COMMENTS_POSTCOMMENT, "commentform", $url, "post", true);
switch ($xoops->getModuleConfig('com_rule', $dirname)) {
case COMMENTS_APPROVEALL:
$rule_text = _MD_COMMENTS_COMAPPROVEALL;
break;
case COMMENTS_APPROVEUSER:
$rule_text = _MD_COMMENTS_COMAPPROVEUSER;
break;
case COMMENTS_APPROVEADMIN:
default:
$rule_text = _MD_COMMENTS_COMAPPROVEADMIN;
break;
}
$this->addElement(new Xoops\Form\Label(_MD_COMMENTS_COMRULES, $rule_text));
$this->addElement(new Xoops\Form\Text(_MD_COMMENTS_TITLE, 'com_title', 50, 255, $obj->getVar('title', 'e')), true);
$icons_radio = new Xoops\Form\Radio(XoopsLocale::MESSAGE_ICON, 'com_icon', $obj->getVar('icon', 'e'));
$subject_icons = XoopsLists::getSubjectsList();
foreach ($subject_icons as $iconfile) {
$icons_radio->addOption($iconfile, '<img src="' . \XoopsBaseConfig::get('url') . '/images/subject/' . $iconfile . '" alt="" />');
}
$this->addElement($icons_radio);
// editor
$editor = $helper->getConfig('com_editor');
if (class_exists('Xoops\\Form\\Editor')) {
$configs = array('name' => 'com_text', 'value' => $obj->getVar('text', 'e'), 'rows' => 25, 'cols' => 90, 'width' => '100%', 'height' => '400px', 'editor' => $editor);
$this->addElement(new Xoops\Form\Editor(_MD_COMMENTS_MESSAGE, 'com_text', $configs, false, $onfailure = 'textarea'));
} else {
$this->addElement(new Xoops\Form\DhtmlTextArea(_MD_COMMENTS_MESSAGE, 'com_text', $obj->getVar('text', 'e'), 10, 50), true);
}
$option_tray = new Xoops\Form\ElementTray(XoopsLocale::OPTIONS, '<br />');
$button_tray = new Xoops\Form\ElementTray('', ' ');
if ($xoops->isUser()) {
if ($xoops->getModuleConfig('com_anonpost', $dirname)) {
$noname = $obj->getVar('noname', 'e') ? 1 : 0;
$noname_checkbox = new Xoops\Form\Checkbox('', 'com_noname', $noname);
$noname_checkbox->addOption(1, XoopsLocale::POST_ANONYMOUSLY);
$option_tray->addElement($noname_checkbox);
}
if (false != $xoops->user->isAdmin($obj->getVar('modid'))) {
// show status change box when editing (comment id is not empty)
if ($obj->getVar('id', 'e')) {
$status_select = new Xoops\Form\Select(_MD_COMMENTS_STATUS, 'com_status', $obj->getVar('status', 'e'));
$status_select->addOptionArray(array(COMMENTS_PENDING => _MD_COMMENTS_PENDING, COMMENTS_ACTIVE => _MD_COMMENTS_ACTIVE, COMMENTS_HIDDEN => _MD_COMMENTS_HIDDEN));
$this->addElement($status_select);
$button_tray->addElement(new Xoops\Form\Button('', 'com_dodelete', XoopsLocale::A_DELETE, 'submit'));
}
if (isset($editor) && in_array($editor, array('textarea', 'dhtmltextarea'))) {
$html_checkbox = new Xoops\Form\Checkbox('', 'com_dohtml', $obj->getVar('dohtml', 'e'));
$html_checkbox->addOption(1, _MD_COMMENTS_DOHTML);
$option_tray->addElement($html_checkbox);
}
}
}
if (isset($editor) && in_array($editor, array('textarea', 'dhtmltextarea'))) {
//Yeah, what?
}
$smiley_checkbox = new Xoops\Form\Checkbox('', 'com_dosmiley', $obj->getVar('domsiley', 'e'));
$smiley_checkbox->addOption(1, _MD_COMMENTS_DOSMILEY);
$option_tray->addElement($smiley_checkbox);
$xcode_checkbox = new Xoops\Form\Checkbox('', 'com_doxcode', $obj->getVar('doxcode', 'e'));
$xcode_checkbox->addOption(1, _MD_COMMENTS_DOXCODE);
$option_tray->addElement($xcode_checkbox);
if (isset($editor) && in_array($editor, array('textarea', 'dhtmltextarea'))) {
$br_checkbox = new Xoops\Form\Checkbox('', 'com_dobr', $obj->getVar('dobr', 'e'));
$br_checkbox->addOption(1, _MD_COMMENTS_DOAUTOWRAP);
$option_tray->addElement($br_checkbox);
} else {
$this->addElement(new Xoops\Form\Hidden('com_dohtml', 1));
$this->addElement(new Xoops\Form\Hidden('com_dobr', 0));
}
$this->addElement($option_tray);
if (!$xoops->isUser()) {
$this->addElement(new Xoops\Form\Captcha());
}
$this->addElement(new Xoops\Form\Hidden('com_modid', $obj->getVar('modid', 'e')));
$this->addElement(new Xoops\Form\Hidden('com_pid', $obj->getVar('pid', 'e')));
$this->addElement(new Xoops\Form\Hidden('com_rootid', $obj->getVar('rootid', 'e')));
$this->addElement(new Xoops\Form\Hidden('com_id', $obj->getVar('id', 'e')));
$this->addElement(new Xoops\Form\Hidden('com_itemid', $obj->getVar('itemid', 'e')));
$this->addElement(new Xoops\Form\Hidden('com_order', Request::getInt('com_order', $helper->getUserConfig('com_order'))));
$this->addElement(new Xoops\Form\Hidden('com_mode', Request::getString('com_mode', $helper->getUserConfig('com_mode'))));
// add module specific extra params
//.........这里部分代码省略.........