예제 #1
0
 /**
  * XoopsfaqCategoryHandler::displayAdminListing()
  *
  * @return
  */
 function displayAdminListing()
 {
     $objects = $this->getObj();
     $buttons = array('edit', 'delete');
     $ret = "<table style='width: 100%; border-width: 0px; padding: 2px margin: 1px;' class='outer'>\n" . "  <tr class='xoopsCenter'>\n" . "    <th style='width: 5%;'>" . _AM_XOOPSFAQ_CATEGORY_ID . "</th>\n" . "    <th style='text-align: left;'>" . _AM_XOOPSFAQ_CATEGORY_TITLE . "</th>\n" . "    <th style='width: 5%;'>" . _AM_XOOPSFAQ_CATEGORY_WEIGHT . "</th>\n" . "    <th style='width: 20%;'>" . _AM_XOOPSFAQ_ACTIONS . "</th>\n" . "  </tr>";
     if ($objects['count'] > 0) {
         foreach ($objects['list'] as $object) {
             $ret .= "  <tr class='xoopsCenter'>\n" . "    <td class='even'>" . $object->getVar('category_id') . "</td>\n" . "    <td style='text-align: left;' class='even'>" . $object->getVar('category_title') . "</td>\n" . "    <td style='text-align: center;' class='even'>" . $object->getVar('category_order') . "</td>\n" . "    <td style='text-align: center;' class='even'>";
             $ret .= xoopsFaq_getIcons($buttons, 'category_id', $object->getVar('category_id'), $extra = null);
             $ret .= "    </td>\n" . "  </tr>";
         }
     } else {
         $ret .= "  <tr style='text-align: center;'><td colspan='4' class='even'>" . _AM_XOOPSFAQ_NOLISTING . "</td></tr>\n";
     }
     $ret .= "  <tr style='text-align: center;'><td colspan='4' class='head'>&nbsp;</td></tr>\n" . "</table>\n";
     echo $ret;
 }
예제 #2
0
 /**
  * XoopsfaqContentsHandler::displayAdminListing()
  *
  * @return
  */
 function displayAdminListing()
 {
     $objects = $this->getObj();
     $xfCatHandler =& xoops_getmodulehandler('category', $GLOBALS['xoopsModule']->getVar('dirname'));
     $catFields = array('category_id', 'category_title');
     $catArray = $xfCatHandler->getAll(null, $catFields, false);
     $buttons = array('edit', 'delete');
     $ret = "<table style='width: 100%; border-width: 0px; padding: 2px; margin: 1px;' class='outer'>\n" . "  <tr class='xoopsCenter'>\n" . "    <th style='width: 5%;'>" . _AM_XOOPSFAQ_CONTENTS_ID . "</th>\n" . "    <th style='text-align: left;'>" . _AM_XOOPSFAQ_CATEGORY_TITLE . "</th>\n" . "    <th style='text-align: left;'>" . _AM_XOOPSFAQ_CONTENTS_TITLE . "</th>\n" . "    <th>" . _AM_XOOPSFAQ_CONTENTS_ACTIVE . "</th>\n" . "    <th>" . _AM_XOOPSFAQ_CONTENTS_PUBLISH . "</th>\n" . "    <th style='width: 5%;'>" . _AM_XOOPSFAQ_CONTENTS_WEIGHT . "</th>\n" . "    <th style='width: 20%;'>" . _AM_XOOPSFAQ_ACTIONS . "</th>\n" . "   </tr>";
     if ($objects['count'] > 0) {
         foreach ($objects['list'] as $object) {
             $thisCatId = $object->getVar('contents_cid');
             $thisCatTitle = $catArray[$thisCatId]['category_title'];
             $ret .= "  <tr class='xoopsCenter'>\n" . "    <td style='text-align: center;' class='even'>" . $object->getVar('contents_id') . "</td>\n" . "    <td style='text-align: left;' class='even'>" . $thisCatTitle . "</td>\n" . "    <td style='text-align: left;' class='even'>" . $object->getVar('contents_title') . "</td>\n" . "    <td style='text-align: center;' class='even'>" . $object->getActive() . "</td>\n" . "    <td style='text-align: center;' class='even'>" . $object->getPublished() . "</td>\n" . "    <td style='text-align: center;' class='even'>" . $object->getVar('contents_weight') . "</td>\n" . "    <td style='text-align: center;' class='even'>\n";
             $ret .= xoopsFaq_getIcons($buttons, 'contents_id', $object->getVar('contents_id'), $extra = null);
             $ret .= "  </tr>\n";
         }
     } else {
         $ret .= "  <tr style='text-align: center;'><td colspan='7' class='even'>" . _AM_XOOPSFAQ_NOLISTING . "</td></tr>\n";
     }
     $ret .= "  <tr style='text-align: center;'><td colspan='7' class='head'>&nbsp;</td></tr>\n";
     $ret .= "</table>\n";
     echo $ret;
 }