当前位置: 首页>>代码示例>>PHP>>正文


PHP Am_Form_Admin::addRadio方法代码示例

本文整理汇总了PHP中Am_Form_Admin::addRadio方法的典型用法代码示例。如果您正苦于以下问题:PHP Am_Form_Admin::addRadio方法的具体用法?PHP Am_Form_Admin::addRadio怎么用?PHP Am_Form_Admin::addRadio使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Am_Form_Admin的用法示例。


在下文中一共展示了Am_Form_Admin::addRadio方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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

示例2: 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

示例3: 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 ($total_products = $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-import3/clean">', '</a>'));
     }
     $cb = $form->addGroup();
     if ($imported_products >= $total) {
         $cb->addStatic()->setContent("Imported ({$imported_products} of {$total})");
     } else {
         $cb->addRadio('import', array('value' => 'product'));
     }
     $cb->setLabel('Import Products');
     $cb->addStatic()->setContent('<br />Keep the same Product  IDs');
     $keep_id_chkbox = $cb->addCheckbox('product[keep_product_id]');
     if ($imported_products < $total && $this->db3->selectCell("SELECT COUNT(*) FROM ?_products WHERE data like '%subusers_count%'") && !in_array('subusers', $this->getDi()->modules->getEnabled())) {
         $cb->addStatic()->setContent('<br />Enable [subusers] module in Setup/Configuration to import subusers information');
     }
     if ($total_products) {
         $keep_id_chkbox->setAttribute('disabled');
         $cb->addStatic()->setContent('Product table have records already. Please use Clean Up if you want to keep the same product IDs');
     }
     // Import coupons
     $imported_coupons = $this->getDi()->db->selectCell("SELECT COUNT(id) FROM ?_data WHERE `table`='coupon' AND `key`='am3:id'");
     $totalc = $this->db3->selectCell("SELECT COUNT(*) FROM ?_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');
     }
     //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) {
//.........这里部分代码省略.........
开发者ID:alexanderTsig,项目名称:arabic,代码行数:101,代码来源:AdminImport3Controller.php

示例4: 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`='oss6:id'");
     $total = $this->db_oss->selectCell("SELECT COUNT(*) FROM ?_groups");
     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`='oss6:id'");
         $total = $this->db_oss->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,代码行数:32,代码来源:AdminImportOss6Controller.php

示例5: 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

示例6: 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


注:本文中的Am_Form_Admin::addRadio方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。