Exemplo n.º 1
0
/**
 * Implements hook_form_FORM_ID_alter().
 *
 * @param $form
 *   The form.
 * @param $form_state
 *   The form state.
 */
function md_boom_multi_form_system_theme_settings_alter(&$form, &$form_state, $form_id = NULL, $no_js_use = FALSE)
{
    if (isset($form_id)) {
        return;
    }
    $form['md_boom_multi_settings']['html_header'] = array('#markup' => '
<!--<div class="md-links">
<a href="#" target="_blank">Project Page</a> -
<a href="#" target="_blank">Theme Documentation</a> -
<a href="#" target="_blank">Support Forum</a>
</div> -->
<div class="md-wrap">
  <div id="md-tabs">
		<div class="md-tabs-head"><div class="md-tabs-headcontent">
      <ul class="clearfix">
        <li class="tab-item first clearfix" id="tab-general-settings"> <a class="tab-link" href="#md-general-settings">
          <span class="tab-text">General Settings</span>
          </a> </li>
        <li class="tab-item clearfix" id="tab-design"> <a class="tab-link" href="#md-design">
          <span class="tab-text">Design</span>
          </a> </li>
        <li class="tab-item clearfix" id="tab-design"> <a class="tab-link" href="#md-pages">
          <span class="tab-text">Pages</span>
          </a> </li>
        <li class="tab-item clearfix" id="tab-text-typography"> <a class="tab-link" href="#md-text-typography">
          <span class="tab-text">Text/Typography</span>
          </a> </li>
	    <li class="tab-item clearfix" id="tab-display"> <a class="tab-link" href="#md-display">
          <span class="tab-text">Display Settings</span>
          </a> </li>
        <li class="tab-item clearfix" id="tab-custom-code"> <a class="tab-link" href="#md-custom-code">
          <span class="tab-text">Custom code</span>
          </a> </li>
          <li class="tab-item clearfix" id="tab-config"> <a class="tab-link" href="#md-config">
          <span class="tab-text">Bacxup and Restore</span>
          </a>
        </li>
      </ul>
    </div></div><!-- /.md-tabs-head -->', '#weight' => -99);
    md_boom_multi_theme_settings_general($form, $form_state);
    // Load font styles
    $fonts = load_font_configure();
    drupal_add_js(array('font_array' => $fonts[0]), 'setting');
    drupal_add_js(array('font_vars' => $fonts[1]), 'setting');
    // add for fonts END
    md_boom_multi_theme_settings_design($form, $form_state);
    md_boom_multi_theme_settings_text($form, $form_state);
    md_boom_multi_theme_settings_pages($form, $form_state);
    md_boom_multi_theme_settings_display($form, $form_state);
    md_boom_multi_theme_settings_code($form, $form_state);
    md_boom_multi_theme_settings_config($form, $form_state);
    $form['md_boom_multi_settings']['html_footer'] = array('#markup' => '
	</div><!-- /#md-tabs -->
</div><!-- /.md-wrap -->', '#weight' => 99);
    $form['reset'] = array('#type' => 'submit', '#value' => t('Reset Settings'), '#submit' => array('md_boom_multi_reset_settings_submit'), '#weight' => '1000');
    $form['#submit'] = array();
    array_push($form['#submit'], 'md_boom_multi_save_settings');
}
Exemplo n.º 2
0
/**
 * Implements hook_form_FORM_ID_alter().
 *
 * @param $form
 *   The form.
 * @param $form_state
 *   The form state.
 */
function md_leaders_form_system_theme_settings_alter(&$form, &$form_state, $form_id = NULL, $no_js_use = FALSE)
{
    if (isset($form_id)) {
        return;
    }
    // Need to hide default theme settings in system, we create it after
    unset($form['theme_settings']);
    hide($form['logo']);
    hide($form['favicon']);
    // Make default dialog markup for icon
    icon_default_dialog();
    $form['md_leaders_settings']['html_header'] = array('#markup' => '<div id="md-framewp" class="md-framewp">
		<div id="md-framewp-header">
			<!-- /////////////////// ALERT BOX ///////////////// -->
				<div class="md-alert-boxs">

				</div>
		</div><!-- /#md-framewp-header -->
		<div id="md-framewp-body">
			<div id="md-tabs-framewp" class="md-tabs-framewp">
				<ul class="clearfix">
					<li><a href="#md-general">General</a></li>
					<li><a href="#md-design">Design</a></li>
					<li><a href="#md-display">Display</a></li>
					<li><a href="#md-text-typography">Text & Typography</a></li>
					<li><a href="#md-code">Custom Code</a></li>
					<li><a href="#md-config">Backup & Restore</a></li>
				</ul>
			</div><!-- /.md-tabs-framewp -->
			<div class="md-content-framewp">', '#weight' => -99);
    md_leaders_theme_settings_general($form, $form_state);
    md_leaders_theme_settings_design($form, $form_state);
    md_leaders_theme_settings_display($form, $form_state);
    md_leaders_theme_settings_text($form, $form_state);
    md_leaders_theme_settings_code($form, $form_state);
    md_leaders_theme_settings_config($form, $form_state);
    $form['actions']['reset'] = array('#type' => 'submit', '#value' => t('Reset Settings'), '#submit' => array('md_leaders_reset_settings_submit'), '#weight' => 98, '#attributes' => array('class' => array('btn btn-reset'), 'onClick' => 'return confirm("Are you sure want to reset all settings to default ?")'));
    $form['actions']['submit']['#weight'] = 97;
    $form['actions']['submit']['#attributes'] = array('class' => array('btn btn-save'));
    $form['actions']['#prefix'] = '</div><!-- /.md-content-framewp -->
		</div><!-- /#md-framewp-body -->
		<div id="md-framewp-footer" class="md-framewp-footer">
		    <div class="footer-left">
				<div class="md-button-group">';
    $form['actions']['#suffix'] = '</div>
              </div>
              <div class="footer-right">
              </div>
        </div>
    </div><!-- /.md-framewp -->';
    // Load font styles
    $fonts = load_font_configure();
    drupal_add_js(array('font_array' => $fonts[0]), 'setting');
    drupal_add_js(array('font_vars' => $fonts[1]), 'setting');
    // add for fonts END
    $form['#validate'][] = 'md_leaders_validate_theme_settings';
    $form['#submit'][] = 'md_leaders_save_settings_submit';
}