Пример #1
0
 case "delete":
     $obj =& $handler->get($_REQUEST['id']);
     if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1) {
         if ($handler->delete($obj)) {
             redirect_header('newsletter.php?op=list', 3, sprintf(_NL_AM_DELETEDSUCCESS, $typetitle));
         } else {
             echo implode('<br />', $obj->getErrors());
         }
     } else {
         smart_xoops_cp_header();
         smart_adminMenu(0);
         xoops_confirm(array('ok' => 1, 'id' => $_REQUEST['id'], 'op' => 'delete'), 'newsletter.php', sprintf(_NL_AM_RUSUREDEL, getIdentifier($obj, $handler)));
     }
     break;
 case "details":
     smart_xoops_cp_header();
     smart_adminMenu(0);
     $newsletter = $handler->get($id);
     $newsletter_arr = $newsletter->toArray();
     $xoopsTpl->assign('newsletter', $newsletter_arr);
     $rule_handler = xoops_getmodulehandler('rule');
     $newsletter_criteria = new Criteria('newsletterid', $id);
     $criteria = new CriteriaCompo($newsletter_criteria);
     $rules = $rule_handler->getObjects($newsletter_criteria, true, false);
     if (count($rules) > 0) {
         foreach (array_keys($rules) as $i) {
             if (file_exists(XOOPS_ROOT_PATH . "/language/" . $GLOBALS['xoopsConfig']['language'] . "/calendar.php")) {
                 include_once XOOPS_ROOT_PATH . "/language/" . $GLOBALS['xoopsConfig']['language'] . "/calendar.php";
             } else {
                 include_once XOOPS_ROOT_PATH . "/language/english/calendar.php";
             }
Пример #2
0
 function render()
 {
     /**
      * @todo move the output to a template
      * @todo make the output XHTML compliant
      */
     $myts =& MyTextSanitizer::getInstance();
     global $xoopsModule;
     smart_xoops_cp_header();
     $module_handler =& xoops_gethandler('module');
     $versioninfo =& $module_handler->get($xoopsModule->getVar('mid'));
     smart_adminMenu(-1, $this->_aboutTitle . " " . $versioninfo->getInfo('name'));
     include_once XOOPS_ROOT_PATH . '/class/template.php';
     $this->_tpl = new XoopsTpl();
     $this->_tpl->assign('module_url', XOOPS_URL . "/modules/" . $xoopsModule->getVar('dirname') . "/");
     $this->_tpl->assign('module_image', $versioninfo->getInfo('image'));
     $this->_tpl->assign('module_name', $versioninfo->getInfo('name'));
     $this->_tpl->assign('module_version', $versioninfo->getInfo('version'));
     $this->_tpl->assign('module_status_version', $versioninfo->getInfo('status_version'));
     // Left headings...
     if ($versioninfo->getInfo('author_realname') != '') {
         $author_name = $versioninfo->getInfo('author') . " (" . $versioninfo->getInfo('author_realname') . ")";
     } else {
         $author_name = $versioninfo->getInfo('author');
     }
     $this->_tpl->assign('module_author_name', $author_name);
     $this->_tpl->assign('module_license', $versioninfo->getInfo('license'));
     $this->_tpl->assign('module_credits', $versioninfo->getInfo('credits'));
     // Developers Information
     $this->_tpl->assign('module_developer_lead', $versioninfo->getInfo('developer_lead'));
     $this->_tpl->assign('module_developer_contributor', $versioninfo->getInfo('developer_contributor'));
     $this->_tpl->assign('module_developer_website_url', $versioninfo->getInfo('developer_website_url'));
     $this->_tpl->assign('module_developer_website_name', $versioninfo->getInfo('developer_website_name'));
     $this->_tpl->assign('module_developer_email', $versioninfo->getInfo('developer_email'));
     $people = $versioninfo->getInfo('people');
     if ($people) {
         $this->_tpl->assign('module_people_developers', isset($people['developers']) ? array_map(array($this, 'sanitize'), $people['developers']) : false);
         $this->_tpl->assign('module_people_testers', isset($people['testers']) ? array_map(array($this, 'sanitize'), $people['testers']) : false);
         $this->_tpl->assign('module_people_translators', isset($people['translators']) ? array_map(array($this, 'sanitize'), $people['translators']) : false);
         $this->_tpl->assign('module_people_documenters', isset($people['documenters']) ? array_map(array($this, 'sanitize'), $people['documenters']) : false);
         $this->_tpl->assign('module_people_other', isset($people['other']) ? array_map(array($this, 'sanitize'), $people['other']) : false);
     }
     //$this->_tpl->assign('module_developers', $versioninfo->getInfo('developer_email'));
     // Module Development information
     $this->_tpl->assign('module_date', $versioninfo->getInfo('date'));
     $this->_tpl->assign('module_status', $versioninfo->getInfo('status'));
     $this->_tpl->assign('module_demo_site_url', $versioninfo->getInfo('demo_site_url'));
     $this->_tpl->assign('module_demo_site_name', $versioninfo->getInfo('demo_site_name'));
     $this->_tpl->assign('module_support_site_url', $versioninfo->getInfo('support_site_url'));
     $this->_tpl->assign('module_support_site_name', $versioninfo->getInfo('support_site_name'));
     $this->_tpl->assign('module_submit_bug', $versioninfo->getInfo('submit_bug'));
     $this->_tpl->assign('module_submit_feature', $versioninfo->getInfo('submit_feature'));
     // Warning
     $this->_tpl->assign('module_warning', $this->sanitize($versioninfo->getInfo('warning')));
     // Author's note
     $this->_tpl->assign('module_author_word', $versioninfo->getInfo('author_word'));
     // For changelog thanks to 3Dev
     global $xoopsModule;
     $filename = XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/changelog.txt';
     if (is_file($filename)) {
         $filesize = filesize($filename);
         $handle = fopen($filename, 'r');
         $this->_tpl->assign('module_version_history', $myts->displayTarea(fread($handle, $filesize), true));
         fclose($handle);
     }
     $this->_tpl->display('db:smartobject_about.html');
     smart_modFooter();
     xoops_cp_footer();
 }