HomeHelpTrac

Changeset 10599


Ignore:
Timestamp:
05/25/09 00:00:45 (3 years ago)
Author:
Anton Lesnikov
Message:
  1. Updated admin panels for News, Feedback and Payment modules.
  2. Improvements for design box in admin panel.
Location:
trunk
Files:
1 added
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/templates/base/design_box_1.html

    r10490 r10599  
    11<!-- Design Box [ Start ] here  --> 
    22<div class="adm-design-box"> 
    3     <div class="adm-db-head">__title____top_items__</div> 
     3    <div class="adm-db-head">__title__ 
     4        <div class="dbTopMenu"> 
     5            <bx_repeat:actions> 
     6                <div id="__id__-act" class="active" <bx_if:hide_active>style="display:none"</bx_if:hide_active>> 
     7                    __icon__ 
     8                    <span __class__>__title__</span> 
     9                </div> 
     10                <div id="__id__-pas" class="notActive" <bx_if:hide_inactive>style="display:none"</bx_if:hide_inactive>> 
     11                    __icon__ 
     12                    <a id="__id__" __class__ __href__ __target__ __on_click__>__title__</a> 
     13                </div> 
     14            </bx_repeat:actions> 
     15        </div> 
     16    </div> 
    417    <div class="adm-db-content">__content__</div> 
    518    __bottom_items__ 
  • trunk/inc/admin_design.inc.php

    r10542 r10599  
    5656} 
    5757 
    58 function DesignBoxAdmin($sTitle, $sContent, $sTopItems = '', $sBottomItems = '', $iIndex = 1) { 
     58function DesignBoxAdmin($sTitle, $sContent, $mixedTopItems = '', $sBottomItems = '', $iIndex = 1) {     
     59    if(is_array($mixedTopItems)) { 
     60        $mixedButtons = array(); 
     61        foreach($mixedTopItems as $sId => $aAction) 
     62            $mixedButtons[] = array( 
     63                'id' => $sId, 
     64                'title' => htmlspecialchars_adv(_t($aAction['title'])), 
     65                'class' => isset($aAction['class']) ? ' class="' . $aAction['class'] . '"' : '', 
     66                'icon' => isset($aAction['icon']) ? '<img' . $sClass . ' src="' . $aAction['icon'] . '" />' : '', 
     67                'href' => isset($aAction['href']) ? ' href="' . htmlspecialchars_adv($aAction['href']) . '"' : '', 
     68                'target' => isset($aAction['target'])  ? ' target="' . $aAction['target'] . '"' : '', 
     69                'on_click' => isset($aAction['onclick']) ? ' onclick="' . $aAction['onclick'] . '"' : '', 
     70                'bx_if:hide_active' => array( 
     71                    'condition' => !isset($aAction['active']) || $aAction['active'] != 1, 
     72                    'content' => array() 
     73                ), 
     74                'bx_if:hide_inactive' => array( 
     75                    'condition' => isset($aAction['active']) && $aAction['active'] == 1, 
     76                    'content' => array() 
     77                ) 
     78            ); 
     79    } 
     80    else  
     81        $mixedButtons = $mixedTopItems; 
     82 
    5983    return $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_' . (int)$iIndex . '.html', array( 
    6084        'title' => $sTitle, 
    61         'top_items' => $sTopItems, 
     85        'bx_repeat:actions' => $mixedButtons, 
    6286        'content' => $sContent, 
    6387        'bottom_items' => $sBottomItems         
  • trunk/inc/classes/BxDolModule.php

    r10460 r10599  
    8888     */ 
    8989    function isLogged() { 
    90         /*if(isset($_COOKIE['memberID']) && !empty($_COOKIE['memberID'])) 
    91             return true; 
    92  
    93         return false;*/ 
    94          
    95         // VY CHTO, EBANULIS'? Dark. 
    96          
    97          
    98         return $GLOBALS['logged']['member']; 
     90        return isMember(); 
    9991    } 
    10092    /** 
     
    10496     */ 
    10597    function getUserId() { 
    106         /*else if(isset($_COOKIE['memberID']) && !empty($_COOKIE['memberID']))         
    107             return (int)$_COOKIE['memberID']; 
    108  
    109         return 0;*/ 
    110          
    111         return $GLOBALS['logged']['member'] ? (int)$_COOKIE['memberID'] : 0; 
     98        return isMember() ? (int)$_COOKIE['memberID'] : 0; 
    11299    } 
    113100    /** 
  • trunk/modules/boonex/feedback/admin.php

    r9408 r10599  
    2525global $logged; 
    2626 
    27 $logged['admin'] = member_auth( 1, true, true ); 
     27check_logged(); 
    2828 
    29 $sCaption = _t('_feedback_pcaption_admin'); 
    30 $_page['header'] = $sCaption; 
    31 $_page['header_text'] = $sCaption; 
    32 $_page['css_name'] = ''; 
     29$iIndex = 9; 
     30$_page['name_index'] = $iIndex; 
     31$_page['header'] = _t('_feedback_pcaption_admin'); 
     32$_page['css_name'] = array('forms_adv.css'); 
    3333 
    3434$oFeedback = new BxFdbModule($aModule); 
     
    4646if(isset($_GET['feedback-filter'])) 
    4747    $sFilterValue = $_GET['feedback-filter']; 
     48     
     49$_page_cont[$iIndex]['page_main_code'] = DesignBoxAdmin(_t('_feedback_bcaption_view_admin'), $oFeedback->serviceAdminBlock(0, 0, $sFilterValue)); 
    4850 
    49 TopCodeAdmin(); 
    50     ContentBlockHead(''); 
    51     echo $oFeedback->serviceAdminBlock(0, 0, $sFilterValue); 
    52     ContentBlockFoot(); 
    53 BottomCode(); 
     51PageCodeAdmin(); 
    5452?> 
  • trunk/modules/boonex/feedback/install/langs/en.php

    r9522 r10599  
    2727    '_feedback_bcaption_view_my' => 'My Feedback', 
    2828    '_feedback_bcaption_view_all' => 'Feedback', 
     29    '_feedback_bcaption_view_admin' => 'Feedback', 
    2930    '_feedback_bcaption_index' => 'Feedback', 
    3031    '_feedback_pcaption_view_main' => 'Feedback', 
    3132    '_feedback_pcaption_view_comment' => 'Comments', 
    3233    '_feedback_pcaption_view_vote' => 'Rating', 
     34    '_feedback_admin_menu_sitem' => 'Feedback', 
    3335    '_feedback_top_menu_sitem' => 'Feedback', 
    3436    '_feedback_ext_menu_item' => 'Feedback',     
  • trunk/modules/boonex/feedback/install/sql/install.sql

    r10167 r10599  
    8282('_feedback_ext_menu_item', 'Feedback', '', 'modules/?r=feedback/', '', '', 4, '1', 0, 0, '', 'bottom', 'link'); 
    8383 
    84 SET @iOrder = (SELECT `Order` FROM `sys_menu_admin` WHERE `Categ`='4' ORDER BY `Order` DESC LIMIT 1) + 1; 
    85 INSERT INTO `sys_menu_admin` (`Title`, `Url`, `Desc`, `Check`, `Order`, `Categ`, `Icon`) VALUES  
    86 ('Feedback', '../modules/?r=feedback/admin/', 'For managing member\'s feedback', '', @iOrder, 4, 'modules/boonex/feedback/|feedback.gif'); 
     84SELECT @iOrder:=MAX(`order`) FROM `sys_menu_admin` WHERE `parent_id`='2'; 
     85INSERT INTO `sys_menu_admin`(`parent_id`, `name`, `title`, `url`, `description`, `icon`, `icon_large`, `check`, `order`) VALUES 
     86(2, 'bx_feedback', '_feedback_admin_menu_sitem', '../modules/?r=feedback/admin/', 'For managing member\'s feedback', 'modules/boonex/feedback/|feedback.gif', '', '', @iOrder+1); 
    8787 
    8888 
  • trunk/modules/boonex/feedback/install/sql/uninstall.sql

    r10079 r10599  
    77DELETE FROM `sys_menu_top` WHERE `Name`='Feedback'; 
    88DELETE FROM `sys_menu_member` WHERE `Name`='Feedback'; 
    9 DELETE FROM `sys_menu_admin` WHERE `Title`='Feedback'; 
     9DELETE FROM `sys_menu_admin` WHERE `name`='bx_feedback'; 
    1010 
    1111DELETE FROM `sys_permalinks` WHERE `check`='permalinks_module_feedback'; 
  • trunk/modules/boonex/news/admin.php

    r9408 r10599  
    2525global $logged; 
    2626 
    27 $logged['admin'] = member_auth(1, true, true); 
     27check_logged(); 
    2828 
    29 $sCaption = _t('_news_pcaption_admin'); 
    30 $_page['header'] = $sCaption; 
    31 $_page['header_text'] = $sCaption; 
    32 $_page['css_name'] = ''; 
     29$iIndex = 9; 
     30$_page['name_index'] = $iIndex; 
     31$_page['header'] = _t('_news_pcaption_admin'); 
     32$_page['css_name'] = array('forms_adv.css'); 
    3333 
    3434$oNews = new BxNewsModule($aModule); 
     
    6161    $sFilterValue = $_GET['news-filter']; 
    6262 
    63 TopCodeAdmin(); 
    64     ContentBlockHead(_t('_news_bcaption_post')); 
    65     echo $sPostForm; 
    66     ContentBlockFoot(); 
    67      
    68     ContentBlockHead(_t('_news_bcaption_all')); 
    69     echo $oNews->serviceAdminBlock(0, 0, $sFilterValue); 
    70     ContentBlockFoot();     
    71 BottomCode(); 
     63$_page_cont[$iIndex]['page_main_code'] = DesignBoxAdmin(_t('_news_bcaption_post'), $sPostForm); 
     64$_page_cont[$iIndex]['page_main_code'] .= DesignBoxAdmin(_t('_news_bcaption_all'), $oNews->serviceAdminBlock(0, 0, $sFilterValue)) ; 
     65 
     66PageCodeAdmin(); 
    7267?> 
  • trunk/modules/boonex/news/classes/BxNewsModule.php

    r10042 r10599  
    5656     * Service methods 
    5757     */ 
    58     function servicePostBlock() {                
     58    function servicePostBlock() { 
     59         
    5960        $aVariables = array( 
    60            'include_css' => $this->_oTemplate->addCss(array('forms_adv.css', 'post.css'), true), 
     61           'include_css' => $this->_oTemplate->addCss(array('post.css'), true), 
    6162           'post_form' => $this->_oTextData->getPostForm(array('status' => BX_NEWS_STATUS_INACTIVE)) 
    6263        ); 
     
    7071 
    7172        $aVariables = array( 
    72            'include_css' => $this->_oTemplate->addCss(array('forms_adv.css'), true), 
     73           'include_css' => $this->_oTemplate->addCss(array('post.css'), true), 
    7374           'post_form' => $this->_oTextData->getEditForm($aNews, array('status' => BX_NEWS_STATUS_INACTIVE)) 
    7475        ); 
  • trunk/modules/boonex/news/install/langs/en.php

    r10181 r10599  
    5656    '_news_calendar_top_menu_sitem' => 'Calendar', 
    5757    '_news_search_top_menu_sitem' => 'Search', 
     58    '_news_admin_menu_sitem' => 'News', 
    5859    '_news_ext_menu_item' => 'News', 
    5960    '_news_status_0' => 'active', 
  • trunk/modules/boonex/news/install/sql/install.sql

    r10172 r10599  
    110110('_news_ext_menu_item', 'News', '', 'modules/?r=news/', '', '', 6, '1', 0, 0, '', 'bottom', 'link'); 
    111111 
    112 SET @iOrder = (SELECT `Order` FROM `sys_menu_admin` WHERE `Categ`='4' ORDER BY `Order` DESC LIMIT 1) + 1; 
    113 INSERT INTO `sys_menu_admin` (`Title`, `Url`, `Desc`, `Check`, `Order`, `Categ`, `Icon`) VALUES  
    114 ('News', '../modules/?r=news/admin/', 'For managing news', '', @iOrder, 4, 'modules/boonex/news/|site_news.gif'); 
     112SELECT @iOrder:=MAX(`order`) FROM `sys_menu_admin` WHERE `parent_id`='2'; 
     113INSERT INTO `sys_menu_admin`(`parent_id`, `name`, `title`, `url`, `description`, `icon`, `icon_large`, `check`, `order`) VALUES 
     114(2, 'bx_news', '_news_admin_menu_sitem', '../modules/?r=news/admin/', 'For managing news', 'modules/boonex/news/|site_news.gif', '', '', @iOrder+1); 
     115 
    115116 
    116117INSERT INTO `sys_permalinks`(`standard`, `permalink`, `check`) VALUES('modules/?r=news/', 'm/news/', 'permalinks_module_news'); 
  • trunk/modules/boonex/news/install/sql/uninstall.sql

    r10079 r10599  
    99DELETE FROM `sys_menu_top` WHERE `Name`='News' OR `Parent`=@iTMParentId; 
    1010DELETE FROM `sys_menu_member` WHERE `Name`='News'; 
    11 DELETE FROM `sys_menu_admin` WHERE `Title`='News'; 
     11DELETE FROM `sys_menu_admin` WHERE `name`='bx_news'; 
    1212 
    1313DELETE FROM `sys_permalinks` WHERE `check`='permalinks_module_news'; 
  • trunk/modules/boonex/payment/admin.php

    r10072 r10599  
    2525global $logged; 
    2626 
    27 $logged['admin'] = member_auth(1, true, true); 
     27check_logged(); 
    2828 
    29 $sCaption = _t('_payment_pcaption_admin'); 
    30 $_page['header'] = $sCaption; 
    31 $_page['header_text'] = $sCaption; 
    32 $_page['css_name'] = 'forms_adv.css'; 
     29$iIndex = 9; 
     30$_page['name_index'] = $iIndex; 
     31$_page['header'] = _t('_payment_pcaption_admin'); 
     32$_page['css_name'] = array('forms_adv.css', 'modules/boonex/payment/|orders.css'); 
    3333 
    3434$oPayments = new BxPmtModule($aModule); 
    35 $sContentDetails = $oPayments->getDetailsForm(); 
     35$aDetailsBox = $oPayments->getDetailsForm(); 
     36$aPendingOrdersBox = $oPayments->getOrdersBlock('pending'); 
     37$aProcessedOrdersBox = $oPayments->getOrdersBlock('processed'); 
    3638 
    37 TopCodeAdmin(); 
    38     ContentBlockHead(_t('_payment_bcaption_details')); 
    39     echo $sContentDetails; 
    40     ContentBlockFoot(); 
    41      
    42     ContentBlockHead(_t('_payment_bcaption_settings')); 
    43     echo 'Under Development'; 
    44     ContentBlockFoot();     
    45 BottomCode(); 
     39$mixedResultSettings = ''; 
     40if(isset($_POST['save']) && isset($_POST['cat'])) { 
     41    $mixedResultSettings = $oPayments->setSettings($_POST); 
     42} 
     43 
     44$_page_cont[$iIndex]['page_main_code'] = $oPayments->_oTemplate->addCss(array('orders.css'), true) . $oPayments->_oTemplate->addJs(array('orders.js'), true) . $oPayments->getExtraJs('orders'); 
     45$_page_cont[$iIndex]['page_main_code'] .= DesignBoxAdmin(_t('_payment_bcaption_settings'), $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $oPayments->getSettingsForm($mixedResultSettings)))); 
     46$_page_cont[$iIndex]['page_main_code'] .= DesignBoxAdmin(_t('_payment_bcaption_details'), $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $aDetailsBox[0]))); 
     47$_page_cont[$iIndex]['page_main_code'] .= DesignBoxAdmin(_t('_payment_bcaption_pending_orders'), $aPendingOrdersBox[0]); 
     48$_page_cont[$iIndex]['page_main_code'] .= DesignBoxAdmin(_t('_payment_bcaption_processed_orders'), $aProcessedOrdersBox[0]); 
     49$_page_cont[$iIndex]['page_main_code'] .= $oPayments->getMoreWindow(); 
     50$_page_cont[$iIndex]['page_main_code'] .= $oPayments->getManualOrderWindow(); 
     51PageCodeAdmin(); 
    4652?> 
  • trunk/modules/boonex/payment/classes/BxPmtModule.php

    r10239 r10599  
    2121 
    2222bx_import('BxDolModule'); 
     23bx_import('BxDolAdminSettings'); 
    2324 
    2425require_once( BX_DIRECTORY_PATH_PLUGINS . 'Services_JSON.php' ); 
     
    241242     
    242243     
     244    /** 
     245     *  
     246     * Admin Settings Methods 
     247     *  
     248     */ 
     249    function getSettingsForm($mixedResult) { 
     250        $iId = (int)$this->_oDb->getOne("SELECT `ID` FROM `sys_options_cats` WHERE `name`='Payment'"); 
     251        if(empty($iId)) 
     252           return MsgBox('_payment_msg_no_results'); 
     253            
     254        $oSettings = new BxDolAdminSettings($iId); 
     255        $sResult = $oSettings->getForm(); 
     256                    
     257        if($mixedResult !== true && !empty($mixedResult)) 
     258            $sResult = $mixedResult . $sResult; 
     259 
     260        return $sResult; 
     261    } 
     262    function setSettings($aData) { 
     263        $iId = (int)$this->_oDb->getOne("SELECT `ID` FROM `sys_options_cats` WHERE `name`='Payment'"); 
     264        if(empty($iId)) 
     265           return MsgBox(_t('_payment_err_wrong_data')); 
     266            
     267        $oSettings = new BxDolAdminSettings($iId); 
     268        return $oSettings->saveChanges($_POST); 
     269    } 
     270     
    243271     
    244272    /** 
  • trunk/modules/boonex/payment/install/langs/en.php

    r10232 r10599  
    109109    '_payment_tmenu_payments' => 'Payments', 
    110110    '_payment_tmenu_cart' => 'Cart', 
     111    '_payment_amenu_payment' => 'Payment', 
    111112    '_payment_txt_admin_username' => 'Administrator', 
    112113    '_payment_txt_shopping_cart' => '\'s cart', 
  • trunk/modules/boonex/payment/install/sql/install.sql

    r10232 r10599  
    103103 
    104104INSERT INTO `sys_options` (`Name`, `VALUE`, `kateg`, `desc`, `Type`, `check`, `err_text`, `order_in_kateg`, `AvailableValues`) VALUES 
    105 ('pmt_default_currency_code', 'USD', @iCategoryId, 'Currency code', 'combobox', 'return strlen($arg0) > 0;', 'Cannot be empty.', 0, 'USD,EURO'), 
     105('pmt_default_currency_code', 'USD', @iCategoryId, 'Currency code', 'select', 'return strlen($arg0) > 0;', 'Cannot be empty.', 0, 'USD,EURO'), 
    106106('pmt_default_currency_sign', '$', @iCategoryId, 'Currency sign', 'text', 'return strlen($arg0) > 0;', 'Cannot be empty.', 1, ''), 
    107 ('pmt_date_format_orders', '%d.%m.%y', @iCategoryId, 'Date format in orders administration', 'text', '', '', 1, ''), 
     107('pmt_date_format_orders', '%d.%m.%y', @iCategoryId, 'Date format in orders administration', 'text', '', '', 2, ''), 
    108108('permalinks_module_payment', 'on', 26, 'Enable friendly payment permalink', 'checkbox', '', '', 0, ''); 
    109109 
     
    133133(118, 'Cart', '_payment_tmenu_cart', 'modules/?r=payment/cart/|modules/?r=payment/history/', @iTMOrder+2, 'memb', '', '', '', 1, 1, 1, 'custom', 0, 'modules/boonex/payment/|tmenu_icon_cart.png', 0, ''); 
    134134 
    135 SET @iOrder = (SELECT `Order` FROM `sys_menu_admin` WHERE `Categ`='4' ORDER BY `Order` DESC LIMIT 1) + 1; 
    136 INSERT INTO `sys_menu_admin` (`Title`, `Url`, `Desc`, `Check`, `Order`, `Categ`, `Icon`) VALUES  
    137 ('Payment', '../modules/?r=payment/admin/', 'For managing payment module', '', @iOrder, 4, 'modules/boonex/payment/|amenu_item.gif'); 
     135SELECT @iOrder:=MAX(`order`) FROM `sys_menu_admin` WHERE `parent_id`='2'; 
     136INSERT INTO `sys_menu_admin`(`parent_id`, `name`, `title`, `url`, `description`, `icon`, `icon_large`, `check`, `order`) VALUES 
     137(2, 'bx_payment', '_payment_amenu_payment', '../modules/?r=payment/admin/', 'For managing payment module', 'modules/boonex/payment/|amenu_item.gif', '', '', @iOrder+1); 
    138138 
    139139 
  • trunk/modules/boonex/payment/install/sql/uninstall.sql

    r10181 r10599  
    2121 
    2222DELETE FROM `sys_menu_top` WHERE `Name` IN ('Payments', 'Cart'); 
    23  
    24 DELETE FROM `sys_menu_admin` WHERE `Title`='Payment'; 
     23DELETE FROM `sys_menu_admin` WHERE `name`='bx_payment'; 
  • trunk/modules/boonex/payment/templates/base/css/orders.css

    r10208 r10599  
    105105} 
    106106 
     107div.adm-db-content div#pmt-orders-pending { 
     108    width: 929px; 
     109} 
    107110 
    108111/*--- Table Styles ---*/ 
Note: See TracChangeset for help on using the changeset viewer.