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']);
     }
 }
 /**
  * @param aecHTML $aecHTML
  */
 static function echoSettings($aecHTML)
 {
     $stdvars = array(array(array('mingid_enabled', 'mingid'), array('fixgid_enabled', 'fixgid'), array('maxgid_enabled', 'maxgid')), array(array('previous*_req_enabled', 'previous*_req'), array('previous*_req_enabled_excluded', 'previous*_req_excluded'), array('current*_req_enabled', 'current*_req'), array('current*_req_enabled_excluded', 'current*_req_excluded'), array('overall*_req_enabled', 'overall*_req'), array('overall*_req_enabled_excluded', 'overall*_req_excluded')), array(array('used_*_min_enabled', 'used_*_min_amount', 'used_*_min'), array('used_*_max_enabled', 'used_*_max_amount', 'used_*_max')), array(array('custom_restrictions_enabled', 'custom_restrictions')));
     $types = array('plan', 'group');
     echo '<div class="row">';
     foreach ($types as $type) {
         foreach ($stdvars as $block) {
             // non-* blocks only once
             if (strpos($block[0][0], '*') === false && $type != 'plan') {
                 continue;
             }
             echo '<div class="col-sm-4"><section class="paper">';
             $firstitem = str_replace('*', $type, $block[0][0]);
             echo '<h4>' . JText::_(strtoupper('aec_restrictions_' . substr($firstitem, 0, strpos($firstitem, '_', strpos($firstitem, '_') + 3)) . '_header')) . '</h4>';
             foreach ($block as $sblock) {
                 foreach ($sblock as $vname) {
                     echo $aecHTML->createSettingsParticle(str_replace('*', $type, $vname));
                 }
             }
             echo '</section></div>';
         }
     }
     echo '</div>';
 }
Example #3
0
             $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])) {
         continue;
     }
     $subfields[$action] = $atv;
     if ($action == $sub) {
         $custom = $mi->customProfileTab($atk, $metaUser);
Example #4
0
    /**
     * @param aecService $row
     * @param null|aecHTML $aecHTML
     */
    static function editService($row, $aecHTML)
    {
        HTML_myCommon::startCommon('aec-wrap-maze', 'aec-wrap-inner-light');
        HTML_myCommon::getHeader('AEC_HEAD_SETTINGS', 'services', $row->id ? $row->name : JText::_('AEC_CMN_NEW'), false, 'edit', 'Service');
        HTML_myCommon::startForm();
        ?>
<div class="col-sm-12"><?php 
        $tabs = new bsPaneTabs();
        $tabs->startTabs();
        $tabs->newTab('mi', JText::_('AEC_SERVICE_TITLE'));
        if ($aecHTML->hasSettings) {
            //$tabs->newTab( 'settings', JText::_('AEC_SERVICE_SETTINGS') );
        }
        if (!empty($aecHTML->customparams)) {
            foreach ($aecHTML->customparams as $name) {
                if (strpos($name, 'aectab_') === 0) {
                    $tabs->newTab($name, $aecHTML->rows[$name][1]);
                }
            }
        }
        $tabs->endTabs();
        $tabs->startPanes();
        $tabs->nextPane('mi', true);
        ?>
	<div class="row">
	<div class="col-sm-6">
		<section class="paper">
			<h4><?php 
        echo JText::_('AEC_SERVICE_TITLE_LONG');
        ?>
</h4>
			<?php 
        echo $aecHTML->createSettingsParticle('active');
        ?>
			<?php 
        echo $aecHTML->createSettingsParticle('name');
        ?>
			<?php 
        if (empty($aecHTML->hasSettings)) {
            ?>
				<?php 
            echo $aecHTML->createSettingsParticle('type');
            ?>
			<?php 
        } else {
            ?>
				<div class="form-group">
					<div class="col-sm-4">
						<label for="class_name">Service Type</label>
					</div>
					<div class="col-sm-8">
						<p class="form-control-static">
							<strong><?php 
            echo $row->type;
            ?>
</strong>
						</p>
					</div>
				</div>
			<?php 
        }
        ?>
		</section>
	</div>
	<div class="col-sm-6">
	<section class="paper">
	<?php 
        if ($aecHTML->hasSettings) {
            ?>
	<h4><?php 
            echo JText::_('AEC_SERVICE_SETTINGS');
            ?>
</h4>
		<?php 
            foreach ($aecHTML->customparams as $name) {
                ?>
		<?php 
                if (strpos($name, 'aectab_') === 0) {
                    ?>
	</section></div></div>
	<?php 
                    $tabs->nextPane($name);
                    ?>
	<div class="row">
	<div class="col-sm-8 col-sm-offset-2">
	<section class="paper">
	<h4><?php 
                    echo $aecHTML->rows[$name][1];
                    ?>
</h4>
		<?php 
                } else {
                    echo $aecHTML->createSettingsParticle($name);
                }
                ?>
		<?php 
            }
            ?>
	<?php 
        } else {
            ?>

	<?php 
        }
        ?>
	</section>
	</div>
	</div>
	<?php 
        $tabs->endPanes();
        ?>
	<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" />
	<?php 
        if (!empty($row->type)) {
            ?>
		<input type="hidden" name="type" value="<?php 
            echo $row->type;
            ?>
" />
	<?php 
        }
        ?>
	<input type="hidden" name="option" value="com_acctexp" />
	<input type="hidden" name="task" value="" />
	</form>

		</div>

	<?php 
        echo $aecHTML->loadJS();
        HTML_myCommon::endCommon();
    }