當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Am_Form_Admin::addSaveButton方法代碼示例

本文整理匯總了PHP中Am_Form_Admin::addSaveButton方法的典型用法代碼示例。如果您正苦於以下問題:PHP Am_Form_Admin::addSaveButton方法的具體用法?PHP Am_Form_Admin::addSaveButton怎麽用?PHP Am_Form_Admin::addSaveButton使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Am_Form_Admin的用法示例。


在下文中一共展示了Am_Form_Admin::addSaveButton方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: indexAction

    public function indexAction()
    {
        if ($this->getRequest()->getParam('title') && $this->getRequest()->getParam('actionType')) {
            $productIds = $this->getRequest()->getParam('productIds');
            $prIds = $productIds ? implode(',', $productIds) : implode(',', array_keys($this->getDi()->productTable->getOptions(true)));
            $htmlcode = '
<!-- Button/Link for aMember Shopping Cart -->
<script type="text/javascript">
if (typeof cart  == "undefined")
    document.write("<scr" + "ipt src=\'' . REL_ROOT_URL . '/application/cart/views/public/js/cart.js\'></scr" + "ipt>");
</script>
';
            if ($this->getRequest()->getParam('isLink')) {
                $htmlcode .= '<a href="#" onclick="cart.' . $this->getRequest()->getParam('actionType') . '(this,' . $prIds . '); return false;" >' . $this->getRequest()->getParam('title') . '</a>';
            } else {
                $htmlcode .= '<input type="button" onclick="cart.' . $this->getRequest()->getParam('actionType') . '(this,' . $prIds . '); return false;" value="' . $this->getRequest()->getParam('title') . '">';
            }
            $htmlcode .= '
<!-- End Button/Link for aMember Shopping Cart -->
';
            $this->view->assign('htmlcode', $htmlcode);
            $this->view->display('admin/cart/button-code.phtml');
        } else {
            $form = new Am_Form_Admin();
            $form->addMagicSelect('productIds')->setLabel(___('Select Product(s)
if nothing selected - all products'))->loadOptions($this->getDi()->productTable->getOptions());
            $form->addSelect('isLink')->setLabel(___('Select Type of Element'))->loadOptions(array(0 => 'Button', 1 => 'Link'));
            $form->addSelect('actionType')->setLabel(___('Select Action of Element'))->loadOptions(array('addExternal' => ___('Add to Basket only'), 'addBasketExternal' => ___('Add & Go to Basket'), 'addCheckoutExternal' => ___('Add & Checkout')));
            $form->addText('title')->setLabel(___('Title of Element'))->addRule('required');
            $form->addSaveButton(___('Generate'));
            $this->view->assign('form', $form);
            $this->view->display('admin/cart/button-code.phtml');
        }
    }
開發者ID:grlf,項目名稱:eyedock,代碼行數:34,代碼來源:AdminShoppingCartController.php

示例2: run

    public function run()
    {
        $form = new Am_Form_Admin('form-grid-config');
        $form->setAttribute('name', 'customize');
        $form->addSortableMagicSelect('fields')->loadOptions($this->getFieldsOptions())->setLabel(___('Fields to Display in Grid'))->setJsOptions(<<<CUT
{
    allowSelectAll:true,
    sortable: true
}
CUT
);
        foreach ($this->grid->getVariablesList() as $k) {
            $form->addHidden($this->grid->getId() . '_' . $k)->setValue($this->grid->getRequest()->get($k, ""));
        }
        $form->addSaveButton();
        $form->setDataSources(array($this->grid->getCompleteRequest()));
        if ($form->isSubmitted()) {
            $values = $form->getValue();
            $this->setConfig($values['fields']);
            $this->grid->redirectBack();
        } else {
            $form->setDataSources(array(new HTML_QuickForm2_DataSource_Array(array('fields' => $this->getSelectedFields()))));
            echo $this->renderTitle();
            echo sprintf('<div class="info">%s</div>', ___('You can change Number of %sRecords per Page%s in section %sSetup/Configuration%s', '<strong>', '</strong>', '<a class="link" href="' . REL_ROOT_URL . '/admin-setup" target="_top">', '</a>'));
            echo $form;
        }
    }
開發者ID:grlf,項目名稱:eyedock,代碼行數:27,代碼來源:Customize.php

示例3: createForm

 function createForm()
 {
     $form = new Am_Form_Admin();
     $form->setAction($this->getUrl(null, 'clear'));
     $form->addDate('dat')->setLabel(___("Date to Purge\nall records prior to this date will be removed from selected tables"))->addRule('required');
     $section = $form->addFieldset('tables')->setLabel(___('Tables to Purge'));
     foreach ($this->getItems() as $id => $item) {
         $section->addAdvCheckbox($id)->setLabel(array($item['title'], $item['desc']));
     }
     $form->addSaveButton(___('Clear'));
     return $form;
 }
開發者ID:grlf,項目名稱:eyedock,代碼行數:12,代碼來源:AdminClearController.php

示例4: run

 function run()
 {
     $form = new Am_Form_Admin('form-grid-payout');
     $form->setAttribute('name', 'payout');
     $date = $form->addDate('payout_date')->setLabel(___('Payout Date'))->setValue(sqlDate($this->getDi()->dateTime));
     foreach ($this->grid->getVariablesList() as $k) {
         $form->addHidden($this->grid->getId() . '_' . $k)->setValue($this->grid->getRequest()->get($k, ""));
     }
     $form->addSaveButton(___("Run Payout"));
     $form->setDataSources(array($this->grid->getCompleteRequest()));
     if ($form->isSubmitted() && $form->validate()) {
         $values = $form->getValue();
         $this->getDi()->affCommissionTable->runPayout($values['payout_date']);
         $this->grid->redirectBack();
     } else {
         echo $this->renderTitle();
         echo $form;
     }
 }
開發者ID:irovast,項目名稱:eyedock,代碼行數:19,代碼來源:AdminPayoutController.php

示例5: createAccessForm

 public function createAccessForm()
 {
     static $form;
     if (!$form) {
         $form = new Am_Form_Admin();
         $form->setAction($url = $this->getUrl(null, 'c', null, 'payments', 'addaccess', 'user_id', $this->user_id));
         $sel = $form->addSelect('product_id');
         $options = $this->getDi()->productTable->getOptions();
         $sel->addOption(___('Please select an item...'), '');
         foreach ($options as $k => $v) {
             $sel->addOption($v, $k);
         }
         $sel->addRule('required', 'this field is required');
         $form->addDate('begin_date')->addRule('required', 'this field is required');
         $form->addDate('expire_date')->addRule('required', 'this field is required');
         $form->addSaveButton('Add Access Manually');
     }
     return $form;
 }
開發者ID:subashemphasize,項目名稱:test_site,代碼行數:19,代碼來源:AdminUserPaymentsController.php

示例6: changePaysysAction

 function changePaysysAction()
 {
     $form = new Am_Form_Admin();
     $form->setDataSources(array($this->_request));
     $form->addStatic()->setContent(___('If you are moving from one payment processor, you can use this page to switch existing subscription from one payment processor to another. It is possible only if full credit card info is stored on aMember side.'));
     $options = array();
     foreach ($this->getModule()->getPlugins() as $ps) {
         $options[$ps->getId()] = $ps->getTitle();
     }
     $from = $form->addSelect('from')->setLabel('Move Active Invoices From')->loadOptions($options)->addRule('required');
     $to = $form->addSelect('to')->setLabel('Move To')->loadOptions($options)->addRule('required');
     $to->addRule('neq', ___('Values must not be equal'), $from);
     $form->addSaveButton();
     if ($form->isSubmitted() && $form->validate()) {
         $vars = $form->getValue();
         $updated = $this->getDi()->db->query("UPDATE ?_invoice SET paysys_id=? WHERE paysys_id=? AND status IN (?a)", $vars['to'], $vars['from'], array(Invoice::RECURRING_ACTIVE));
         $this->view->content = "{$updated} rows changed. New rebills for these invoices will be handled with [{$vars['to']}]";
     } else {
         $this->view->content = (string) $form;
     }
     $this->view->title = ___("Change Paysystem");
     $this->view->display('admin/layout.phtml');
 }
開發者ID:subashemphasize,項目名稱:test_site,代碼行數:23,代碼來源:AdminController.php

示例7: createImportForm

 function createImportForm(&$defaults)
 {
     $form = new Am_Form_Admin();
     /** count imported */
     $imported_products = $this->getDi()->db->selectCell("SELECT COUNT(id) FROM ?_data WHERE `table`='product' AND `key`='wom:id'");
     $wopCfg = $this->db_wordpress->selectCell("SELECT option_value FROM ?_options WHERE option_name = ?", 'ws_plugin__optimizemember_options');
     $wopCfg = unserialize($wopCfg);
     if (is_array($wopCfg)) {
         $amProducts = array('' => '-- Please Select --') + $this->getDi()->productTable->getOptions();
         $womProducts = array();
         for ($i = 0; $i <= 10; $i++) {
             $womProducts['level' . ($i ? $i : '')] = $wopCfg['level' . $i . '_label'];
         }
         if ($imported_products) {
             $cb = $form->addStatic()->setContent("Linked");
         } else {
             $cb = $form->addRadio('import', array('value' => 'product'));
             foreach ($womProducts as $key => $value) {
                 $form->addSelect("pr_link[" . $key . "]")->setLabel($value)->loadOptions($amProducts);
             }
             $form->addRule('callback2', '-error-', array($this, 'validateForm'));
         }
         $cb->setLabel('Link Products');
     }
     if (!is_array($wopCfg) || $imported_products) {
         $imported_users = $this->getDi()->db->selectCell("SELECT COUNT(id) FROM ?_data WHERE `table`='user' AND `key`='wom:id'");
         $total = $this->db_wordpress->selectCell("SELECT COUNT(*) FROM ?_users");
         if ($imported_users >= $total) {
             $cb = $form->addStatic()->setContent("Imported ({$imported_users})");
         } else {
             $cb = $form->addGroup();
             if ($imported_users) {
                 $cb->addStatic()->setContent("partially imported ({$imported_users} of {$total} total)<br /><br />");
             }
             $cb->addRadio('import', array('value' => 'user'));
             $cb->addStatic()->setContent('<br /><br /># of users (keep empty to import all) ');
             $cb->addInteger('user[count]');
             $cb->addStatic()->setContent('<br />Keep the same user IDs');
             $keep_id_chkbox = $cb->addCheckbox('user[keep_user_id]');
             if ($this->getDi()->db->selectCell("SELECT COUNT(*) FROM ?_user")) {
                 $keep_id_chkbox->setAttribute('disabled');
                 $cb->addStatic()->setContent('User database have records already. Please use Clean Up if you want to keep the same user IDs');
             }
         }
         $cb->setLabel('Import User and Payment Records');
     }
     $form->addSaveButton('Run');
     $defaults = array();
     return $form;
 }
開發者ID:grlf,項目名稱:eyedock,代碼行數:50,代碼來源:AdminImportWordpressOptimizeMemberController.php

示例8: createAccessForm

 public function createAccessForm()
 {
     static $form;
     if (!$form) {
         $form = new Am_Form_Admin();
         $form->setAction($url = $this->getUrl(null, 'addaccess', null, 'user_id', $this->user_id));
         $sel = $form->addSelect('product_id', array('class' => 'el-wide am-combobox'));
         $options = $this->getDi()->productTable->getOptions();
         $sel->addOption(___('Please select an item...'), '');
         foreach ($options as $k => $v) {
             $sel->addOption($v, $k);
         }
         $sel->addRule('required', ___('This field is required'));
         $form->addText('comment', array('class' => 'el-wide', 'placeholder' => ___('Comment for Your Reference')));
         $form->addDate('begin_date')->addRule('required', ___('This field is required'));
         $form->addDate('expire_date')->addRule('required', ___('This field is required'));
         $form->addAdvCheckbox('does_not_send_autoresponder');
         $form->addSaveButton(___('Add Access Manually'));
     }
     return $form;
 }
開發者ID:alexanderTsig,項目名稱:arabic,代碼行數:21,代碼來源:AdminUserPaymentsController.php

示例9: importAction

 function importAction()
 {
     $form = new Am_Form_Admin();
     $import = $form->addFile('import')->setLabel('Upload file [email-templates.xml]');
     $form->addStatic('')->setContent('WARNING! All existing e-mail templates will be removed from database!');
     //$import->addRule('required', 'Please upload file');
     //$form->addAdvCheckbox('remove')->setLabel('Remove your existing templates?');
     $form->addSaveButton(___('Upload'));
     if ($form->isSubmitted() && $form->validate()) {
         $value = $form->getValue();
         $fn = DATA_DIR . '/import.email-templates.xml';
         if (!move_uploaded_file($value['import']['tmp_name'], $fn)) {
             throw new Am_Exception_InternalError("Could not move uploaded file");
         }
         $xml = file_get_contents($fn);
         if (!$xml) {
             throw new Am_Exception_InputError("Could not read XML");
         }
         $count = $this->getDi()->emailTemplateTable->deleteBy(array())->importXml($xml);
         $this->view->content = "Import Finished. {$count} templates imported.";
     } else {
         $this->view->content = (string) $form;
     }
     $this->view->title = "Import E-Mail Templates from XML file";
     $this->view->display('admin/layout.phtml');
 }
開發者ID:subashemphasize,項目名稱:test_site,代碼行數:26,代碼來源:AdminEmailTemplatesController.php

示例10: createImportForm

 function createImportForm(&$defaults)
 {
     $form = new Am_Form_Admin();
     /** count imported */
     $imported_products = $this->getDi()->db->selectCell("SELECT COUNT(id) FROM ?_data WHERE `table`='product' AND `key`='ym:id'");
     $memberTypes = unserialize($this->db_yourmembers->selectCell("SELECT option_value  FROM ?_options where option_name='ym_packs'"));
     $total = $memberTypes->getCount();
     if ($imported_products >= $total) {
         $cb = $form->addStatic()->setContent("Imported ({$imported_products} of {$total})");
     } else {
         $cb = $form->addRadio('import', array('value' => 'product'));
     }
     $cb->setLabel('Import Products');
     // Import coupons
     $imported_coupons = $this->getDi()->db->selectCell("SELECT COUNT(id) FROM ?_data WHERE `table`='coupon' AND `key`='ym:id'");
     $totalc = $this->db_yourmembers->selectCell("SELECT COUNT(*) FROM ?_ym_coupon");
     if ($imported_products) {
         if ($imported_coupons >= $totalc) {
             $cb = $form->addStatic()->setContent("Imported ({$imported_coupons} of {$totalc})");
         } else {
             $cb = $form->addRadio('import', array('value' => 'coupon'));
         }
         $cb->setLabel('Import Coupons');
     }
     if ($imported_products && ($imported_coupons || !$totalc)) {
         $imported_users = $this->getDi()->db->selectCell("SELECT COUNT(id) FROM ?_data WHERE `table`='user' AND `key`='ym:id'");
         $total = $this->db_yourmembers->selectCell("SELECT COUNT(*) FROM ?_users");
         if ($imported_users >= $total) {
             $cb = $form->addStatic()->setContent("Imported ({$imported_users})");
         } else {
             $cb = $form->addGroup();
             if ($imported_users) {
                 $cb->addStatic()->setContent("partially imported ({$imported_users} of {$total} total)<br /><br />");
             }
             $cb->addRadio('import', array('value' => 'user'));
             $cb->addStatic()->setContent('<br /><br /># of users (keep empty to import all) ');
             $cb->addInteger('user[count]');
         }
         $cb->setLabel('Import User and Payment Records');
     }
     $form->addSaveButton('Run');
     $defaults = array();
     return $form;
 }
開發者ID:grlf,項目名稱:eyedock,代碼行數:44,代碼來源:AdminImportYourMembersController.php

示例11: createImportForm

 function createImportForm(&$defaults)
 {
     $form = new Am_Form_Admin();
     /** count imported */
     $imported_products = $this->getDi()->db->selectCell("SELECT COUNT(id) FROM ?_data WHERE `table`='product' AND `key`='am3:id'");
     $total = $this->db3->selectCell("SELECT COUNT(*) FROM ?_products");
     if ($imported_products >= $total) {
         $cb = $form->addStatic()->setContent("Imported ({$imported_products} of {$total})");
     } else {
         $cb = $form->addRadio('import', array('value' => 'product'));
     }
     $cb->setLabel('Import Products');
     if ($imported_products) {
         $imported_users = $this->getDi()->db->selectCell("SELECT COUNT(id) FROM ?_data WHERE `table`='user' AND `key`='am3:id'");
         $total = $this->db3->selectCell("SELECT COUNT(*) FROM ?_members");
         if ($imported_users >= $total) {
             $cb = $form->addStatic()->setContent("Imported ({$imported_users})");
         } else {
             $cb = $form->addGroup();
             if ($imported_users) {
                 $cb->addStatic()->setContent("partially imported ({$imported_users} of {$total} total)<br /><br />");
             }
             $cb->addRadio('import', array('value' => 'user'));
             $cb->addStatic()->setContent('<br /><br /># of users (keep empty to import all) ');
             $cb->addInteger('user[count]');
             $cb->addStatic()->setContent('<br />Do not import pending users');
             $cb->addCheckbox('user[exclude_pending]');
         }
         $cb->setLabel('Import User and Payment Records');
         if ($imported_users) {
             if ($this->getDi()->modules->isEnabled('aff')) {
                 $imported_comm = $this->getDi()->db->selectCell("SELECT COUNT(id) FROM ?_data WHERE `table`='aff_commission' AND `key`='am3:id'");
                 $total = $this->db3->selectCell("SELECT COUNT(*) FROM ?_aff_commission");
                 $gr = $form->addGroup()->setLabel('Import Affiliate Commissions and Refs');
                 if ($imported_comm) {
                     $gr->addStatic()->setContent("Imported ({$imported_comm} of {$total})");
                 } else {
                     $gr->addRadio('import', array('value' => 'aff'));
                 }
             } else {
                 $form->addStatic()->setContent('Enable [aff] module in Setup/Configuration to import information');
             }
             if ($this->getDi()->modules->isEnabled('newsletter')) {
                 $form->addRadio('import', array('value' => 'newsletter'))->setLabel('Import Newsletter Threads and Subscriptions');
             } else {
                 $form->addStatic()->setContent('Enable [newsletter] module in Setup/Configuration to import information');
             }
         }
     }
     $form->addSaveButton('Run');
     $defaults = array();
     return $form;
 }
開發者ID:subashemphasize,項目名稱:test_site,代碼行數:53,代碼來源:AdminImport3Controller.php

示例12: createImportForm

 function createImportForm(&$defaults)
 {
     $form = new Am_Form_Admin();
     /** count imported */
     $imported_products = $this->getDi()->db->selectCell("SELECT COUNT(id) FROM ?_data WHERE `table`='product' AND `key`='ipb_nexus:id'");
     $total = $this->db_ipb_nexus->selectCell("SELECT COUNT(*) FROM ?_nexus_packages");
     if ($this->getDi()->db->selectCell("SELECT COUNT(*) FROM ?_product")) {
         $form->addStatic()->setLabel(___('Clean up v4 Database'))->setContent(sprintf(___('Use this %slink%s to delete data from aMember v4 database and use clean database for import'), '<a href="' . REL_ROOT_URL . '/admin-import-ipb-nexus/clean">', '</a>'));
     }
     if ($imported_products >= $total) {
         $cb = $form->addStatic()->setContent("Imported ({$imported_products} of {$total})");
     } else {
         $cb = $form->addRadio('import', array('value' => 'product'));
     }
     $cb->setLabel('Import Products');
     if ($imported_products) {
         $imported_users = $this->getDi()->db->selectCell("SELECT COUNT(id) FROM ?_data WHERE `table`='user' AND `key`='ipb_nexus:id'");
         $total = $this->db_ipb_nexus->selectCell("SELECT COUNT(*) FROM ?_members");
         if ($imported_users >= $total) {
             $cb = $form->addStatic()->setContent("Imported ({$imported_users})");
         } else {
             $cb = $form->addGroup();
             if ($imported_users) {
                 $cb->addStatic()->setContent("partially imported ({$imported_users} of {$total} total)<br /><br />");
             }
             $cb->addRadio('import', array('value' => 'user'));
             $cb->addStatic()->setContent('<br /><br /># of users (keep empty to import all) ');
             $cb->addInteger('user[count]');
         }
         $cb->setLabel('Import User and Payment Records');
     }
     $form->addSaveButton('Run');
     $defaults = array();
     return $form;
 }
開發者ID:grlf,項目名稱:eyedock,代碼行數:35,代碼來源:AdminImportIpbNexusController.php

示例13: createForm

    protected function createForm()
    {
        $f = new Am_Form_Admin();
        $f->addText('user')->setLabel(___('Enter username of existing user'))->addRule('required');
        $f->addScript()->setScript(<<<CUT
\$(function(){
    \$("#user-0" ).autocomplete({
        minLength: 2,
        source: window.rootUrl + "/admin-users/autocomplete"
    });
});
CUT
);
        $f->addSaveButton(___('Preview'));
        foreach ($this->grid->getVariablesList() as $k) {
            $kk = $this->grid->getId() . '_' . $k;
            if ($v = @$_REQUEST[$kk]) {
                $f->addHidden($kk)->setValue($v);
            }
        }
        return $f;
    }
開發者ID:alexanderTsig,項目名稱:arabic,代碼行數:22,代碼來源:notification.php

示例14: createImportForm


//.........這裏部分代碼省略.........
             $cb = $form->addStatic()->setContent("Imported ({$imported_coupons} of {$totalc})");
         } else {
             $cb = $form->addRadio('import', array('value' => 'coupon'));
         }
         $cb->setLabel('Import Coupons');
     }
     //import folders without actual protection
     /*if ($imported_products)
       {
           $total = $this->db3->selectCell("SELECT COUNT(*) FROM ?_folders");
           if ($total){
               $cb = $form->addRadio('import', array('value' => 'folder'));
               $cb->setLabel('Import Folders');
           }
       }
       //import integrations
       if ($imported_products)
       {
           $cb = $form->addRadio('import', array('value' => 'integration'));
           $cb->setLabel('Import Integrations');
       }
       //import product links
       if ($imported_products)
       {
           $cb = $form->addRadio('import', array('value' => 'productlinks'));
           $cb->setLabel('Import Product Links');
       }*/
     if ($imported_products && ($imported_coupons || !$totalc)) {
         $imported_users = $this->getDi()->db->selectCell("SELECT COUNT(id) FROM ?_data WHERE `table`='user' AND `key`='am3:id'");
         $total = $this->db3->selectCell("SELECT COUNT(*) FROM ?_members");
         if ($imported_users >= $total) {
             $cb = $form->addStatic()->setContent("Imported ({$imported_users})");
         } else {
             $cb = $form->addGroup();
             if ($imported_users) {
                 $cb->addStatic()->setContent("partially imported ({$imported_users} of {$total} total)<br /><br />");
             }
             $cb->addRadio('import', array('value' => 'user'));
             $cb->addStatic()->setContent('<br /><br /># of users (keep empty to import all) ');
             $cb->addInteger('user[count]');
             $cb->addStatic()->setContent('<br />Do not import pending users');
             $cb->addCheckbox('user[exclude_pending]');
             $cb->addStatic()->setContent('<br />Keep the same user IDs');
             $keep_id_chkbox = $cb->addCheckbox('user[keep_user_id]');
             if ($this->getDi()->db->selectCell("SELECT COUNT(*) FROM ?_user")) {
                 $keep_id_chkbox->setAttribute('disabled');
                 $cb->addStatic()->setContent('User database have records already. Please use Clean Up if you want to keep the same user IDs');
             }
         }
         $cb->setLabel('Import User and Payment Records');
         if ($imported_users) {
             if ($this->getDi()->modules->isEnabled('aff')) {
                 $imported_comm = $this->getDi()->db->selectCell("SELECT COUNT(id) FROM ?_data WHERE `table`='aff_commission' AND `key`='am3:id'");
                 $total = $this->db3->selectCell("SELECT COUNT(*) FROM ?_aff_commission");
                 $imported_clicks = $this->getDi()->db->selectCell("SELECT COUNT(id) FROM ?_data WHERE `table`='aff_click' AND `key`='am3:id'");
                 $total_clicks = $this->db3->selectCell("SELECT COUNT(*) FROM ?_aff_clicks");
                 $gr = $form->addGroup()->setLabel('Import Affiliate Commissions and Refs');
                 if ($imported_comm >= $total) {
                     $gr->addStatic()->setContent("Imported ({$imported_comm} of {$total})");
                 } else {
                     if ($imported_comm) {
                         $gr->addStatic()->setContent("partially imported ({$imported_comm} of {$total} total)<br /><br />");
                     }
                     $gr->addRadio('import', array('value' => 'aff'));
                 }
                 $gr = $form->addGroup()->setLabel('Import Affiliate Clicks');
                 if ($imported_clicks >= $total_clicks) {
                     $gr->addStatic()->setContent("Imported ({$imported_clicks} of {$total_clicks})");
                 } else {
                     if ($imported_clicks) {
                         $gr->addStatic()->setContent("partially imported ({$imported_clicks} of {$total_clicks} total)<br /><br />");
                     }
                     $gr->addRadio('import', array('value' => 'affclicks'));
                 }
                 $gr = $form->addGroup()->setLabel('Import Affiliate Banners and Links');
                 $gr->addRadio('import', array('value' => 'affbanners'));
                 $gr->addStatic()->setContent("Workaround to have old links working");
             } else {
                 $form->addStatic()->setContent('Enable [aff] module in Setup/Configuration to import information');
             }
             if ($this->getDi()->modules->isEnabled('newsletter')) {
                 $form->addRadio('import', array('value' => 'newsletter'))->setLabel('Import Newsletter Threads and Subscriptions');
             } else {
                 $form->addStatic()->setContent('Enable [newsletter] module in Setup/Configuration to import information');
             }
         }
     }
     //import PAYPAL_PROFILE_ID for previously wrongly imported invoices
     /*if ($imported_users)
       {
           $total = $this->db3->selectCell("SELECT COUNT(*) FROM ?_folders");
           if ($total){
               $cb = $form->addRadio('import', array('value' => 'paypalprofileid'));
               $cb->setLabel("Import Paypal Profile ID's");
           }
       }*/
     $form->addSaveButton('Run');
     $defaults = array();
     return $form;
 }
