Example #1
0
 public function index($cmd)
 {
     $path = JPATH_SITE . '/components/com_acctexp/toolbox';
     if (empty($cmd)) {
         $list = array();
         $files = xJUtility::getFileArray($path, 'php', false, true);
         asort($files);
         foreach ($files as $n => $name) {
             $file = $path . '/' . $name;
             include_once $file;
             $class = str_replace('.php', '', $name);
             $tool = new $class();
             if (!method_exists($tool, 'Info')) {
                 continue;
             }
             $info = $tool->Info();
             $info['link'] = AECToolbox::deadsureURL('administrator/index.php?option=com_acctexp&task=index&entity=toolbox&cmd=' . $class);
             $list[] = $info;
         }
         HTML_AcctExp::toolBox('', $list);
     } else {
         $file = $path . '/' . $cmd . '.php';
         include_once $file;
         $tool = new $cmd();
         $info = $tool->Info();
         $return = '';
         if (!method_exists($tool, 'Action')) {
             $return .= '<section class="paper">' . '<p>Tool doesn\'t have an action to carry out!</p>' . '</section>';
         } else {
             $response = '</section><section class="paper"><h4>' . JText::_('Response') . '</h4>' . $tool->Action() . '</section>';
             if (method_exists($tool, 'Settings')) {
                 $tb_settings = $tool->Settings();
                 if (!empty($tb_settings)) {
                     $lists = array();
                     if (isset($tb_settings['lists'])) {
                         $lists = $tb_settings['lists'];
                         unset($tb_settings['lists']);
                     }
                     // Get preset values from POST
                     foreach ($tb_settings as $n => $v) {
                         if (isset($_POST[$n])) {
                             $tb_settings[$n][3] = $_POST[$n];
                         }
                     }
                     $settings = new aecSettings('TOOLBOX', 'E');
                     $settings->fullSettingsArray($tb_settings, array(), $lists);
                     // Call HTML Class
                     $aecHTML = new aecHTML($settings->settings, $settings->lists);
                     foreach ($tb_settings as $n => $v) {
                         $return .= $aecHTML->createSettingsParticle($n);
                     }
                     $return .= '<input type="submit" class="btn btn-primary pull-right"/><br/><br/>';
                 }
             }
             $return .= $response;
         }
         HTML_AcctExp::toolBox($cmd, $return, $info['name']);
     }
 }
Example #2
0
 if (!empty($form)) {
     $pref = 'mi_' . $mi->id . '_';
     $params = array();
     foreach ($form as $k => $v) {
         if (isset($_POST[$k])) {
             $params[str_replace($pref, '', $k)] = $_POST[$k];
         }
     }
     $mi->profile_form_save($metaUser, $params);
     // Reload the user
     $metaUser = new metaUser($metaUser->userid);
     $form = $mi->profile_form($metaUser);
 }
 if (!empty($form)) {
     $hasforms = true;
     $settings = new aecSettings('userForm', 'mi');
     $settings->fullSettingsArray($form, array(), array());
     $aecHTML = new aecHTML($settings->settings, $settings->lists);
     $html = '';
     foreach ($form as $k => $f) {
         $html .= $aecHTML->createSettingsParticle($k);
     }
     $mi_info .= '<div class="' . $mi->class_name . ' mi_' . $mi->id . ' mi-form">' . $html . '</div>';
 }
 $addtabs = $mi->registerProfileTabs();
 if (empty($addtabs)) {
     continue;
 }
 foreach ($addtabs as $atk => $atv) {
     $action = $mi->class_name . '_' . $atk;
     if (isset($subfields[$action])) {
 public function getMIforms($metaUser, $errors = array(), $values = array())
 {
     $params = $this->getMIformParams($metaUser, $errors);
     if (empty($params)) {
         return false;
     }
     if (isset($params['lists'])) {
         $lists = $params['lists'];
         unset($params['lists']);
     } else {
         $lists = array();
     }
     if (isset($params['validation'])) {
         unset($params['validation']);
     }
     if (empty($params)) {
         return null;
     }
     $settings = new aecSettings('mi', 'frontend_forms');
     $settings->fullSettingsArray($params, $values, $lists, array(), false);
     $aecHTML = new aecHTML($settings->settings, $settings->lists);
     return $aecHTML->returnFull(false, true);
 }
Example #4
0
 public function addressExceptions()
 {
     $hasform = false;
     $lists = array();
     $params = array();
     foreach ($this->exceptions as $eid => $ex) {
         // Convert Exception into actionable form
         if (!empty($ex['rows'])) {
             $hasform = true;
         }
         if (isset($ex['rows']['lists'])) {
             $lists = array_merge($lists, $ex['rows']['lists']);
             unset($ex['rows']['lists']);
         }
         foreach ($ex['rows'] as $rid => $row) {
             if ($row[0] == 'radio') {
                 $row[1] = $eid . '_' . $row[1];
             }
             if ($row[0] == 'hidden') {
                 $row[2] = $eid . '_' . $row[2];
             }
             $params[$eid . '_' . $rid] = $row;
         }
     }
     $settings = new aecSettings('exception', 'frontend_exception');
     $settings->fullSettingsArray($params, array(), $lists);
     $aecHTML = new aecHTML($settings->settings, $settings->lists);
     getView('exception', array('InvoiceFactory' => $this, 'aecHTML' => $aecHTML, 'hasform' => $hasform));
 }
 public function getParamsHTML($params)
 {
     $return = null;
     if (!empty($params['params'])) {
         if (is_array($params['params'])) {
             if (isset($params['params']['lists'])) {
                 $lists = $params['params']['lists'];
                 unset($params['params']['lists']);
             } else {
                 $lists = null;
             }
             $hastabs = false;
             foreach ($params['params'] as $entry) {
                 if ($entry[0] == 'tabberstart') {
                     $hastabs = true;
                 }
             }
             if (!$hastabs) {
                 $return .= '<div class="aec-checkout-params">';
             }
             $settings = new aecSettings('aec', 'ccform');
             $settings->fullSettingsArray($params['params'], array(), $lists, array(), false);
             $aecHTML = new aecHTML($settings->settings, $settings->lists);
             $return .= $aecHTML->returnFull(false, true);
             $return .= '</div>';
         }
     }
     return $return;
 }