開發者ID:alexanderTsig,項目名稱:arabic,代碼行數:101,代碼來源:AdminImport3Controller.php

示例15: run

    function run()
    {
        $form = new Am_Form_Admin('form-grid-merge');
        $form->setAttribute('name', 'merge');
        $user = $this->grid->getRecord();
        $login = $form->addText('login');
        $login->setId('login')->setLabel(___("Username of Source User\nmove information from"));
        $login->addRule('callback', ___('Can not find user with such username'), array($this, 'checkUser'));
        $login->addRule('callback', ___('You can not merge user with itself'), array($this, 'checkIdenticalUser'));
        $target = $form->addStatic()->setContent(sprintf('<div>%s</div>', Am_Controller::escape($user->login)));
        $target->setLabel(___("Target User\nmove information to"));
        $script = <<<CUT
        \$("input#login").autocomplete({
                minLength: 2,
                source: window.rootUrl + "/admin-users/autocomplete"
        });
CUT;
        $form->addStatic('', array('class' => 'no-label'))->setContent('<div class="info"><strong>' . ___("WARNING! Once [Merge] button clicked, all invoices, payments, logs\n" . "and other information regarding 'Source User' will be moved\n" . "to the 'Target User' account. 'Source User' account will be deleted.\n" . "There is no way to undo this operation!") . '</strong></div>');
        $form->addScript('script')->setScript($script);
        foreach ($this->grid->getVariablesList() as $k) {
            $form->addHidden($this->grid->getId() . '_' . $k)->setValue($this->grid->getRequest()->get($k, ""));
        }
        $form->addSaveButton(___("Merge"));
        $form->setDataSources(array($this->grid->getCompleteRequest()));
        if ($form->isSubmitted() && $form->validate()) {
            $values = $form->getValue();
            $this->merge($this->grid->getRecord(), Am_Di::getInstance()->userTable->findFirstByLogin($values['login']));
            $this->grid->redirectBack();
        } else {
            echo $this->renderTitle();
            echo $form;
        }
    }
開發者ID:alexanderTsig,項目名稱:arabic,代碼行數:33,代碼來源:AdminUsersController.php


注:本文中的Am_Form_Admin::addSaveButton方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。