/**
  * Renders a list with all custom links.
  *
  * @return array
  *   The list to be rendered.
  */
 public function render()
 {
     $build['xmlsitemap_add_custom'] = array('#type' => 'link', '#title' => t('Add custom link'), '#href' => 'admin/config/search/xmlsitemap/custom/add');
     $header = array('loc' => array('data' => t('Location'), 'field' => 'loc', 'sort' => 'asc'), 'priority' => array('data' => t('Priority'), 'field' => 'priority'), 'changefreq' => array('data' => t('Change frequency'), 'field' => 'changefreq'), 'language' => array('data' => t('Language'), 'field' => 'language'), 'operations' => array('data' => t('Operations')));
     $rows = array();
     $destination = drupal_get_destination();
     $query = db_select('xmlsitemap');
     $query->fields('xmlsitemap');
     $query->condition('type', 'custom');
     $query->extend('Drupal\\Core\\Database\\Query\\PagerSelectExtender')->limit(50);
     $query->extend('Drupal\\Core\\Database\\Query\\TableSortExtender')->orderByHeader($header);
     $result = $query->execute();
     foreach ($result as $link) {
         $language = $this->languageManager->getLanguage($link->language);
         $row = array();
         $row['loc'] = $this->l($link->loc, Url::fromUri($link->loc));
         $row['priority'] = number_format($link->priority, 1);
         $row['changefreq'] = $link->changefreq ? drupal_ucfirst(xmlsitemap_get_changefreq($link->changefreq)) : t('None');
         if (isset($header['language'])) {
             $row['language'] = t($language->name);
         }
         $operations['edit'] = array('title' => t('Edit'), 'route_name' => 'xmlsitemap_custom.edit', 'route_parameters' => array('link' => $link->id));
         $operations['delete'] = array('title' => t('Delete'), 'route_name' => 'xmlsitemap_custom.delete', 'route_parameters' => array('link' => $link->id));
         $row['operations'] = array('data' => array('#type' => 'operations', '#theme' => 'links', '#links' => $operations, '#attributes' => array('class' => array('links', 'inline'))));
         $rows[] = $row;
     }
     // @todo Convert to tableselect
     $build['xmlsitemap_custom_table'] = array('#type' => 'tableselect', '#theme' => 'table', '#header' => $header, '#rows' => $rows, '#empty' => $this->t('No custom links available. <a href="@custom_link">Add custom link</a>', array('@custom_link' => Url::fromRoute('xmlsitemap_custom.add', [], array('query' => $destination)))));
     $build['xmlsitemap_custom_pager'] = array('#theme' => 'pager');
     return $build;
 }
/**
 * Endpoint authentication configuration form.
 */
function services_edit_form_endpoint_authentication($form_state)
{
    $endpoint = services_endpoint_load(arg(4));
    // Loading runtime include as needed by services_authentication_info().
    module_load_include('runtime.inc', 'services');
    $form = array();
    $auth_modules = module_implements('services_authentication_info');
    $form['endpoint_object'] = array('#type' => 'value', '#value' => $endpoint);
    if (empty($auth_modules)) {
        $form['message'] = array('#type' => 'item', '#title' => t('Authentication'), '#description' => t('No authentication modules are installed, all requests will be anonymous.'));
        return $form;
    }
    if (empty($endpoint->authentication)) {
        $form['message'] = array('#type' => 'item', '#title' => t('Authentication'), '#description' => t('No authentication modules are enabled, all requests will be anonymous.'));
        return $form;
    }
    // Add configuration fieldsets for the authentication modules
    foreach ($endpoint->authentication as $module => $settings) {
        $info = services_authentication_info($module);
        if (empty($info)) {
            continue;
        }
        $form[$module] = array('#type' => 'fieldset', '#title' => isset($info['title']) ? $info['title'] : $module, '#tree' => TRUE);
        $module_settings_form = services_auth_invoke($module, 'security_settings', $settings);
        if (!empty($module_settings_form) && $module_settings_form !== TRUE && $settings == $module || is_array($settings)) {
            $form[$module] += $module_settings_form;
        } else {
            $form[$module]['message'] = array('#type' => 'item', '#value' => t('@module has no settings available.', array('@module' => drupal_ucfirst($module))));
        }
    }
    $form['submit'] = array('#type' => 'submit', '#value' => 'Save');
    return $form;
}
/**
 * Alter status links.
 *
 * @param $links
 *   A structured array as returned by implementations of hook_link().
 * @param $status
 *   A status object.
 * @see _facebook_status_show()
 */
function hook_facebook_status_link_alter(&$links, $status)
{
    //Capitalize the first letter of every link.
    foreach ($links as $type => $data) {
        $links[$type]['title'] = drupal_ucfirst($links[$type]['title']);
    }
}
Example #4
0
 /**
  * Attempts to enable a module with a missing dependency.
  */
 function testMissingModules()
 {
     // Test that the system_dependencies_test module is marked
     // as missing a dependency.
     $this->drupalGet('admin/modules');
     $this->assertRaw(t('@module (<span class="admin-missing">missing</span>)', array('@module' => drupal_ucfirst('_missing_dependency'))), 'A module with missing dependencies is marked as such.');
     $checkbox = $this->xpath('//input[@type="checkbox" and @disabled="disabled" and @name="modules[Testing][system_dependencies_test][enable]"]');
     $this->assert(count($checkbox) == 1, 'Checkbox for the module is disabled.');
 }
Example #5
0
 /**
  * Block instance retrieval method.
  *
  * @param string $delta
  *   The block delta.
  *
  * @return Drupal\zeitgeist\Block
  *   A Block (or child class) instance.
  */
 public static final function instance($delta)
 {
     if (empty(self::$instances[$delta])) {
         $class = 'Drupal\\zeitgeist\\Block' . drupal_ucfirst($delta);
         $ret = new $class($delta);
         self::$instances[$delta] = $ret;
     } else {
         $ret = self::$instances[$delta];
     }
     return $ret;
 }
 /**
  * Test Breakpoint::buildConfigName().
  */
 public function testConfigName()
 {
     // Try an invalid sourceType.
     $label = $this->randomMachineName();
     $breakpoint = entity_create('breakpoint', array('label' => $label, 'name' => Unicode::strtolower($label), 'source' => 'custom_module', 'sourceType' => 'oops'));
     $exception = FALSE;
     try {
         $breakpoint->save();
     } catch (InvalidBreakpointSourceTypeException $e) {
         $exception = TRUE;
     }
     $this->assertTrue($exception, 'breakpoint_config_name: An exception is thrown when an invalid sourceType is entered.');
     // Try an invalid source.
     $breakpoint = $breakpoint->createDuplicate();
     $breakpoint->sourceType = Breakpoint::SOURCE_TYPE_USER_DEFINED;
     $breakpoint->source = 'custom*_module source';
     $exception = FALSE;
     try {
         $breakpoint->save();
     } catch (InvalidBreakpointSourceException $e) {
         $exception = TRUE;
     }
     $this->assertTrue($exception, 'breakpoint_config_name: An exception is thrown when an invalid source is entered.');
     // Try an invalid name (make sure there is at least once capital letter).
     $breakpoint = $breakpoint->createDuplicate();
     $breakpoint->source = 'custom_module';
     $breakpoint->name = drupal_ucfirst($this->randomMachineName());
     $exception = FALSE;
     try {
         $breakpoint->save();
     } catch (InvalidBreakpointNameException $e) {
         $exception = TRUE;
     }
     $this->assertTrue($exception, 'breakpoint_config_name: An exception is thrown when an invalid name is entered.');
     // Try a valid breakpoint.
     $breakpoint = $breakpoint->createDuplicate();
     $breakpoint->name = drupal_strtolower($this->randomMachineName());
     $breakpoint->mediaQuery = 'all';
     $exception = FALSE;
     try {
         $breakpoint->save();
     } catch (\Exception $e) {
         $exception = TRUE;
     }
     $this->assertFalse($exception, 'breakpoint_config_name: No exception is thrown when a valid breakpoint is passed.');
     $this->assertEqual($breakpoint->id(), Breakpoint::SOURCE_TYPE_USER_DEFINED . '.custom_module.' . $breakpoint->name, 'breakpoint_config_name: A id is set when a valid breakpoint is passed.');
 }
/**
 * Shows listing of asset metadata.
 *
 * The theme used to generate a listing of metadata in the views using
 * mediamosa_ck_views_field_text_metadata. Slightly modified from the original:
 * no showing of empty rows.
 *
 * @param array $variables
 *   Data used for the theme.
 */
function sitebuilder_uva_mediamosa_ck_views_theme_asset_metadata($variables)
{
    $rows = array();
    ksort($variables['metadata']);
    foreach ($variables['metadata'] as $name => $value) {
        $name = drupal_ucfirst(str_replace('_', ' ', $name));
        if (empty($value)) {
            $rows[] = array('class' => array('empty'), 'data' => array('name' => $name, 'value' => ''));
        } else {
            $rows[] = array('data' => array('name' => $name, 'value' => nl2br(check_plain($value))));
        }
    }
    if (empty($rows)) {
        $rows[] = array('-', '');
    }
    return theme('table', array('rows' => $rows));
}
/**
 * Override theme_breadcrumb().
 */
function maxhealthcare_breadcrumb($breadcrumb)
{
    $links = array();
    $path = '';
    // Get URL arguments
    $arguments = explode('/', request_uri());
    // Remove empty values
    foreach ($arguments as $key => $value) {
        if (empty($value)) {
            unset($arguments[$key]);
        }
    }
    $arguments = array_values($arguments);
    // Add 'Home' link
    $links[] = l(t('Home'), '<front>');
    // Add other links
    if (!empty($arguments)) {
        foreach ($arguments as $key => $value) {
            // Don't make last breadcrumb a link
            if ($key == count($arguments) - 1) {
                $links[] = drupal_get_title();
            } else {
                if (!empty($path)) {
                    $path .= '/' . $value;
                } else {
                    $path .= $value;
                }
                $links[] = l(drupal_ucfirst($value), $path);
            }
        }
    }
    // Set custom breadcrumbs
    drupal_set_breadcrumb($links);
    // Get custom breadcrumbs
    $breadcrumb = drupal_get_breadcrumb();
    // Hide breadcrumbs if only 'Home' exists
    if (count($breadcrumb) > 1) {
        return '<div class="breadcrumb">' . implode(' &raquo; ', $breadcrumb) . '</div>';
    }
}
/**
 * Endpoint authentication configuration form.
 */
function services_edit_form_endpoint_authentication($form, &$form_state)
{
    list($endpoint) = $form_state['build_info']['args'];
    // Loading runtime include as needed by services_authentication_info().
    module_load_include('inc', 'services', 'includes/services.runtime');
    $auth_modules = module_implements('services_authentication_info');
    $form['endpoint_object'] = array('#type' => 'value', '#value' => $endpoint);
    if (empty($auth_modules)) {
        $form['message'] = array('#type' => 'item', '#title' => t('Authentication'), '#description' => t('No authentication modules are installed, all requests will be anonymous.'));
        return $form;
    }
    if (empty($endpoint->authentication)) {
        $form['message'] = array('#type' => 'item', '#title' => t('Authentication'), '#description' => t('No authentication modules are enabled, all requests will be anonymous.'));
        return $form;
    }
    // Add configuration fieldsets for the authentication modules
    foreach ($endpoint->authentication as $module => $settings) {
        $info = services_authentication_info($module);
        if (empty($info)) {
            continue;
        }
        $form[$module] = array('#type' => 'fieldset', '#title' => isset($info['title']) ? $info['title'] : $module, '#tree' => TRUE);
        // Append the default settings for the authentication module.
        $default_security_settings = services_auth_invoke($module, 'default_security_settings');
        if ($settings == $module && is_array($default_security_settings)) {
            $settings = $default_security_settings;
        }
        // Ask the authentication module for a settings form.
        $module_settings_form = services_auth_invoke($module, 'security_settings', $settings, $form_state);
        if (is_array($module_settings_form)) {
            $form[$module] += $module_settings_form;
        } else {
            $form[$module]['message'] = array('#type' => 'item', '#markup' => t('@module has no settings available.', array('@module' => drupal_ucfirst($module))));
        }
    }
    $form['submit'] = array('#type' => 'submit', '#value' => 'Save');
    return $form;
}
Example #10
0
 /**
  * Create an object instance for an export.
  *
  * @param string $object_type
  *   The object type to look up. See openlayers_object_types() for a list of
  *   available object types.
  * @param array|string|object $export
  *   The exported object.
  *
  * @return ObjectInterface|Error
  *   Returns the instance of the requested object or an instance of
  *   Error on error.
  */
 public static function load($object_type = NULL, $export)
 {
     /** @var \Drupal\openlayers\Types\ObjectInterface $object */
     $object = NULL;
     $configuration = array();
     $object_type = drupal_ucfirst(drupal_strtolower(check_plain($object_type)));
     if (is_array($export)) {
         $configuration = $export;
     }
     if (is_object($export) && $export instanceof \StdClass) {
         $array_object = new \ArrayObject($export);
         $configuration = $array_object->getArrayCopy();
     }
     if (is_object($export) && $export instanceof ObjectInterface) {
         return $export;
     }
     if (is_string($export)) {
         $configuration = (array) Openlayers::loadExportable($object_type, $export);
     }
     if (is_array($configuration) && isset($configuration['factory_service'])) {
         // Bail out if the base service can't be found - likely due a registry
         // rebuild.
         if (!\Drupal::hasService('openlayers.Types')) {
             return NULL;
         }
         list($plugin_manager_id, $plugin_id) = explode(':', $configuration['factory_service'], 2);
         if (\Drupal::hasService($plugin_manager_id)) {
             $plugin_manager = \Drupal::service($plugin_manager_id);
             if ($plugin_manager->hasDefinition($plugin_id)) {
                 $object = $plugin_manager->createInstance($plugin_id, $configuration);
             } else {
                 $configuration += array('type' => $object_type, 'errorMessage' => 'Unable to load @type @machine_name');
                 $object = \Drupal::service('openlayers.Types')->createInstance('Error', $configuration);
             }
         } else {
             $configuration += array('type' => $object_type, 'errorMessage' => 'Service <em>@service</em> doesn\'t exists, unable to load @type @machine_name');
             $object = \Drupal::service('openlayers.Types')->createInstance('Error', $configuration);
         }
     } else {
         $configuration += array('type' => $object_type, 'name' => 'Error', 'description' => 'Error', 'factory_service' => '', 'machine_name' => $export, 'errorMessage' => 'Unable to load CTools exportable @type @machine_name.');
         $object = \Drupal::service('openlayers.Types')->createInstance('Error', $configuration);
     }
     if (isset($configuration['disabled']) && (bool) $configuration['disabled'] == 1) {
         $object->disabled = 1;
     }
     return $object->init();
 }
Example #11
0
<div class="<?php print $classes .' '. $zebra; ?> clearfix">
  <div class="comment-inner">

    <?php print $picture; ?>

    <div class="submitted">
      <?php print $submitted; ?>
    </div>

    <?php if ($title): ?>
      <h3 class="title"><?php print $title ?></h3>
    <?php endif; ?>

    <?php if ($new) : ?>
      <span class="new"><?php print drupal_ucfirst($new); ?></span>
    <?php endif; ?>

    <div class="content">
      <?php print $content ?>
      <?php if ($signature): ?>
        <div class="user-signature clearfix">
          <?php print $signature; ?>
        </div>
      <?php endif; ?>
    </div>

    <?php if ($links): ?>
      <div class="links">
        <?php print $links; ?>
      </div>
    <?php endif; ?>  
Example #12
0
?>
 clearfix"<?php 
print $attributes;
?>
>
  <div class="content clearfix">
    <?php 
if ($picture) {
    echo $picture;
}
?>
    <?php 
if ($comment->new) {
    ?>
      <span class="new"><?php 
    echo drupal_ucfirst($new);
    ?>
</span>
    <?php 
}
?>
    <?php 
echo render($title_prefix);
?>
    <?php 
if ($title) {
    ?>
<h3<?php 
    echo $title_attributes;
    ?>
><?php 
    function print_comment($vars)
    {
        foreach (array_keys($vars) as $name) {
            ${$name} =& $vars[$name];
        }
        ?>
<div class="comment<?php 
        print $comment->new ? ' comment-new' : '';
        print ' ' . $status;
        print ' ' . $zebra;
        ?>
">

  <div class="clear-block">
  <?php 
        if ($submitted) {
            ?>
    <span class="submitted"><?php 
            print $submitted;
            ?>
</span>
  <?php 
        }
        ?>

  <?php 
        if ($comment->new) {
            ?>
    <span class="new"><?php 
            print drupal_ucfirst($new);
            ?>
</span>
  <?php 
        }
        ?>

  <?php 
        print $picture;
        ?>

    <h3><?php 
        print $title;
        ?>
</h3>

    <div class="content">
      <?php 
        print $content;
        ?>
      <?php 
        if ($signature) {
            ?>
      <div class="clear-block">
        <div>-</div>
        <?php 
            print $signature;
            ?>
      </div>
      <?php 
        }
        ?>
    </div>
  </div>

  <?php 
        if ($links) {
            ?>
    <div class="links"><?php 
            print $links;
            ?>
</div>
  <?php 
        }
        ?>
</div>
<?php 
    }
Example #14
0
/**
 * Return a themed breadcrumb trail.
 *
 * @param $breadcrumb
 *   An array containing the breadcrumb links.
 * @return a string containing the breadcrumb output.
 * alters breadcrumb 
 */
function phptemplate_breadcrumb($breadcrumb) { 
	global $base_url;
	global $theme_path;
	 
	$links = array();
	$path = '';
	// Get URL arguments
	$arguments = explode('/', request_uri());
	
	// Remove empty values
	foreach ($arguments as $key => $value) {
		if (empty($value)) {
			unset($arguments[$key]);
		}
	}
	$q = $_GET['q'];
	$scount = substr_count($q, 'library/quran/surah/english');
	$scount2 =  substr_count($q, 'library/quran/surah/introduction');
	$scount3 =  substr_count($q, 'library/hadith');
	$scount4 =  substr_count($q, 'library/quran/duas');
	
	$arguments = array_values($arguments);
	$acount = count($arguments);
	
	$breadcrumb = drupal_get_breadcrumb(); // Get current breadcrumb
	
	$new = 0;
	if($scount > 0  ){
				
		switch ($arguments[$acount-1]) {
			case "ASD":
			$t = 'Asad Translation';
			$new = 2;
			break;
			case "MAL":
			$t = 'Malik Translation';$new = 2;
			break;
			case "PIK":
			$t = 'Pickthall Translation';$new = 2;		
			break;
			case "YAT":
			$t = 'Yusuf Ali Translation';$new = 2;		
			break;
			case "TLT":
			$t = 'Transliteration';$new = 3;		
			break;
		}
		if($new ==  1) {
			$count = count($breadcrumb);
			unset($breadcrumb[$count-1]);
			//$path =  $_GET['q'];
			
			$links[] = l(drupal_ucfirst($t), $q);
			$breadcrumb[$count] = l(drupal_ucfirst($t), $q);
		}
		
			if($new ==  2) {
			$count = count($breadcrumb);
			//unset($breadcrumb[$count-1]);
			//$path =  $_GET['q'];
			$links[] = l("Al-Qur'an Translations", $q);
			$links[] = l(drupal_ucfirst($t), $q);
			$breadcrumb[$count] = l(drupal_ucfirst($t), $q);
		}
		
			if($new ==  3) {
			$count = count($breadcrumb);
			//unset($breadcrumb[$count-1]);
			//$path =  $_GET['q'];
			$links[] = l("Al-Qur'an (Arabic)", $q);
			$links[] = l(drupal_ucfirst($t), $q);
			$breadcrumb[$count] = l(drupal_ucfirst($t), $q);
		}
	}
	if($scount2 > 0  ){				
		switch ($arguments[$acount-1]) {
			case "MAL":
			$t = 'Malik Surah Introductions';$new = 1;
			break;
			case "QSI":
			$t = 'Maududi Surah Introductions';$new = 1;		
			break;			
		}
		if($new ==  1) {
			$count = count($breadcrumb);
			//unset($breadcrumb[$count-1]);
			//$path =  $_GET['q'];
			$links[] = l(drupal_ucfirst($t), $q);
			$breadcrumb[$count] = l(drupal_ucfirst($t), $q);
		}
	}
	
$val = arg(2);
	
	if($scount3 > 0  ){
	
	   switch ($val) {
			case "SAD":
			$t = 'Abu-Dawood';$new = 1;
	    	break;
			case "SHB":
			$t = 'Sahih Al-Bukhari';$new = 1;
	    	break;
			case "AMH":
			$t = 'Al-Muwatta';$new = 1;
	    	break;
			case "HDQ":
			$t = 'Al-Qudsi';$new = 1;
	    	break;
			case "TIR":
			$t = 'Al-Tirmidhi';$new = 1;
	    	break;
			case "SHM":
			$t = 'Sahih Muslim';$new = 1;
	    	break;
			case "narrator":
			$t = 'Narrator';$new = 2;
	    	break;
			case "narrators":
			$t = 'Hadith Narrator Index';$new = 1;
	    	break;
			/*case "classification":
			$t = 'Classification';$new = 2;
	    	break;*/
			case "classifications":
			$t = 'Hadith Subject Index';$new = 2;
	    	break;
			case "subject":
			$t = 'Hadith Subject Index';$new = 3;
	    	break;
			case "fiq":
			$t = 'Fiqh-us-Sunnah';$new = 2;
	    	break;
			
		}
			
			if($new ==  1) {
			$count = count($breadcrumb);
			unset($breadcrumb[$count-1]);
			//$path =  $_GET['q'];
			$links[] = l(drupal_ucfirst($t), $q);
			$breadcrumb[$count] = l(drupal_ucfirst($t), $q);
		}
		
				if($new ==  3) {
			$count = count($breadcrumb);
			unset($breadcrumb[$count-1]);
			unset($breadcrumb[$count-2]);
			//$path =  $_GET['q'];
			//$links[] = l(drupal_ucfirst($t), $q);
			//$breadcrumb[$count] = l(drupal_ucfirst($t), $q);
		}
		
			if($new ==  2) {
			$count = count($breadcrumb);
			unset($breadcrumb[$count]);
			unset($breadcrumb[$count-1]);
			unset($breadcrumb[$count-2]);
		
			//$path =  $_GET['q'];
			$links[] = l(drupal_ucfirst($t), $q);
			$breadcrumb[$count] = l(drupal_ucfirst($t), $q);
		}
		
		
		
			
	}

	if($scount4 > 0  ){
	
	
				
				switch ($val) {
					case "duas":
					$t = 'Duas from the Al-Qur\'an';$new = 2;
					break;
					}
			
					
							if($new ==  2) {
					$count = count($breadcrumb);
					unset($breadcrumb[$count]);
					unset($breadcrumb[$count-1]);
								
					//$path =  $_GET['q'];
					$links[] = l(drupal_ucfirst($t), $q);
					$breadcrumb[$count] = l(drupal_ucfirst($t), $q);
				}
				
						
					
			}
	
	
	
	$count1 = count($breadcrumb);
	//print_r($breadcrumb);
	
	 
	if (drupal_get_title()) {
		$page_title = html_entity_decode(drupal_get_title());
		if($new ==  1){
			$lastcrumb = $breadcrumb[$count1];
		}
		else
			$lastcrumb = $breadcrumb[$count1-1];
		//print_r($lastcrumb);
		$lasttit = html_entity_decode(strip_tags($lastcrumb));
		//print $count1.'mmmmmm'.$lasttit;
		if(drupal_get_title() != $lasttit ){
		//print 'mmmmmmmmm'.drupal_get_title();
			//$path1 =  $_GET['q'];
			$t = html_entity_decode(strip_tags(drupal_get_title()));
			//print $t;
			//$currcrumb = l(drupal_ucfirst($t), $q);
			//$currcrumb = "<a href='".$q."'>".drupal_ucfirst($t)."</a>";
			$currcrumb =  l(drupal_ucfirst($t),$q); //"<a href='".$q."'>".drupal_ucfirst($t)."</a>";
			//print $currcrumb;
			if($new ==  1)
				$breadcrumb[$count1+1] = $currcrumb;
			else
				$breadcrumb[$count1] = $currcrumb;
			
		}
	}
	//print_r($breadcrumb);
	
	 if(drupal_is_front_page()){
	 		unset($breadcrumb);
		 $breadcrumb[] =  l(t('Home'), '<front>') ;
		$breadcrumb[] =  l(t('Qur\'an & Hadith'), '<front>') ;
		$breadcrumb[] =  l(t('Qur\'an'), '<front>') ;
		$breadcrumb[] =  l(t('Arabic Qur\'an verse by verse'), $q) ;
		$breadcrumb[] =  $currcrumb ;

	 }
	 
	 if(arg(1)=='scholarpage')
	 {
	 	   unset($breadcrumb);
		  $breadcrumb[] =  l(t('Home'), '<front>') ;
		  $breadcrumb[] =  l(t('Our Advisers and Scholars'), 'alim/scholars') ;
		  $breadcrumb[] =  l(t('Advisers and Scholars Details'), $q) ;
	
	 }
	 	
	 if(arg(2)=='our-advisers-and-scholars') 
	 {
	 	  unset($breadcrumb);
		  $breadcrumb[] =  l(t('Home'), '<front>') ;
		  $breadcrumb[] =  l(t('Our Advisers and Scholars'), 'alim/scholars') ;
		  $breadcrumb[] =  l(t('Submit Advisers and Scholars'), $q) ;
	 }
	 
	 // User Profile , Checking the argument and set breadcrumb array directly
	 
	   if(arg(2)=='creat-group')
	 {
	    unset($breadcrumb);
		$breadcrumb[] =  l(t('Home'), '<front>') ;
		$breadcrumb[] =  l(t('Profile'), 'userprofile') ;
		$breadcrumb[] =  l(t('Create Group'), 'node/add/creat-group') ;
     			
	 }
	 if(arg(0)=='node' && arg(2)=='edit')
	 {
	    unset($breadcrumb);
		$breadcrumb[] =  l(t('Home'), '<front>') ;
		$breadcrumb[] =  l(t('Profile'), 'userprofile') ;
		$breadcrumb[] =  l(t('Edit Group'), $q) ;
     			
	 }
	  if(arg(0)=='node' && arg(2)=='delete')
	 {
	 	unset($breadcrumb);
		$breadcrumb[] =  l(t('Home'), '<front>') ;
		$breadcrumb[] =  l(t('Profile'), 'userprofile') ;
		$breadcrumb[] =  l(t('Delete Group'), $q) ;
	 }
	 
	  if(arg(2)=='group-post')
	 {
	    unset($breadcrumb);
		$breadcrumb[] =  l(t('Home'), '<front>') ;
		$breadcrumb[] =  l(t('Profile'), 'userprofile') ;
		$breadcrumb[] =  l(t('Create Group Post'), 'node/add/group-post') ;
     			
	 }
	 
	 if(arg(0)=='groupdetails')
	 {
	 
	    unset($breadcrumb);
		$breadcrumb[] =  l(t('Home'), '<front>') ;
		$breadcrumb[] =  l(t('Profile'), 'userprofile') ;
		$breadcrumb[] =  l(t('Group'), 'groupdetails/'.arg(1)) ;
	 }
	 
	 
	  if(arg(1)=='163738')
	 {
	 	unset($breadcrumb);
		$breadcrumb[] =  l(t('Home'), '<front>') ;
		$breadcrumb[] =  l(t('Profile'), 'userprofile') ;
		$breadcrumb[] =  l(t('Manage Groups'), 'groups/manage') ;
	 }
	 
	  if(arg(0)=='groups' && arg(1)=='users')
	 {
	 	unset($breadcrumb);
		$breadcrumb[] =  l(t('Home'), '<front>') ;
		$breadcrumb[] =  l(t('Profile'), 'userprofile') ;
		$breadcrumb[] =  l(t('Manage Groups'), 'groups/manage') ;
		$breadcrumb[] =  l(t('Group Members'), 'groups/users/'.arg(2)) ;
	 }
	 
	 if(arg(0)=='searchusers')
	 {
	 	unset($breadcrumb);
		$breadcrumb[] =  l(t('Home'), '<front>') ;
		$breadcrumb[] =  l(t('Profile'), 'userprofile') ;
		$breadcrumb[] =  l(t('Search Users'), 'searchusers') ;
	 }
	 
	 if(arg(0)=='searchgroups')
	 {
	 	unset($breadcrumb);
		$breadcrumb[] =  l(t('Home'), '<front>') ;
		$breadcrumb[] =  l(t('Profile'), 'userprofile') ;
		$breadcrumb[] =  l(t('Search Groups'), 'searchgroups') ;
	 }
	 
	 if(arg(0)=='relationships')
	 {
	 	unset($breadcrumb);
		$breadcrumb[] =  l(t('Home'), '<front>') ;
		$breadcrumb[] =  l(t('Profile'), 'userprofile') ;
		$breadcrumb[] =  l(t('My Relationships'), 'relationships/requests') ;
	 }
	 
	 if(arg(1)=='create_admin')
	 {
	 	unset($breadcrumb);
		$breadcrumb[] =  l(t('Home'), '<front>') ;
		$breadcrumb[] =  l(t('Profile'), 'userprofile') ;
		$breadcrumb[] =  l(t('Manage Groups'), 'groups/manage') ;
		$breadcrumb[] =  l(t('Group Members'), 'groups/users/'.arg(2)) ;
		$breadcrumb[] =  l(t('Confirm Admin'),$q) ;
	 }
	 if(arg(1)=='subscribe')
	 {
	  unset($breadcrumb);
	  $breadcrumb[] =  l(t('Home'), '<front>') ;
	  $breadcrumb[] =  l(t('Profile'), 'userprofile') ;
	  $breadcrumb[] =  l(t('Join Group'),$q) ;
	 }
	 if(arg(1)=='unsubscribe')
	 {
	    unset($breadcrumb);
	  $breadcrumb[] =  l(t('Home'), '<front>') ;
	  $breadcrumb[] =  l(t('Profile'), 'userprofile') ;
	  $breadcrumb[] =  l(t('Leave Group'),$q) ;
	 }
	  if(arg(1)=='delete_admin')
	 {
	 	   unset($breadcrumb);
		  $breadcrumb[] =  l(t('Home'), '<front>') ;
		  $breadcrumb[] =  l(t('Profile'), 'userprofile') ;
		  $breadcrumb[] =  l(t('Remove Admin'),$q) ;
	 }
	 
	 if(arg(0)=='users')
	 {
	 	   unset($breadcrumb);
		  $breadcrumb[] =  l(t('Home'), '<front>') ;
		  $breadcrumb[] =  l(t('Profile'), $q) ;
	
	 }
	 
	 if(arg(0)=='user' && arg(2)=='edit')
	 {
	 	   unset($breadcrumb);
		  $breadcrumb[] =  l(t('Home'), '<front>') ;
		  $breadcrumb[] =  l(t('Edit Profile'), 'user/'.arg(1).'/edit') ;
	
	 }
    if(arg(2)=='dictionary')
	{
		unset($breadcrumb);
		$breadcrumb[] =  l(t('Home'), '<front>') ;
		$breadcrumb[] =  l(t('Qur\'an & Hadith'), 'library/quran/surah/arabic/1/ARB') ;
		$breadcrumb[] =  l(t('References'), 'library/references/dictionary/a') ;
		$breadcrumb[] =  l(t('Islamic Terms Dictionary'), $q) ;
	
	}
	if(arg(1)=='163997')
	{
		unset($breadcrumb);
		$breadcrumb[] =  l(t('Home'), '<front>') ;
		$breadcrumb[] =  l(t('Qur\'an & Hadith'), 'library/quran/surah/arabic/1/ARB') ;
		$breadcrumb[] =  l(t('References'), 'library/references/dictionary/a') ;
		$breadcrumb[] =  l(t('Alim Content Sources'), $q) ;
	
	}
	
   if(arg(2)=='AlQuran-tafsir')
	{
		unset($breadcrumb);
		$breadcrumb[] =  l(t('Home'), '<front>') ;
		$breadcrumb[] =  l(t('Qur\'an & Hadith'), 'library/quran/surah/arabic/1/ARB') ;
		$breadcrumb[] =  l(t('AlQuran-tafsir'),'library/quran/AlQuran-tafsir/ASB/14/1') ;
		$breadcrumb[] =  l(t('Surah '.arg(4) . ' , Ayah '.arg(5)), $q) ;

	}
	if(arg(1)=='clippings')
	{
	unset($breadcrumb);
	global $user;
	$breadcrumb[] =  l(t('Home'), '<front>') ;
	$breadcrumb[] =  l(t($user->name), 'user/clippings') ;
	$breadcrumb[] =  l(t('Notebook'), 'user/clippings') ;
	}
    
	$preAlias = $_SERVER['REQUEST_URI'];
    $alias = explode("/",$preAlias);
	
	if($alias[1]=='blog')
	{
	 	unset($breadcrumb);
		$breadcrumb[] =  l(t('Home'), '<front>') ;
	    $breadcrumb[] =  l(t('Blogs'), 'blogs') ;
	    $breadcrumb[] =  l(t(drupal_get_title()), 'blog/'.$alias[2]) ;
	}

	
	if(arg(0)=='recent-group-posts')
	{
		unset($breadcrumb);
		$breadcrumb[] =  l(t('Home'), '<front>') ;
		$breadcrumb[] =  l(t('Recent Group Posts'), 'recent-group-posts') ;
	}
		if(arg(0) == 'bookmarks') {
		
		unset($breadcrumb);
		$breadcrumb[] =  l(t('Home'), '<front>') ;
	    $breadcrumb[] =  l(t('Bookmarks'), 'bookmarks/mine') ;
		
		}
	
   	 if(arg(0)=='relationships')
	{
	alim_removetab('All',  $vars);
	}
	
	// Alter the breadcrumb values.
	
	if (!empty($breadcrumb)) {
		$c = count($breadcrumb);$i=0;
		$imageurl = "<span class='seperator'>&nbsp;</span>";
		$b = '<div class="breadcrumb"><ul>';
		foreach($breadcrumb as $single){
			if($i == 0)
				$b.="<li class='first' >".html_entity_decode($single)."</li>";
			else
				$b.="<li>".$imageurl.html_entity_decode($single)."</li>";
			$i++;
		}
		$b.='</ul></div>';
		return $b;
		//return '<div class="breadcrumb">'. implode( $imageurl , $breadcrumb) .'</div>';
	}
}
Example #15
0
/**
 * Overrides theme_status_messages().
 * Shows the message headers instead of hiding them.
 */
function sky_status_messages($variables)
{
    $display = $variables['display'];
    $output = '';
    foreach (drupal_get_messages($display) as $type => $messages) {
        $output .= "<div class=\"messages {$type}\">\n";
        $output .= '<h2 class="message-title">' . t(drupal_ucfirst($type)) . "</h2>\n";
        $output .= '<div class="content">';
        if (count($messages) > 1) {
            $output .= "<ul>\n";
            foreach ($messages as $message) {
                $output .= '  <li>' . $message . "</li>\n";
            }
            $output .= " </ul>\n";
        } else {
            $output .= $messages[0];
        }
        $output .= "</div>\n";
        $output .= "</div>\n";
    }
    return $output;
}
 if (!empty($search_params)) {
     ?>
     <div class="tooltip tooltip-parameters">
       <div class="tooltip-inner">
         <span class="pointer"></span>
         <div class="tooltip-title">
           <?php 
     print 'Search parameters';
     ?>
         </div>
         <?php 
     foreach ($search_params as $field => $value) {
         ?>
         <div class="title inner-el">
           <?php 
         print t(drupal_ucfirst($field)) . ' : ';
         ?>
         </div>
         <div class="descrip inner-el">
           <?php 
         print check_plain($value);
         ?>
         </div>
         <?php 
     }
     ?>
       </div>
     </div>
     <?php 
 }
 ?>
Example #17
0
?>
</strong><br>
    <small><?php 
print $date;
?>
</small>
  </div>
  
  <div class="col-sm-9 col-md-10">
    <h3>
      <?php 
print $title;
?>
      <?php 
if ($comment->new) {
    print ' <span class="label label-default">' . drupal_ucfirst($new) . '</span>';
}
?>
    </h3>
    <div class="content">
    <?php 
print $content;
?>
    <?php 
if ($signature) {
    ?>
      <div class="clear-block">
        <div>—</div>
        <?php 
    print $signature;
    ?>
Example #18
0
 /**
  * Retrieve the singleton report instance.
  *
  * @param int $days
  *   The number of days for this report. 0 means use configured setting. Only
  *   used when building the instance initially.
  *
  * @return Drupal\zeitgeist\Report
  *   A Report (or child class) instance.
  */
 public static final function instance($days = 0)
 {
     if (empty(self::$instance)) {
         $class = 'Drupal\\zeitgeist\\Report' . drupal_ucfirst(self::getActiveReport());
         self::$instance = new $class($days);
     }
     return self::$instance;
 }
<hr />
<div class="htmlmail-debug">
  <dl><dt><p>
    To customize this message:
  </p></dt><dd><ol><li><p><?php 
    if (empty($theme)) {
        ?>
    Visit <u>admin/config/system/htmlmail</u>
    and select a theme to hold your custom email template files.
  </p></li><li><p><?php 
    } elseif (empty($theme_path)) {
        ?>
    Visit <u>admin/appearance</u>
    to enable your selected
    <u><?php 
        echo drupal_ucfirst($theme);
        ?>
</u> theme.
  </p></li><li><?php 
    }
    if ("{$template_path}/{$template_name}" == "{$theme_path}/{$message_template}") {
        ?>
<p>
    Edit your<br />
    <code><?php 
        echo "{$template_path}/{$template_name}";
        ?>
</code>
    <br />file.
  </p></li><li><?php 
    } else {
/**
 * @file
 * Implements hook_form_system_theme_settings_alter().
 *
 * Custom theme settings
 */
function mayo_form_system_theme_settings_alter(&$form, &$form_state)
{
    global $base_url;
    drupal_add_js(drupal_get_path('theme', 'mayo') . '/js/mayo.js');
    // Get our plugin system functions.
    require_once drupal_get_path('theme', 'mayo') . '/inc/plugins.inc';
    // We need some getters.
    require_once drupal_get_path('theme', 'mayo') . '/inc/get.inc';
    // General "alters" use a form id. Settings should not be set here. The only
    // thing useful about this is if you need to alter the form for the running
    // theme and *not* the theme setting.
    // @see http://drupal.org/node/943212
    if (isset($form_id)) {
        return;
    }
    // Get an array of device groups with option values
    $device_group_options = page_layouts_device_group_options('mayo');
    // Unit options
    $unit_options = array('%' => '%', 'px' => 'px', 'em' => 'em');
    // Assign $options for each device group
    foreach ($device_group_options as $device_group => $options) {
        // About here we need to call a custom sort function, this is what we got for now
        sort($options, SORT_STRING);
        foreach ($options as $option) {
            if ($device_group === 'bigscreen') {
                $bigscreen_options[$option] = drupal_ucfirst(str_replace('_', ' ', $option));
                // human readable option names for accessibility
            }
            if ($device_group === 'tablet_landscape') {
                $tablet_landscape_options[$option] = drupal_ucfirst(str_replace('_', ' ', $option));
            }
            if ($device_group === 'tablet_portrait') {
                $tablet_portrait_options[$option] = drupal_ucfirst(str_replace('_', ' ', $option));
            }
            if ($device_group === 'smalltouch_landscape') {
                $smalltouch_landscape_options[$option] = drupal_ucfirst(str_replace('_', ' ', $option));
            }
        }
    }
    /* --------------- Font settings -------------- */
    $form['font'] = array('#type' => 'fieldset', '#title' => t('Font settings'), '#collapsed' => TRUE, '#collapsible' => TRUE);
    $form['font']['base_font_size'] = array('#type' => 'select', '#title' => t('Base font size'), '#default_value' => theme_get_setting('base_font_size'), '#options' => array('75%' => '75% (=12px)', '81.25%' => '81.25% (=13px)', '87.5%' => '87.5% (=14px)', '93.75%' => '93.75% (=15px)', '100%' => '100% (=16px)', '112.5%' => '112.5% (=18px)'), '#description' => t('To support text size enlargement/reduction, percent ratio based on the browser\'s regular font size (which is mostly 16px) is used.'));
    $form['font']['base_font_family'] = array('#type' => 'select', '#title' => t('Base font family'), '#default_value' => theme_get_setting('base_font_family'), '#options' => array(0 => t('Serif: Georgia, Palatino Linotype, Book Antiqua, URW Palladio L, Baskerville, serif'), 1 => t('Sans-Serif: Verdana, Geneva, Arial, Bitstream Vera Sans, DejaVu Sans, sans-serif'), 2 => t('Custom')), '#description' => t('Font used for most part of the contents.'));
    $form['font']['base_custom_font_family'] = array('#type' => 'textfield', '#title' => t('Custom base font family'), '#default_value' => theme_get_setting('base_custom_font_family'), '#size' => 80, '#description' => t('Enter the base font-family you want to use. No need to start with <b>font-family:</b> and end with <b>;</b>. Just enter comma separated font names.'), '#prefix' => '<div id="base-custom-font-family-wrapper">', '#suffix' => '</div>');
    $form['font']['heading_font_family'] = array('#type' => 'select', '#title' => t('Heading font family (except for the site name and slogan)'), '#default_value' => theme_get_setting('heading_font_family'), '#options' => array(0 => t('Serif: Georgia, Palatino Linotype, Book Antiqua, URW Palladio L, Baskerville, serif'), 1 => t('Sans-Serif: Verdana, Geneva, Arial, Bitstream Vera Sans, DejaVu Sans, sans-serif'), 2 => t('Custom')), '#description' => t('Font used for the headings (h1, h2, h3, h4, h5). Font used for the site name and slogan can not be changed here. If you want to change it, please manually edit style.css in the theme\'s css subdirectory.'));
    $form['font']['heading_custom_font_family'] = array('#type' => 'textfield', '#title' => t('Custom heading font family'), '#default_value' => theme_get_setting('heading_custom_font_family'), '#size' => 80, '#description' => t('Enter the font-family you want to use for the headings. No need to start with <b>font-family:</b> and end with <b>;</b>. Just enter comma separated font names.'), '#prefix' => '<div id="heading-custom-font-family-wrapper">', '#suffix' => '</div>');
    /* --------------- Layout settings -------------- */
    $form['layout'] = array('#type' => 'fieldset', '#title' => t('Layout settings'), '#collapsed' => TRUE, '#collapsible' => TRUE);
    $form['layout']['base_vmargin'] = array('#type' => 'textfield', '#title' => t('Base vertical (top/bottom) margin'), '#default_value' => theme_get_setting('base_vmargin'), '#size' => 12, '#maxlength' => 8, '#description' => t('Specify the base vertical (top/bottom) margin which is vertical spaces between page edge and browser screen in px.'), '#prefix' => '<img src="' . file_create_url(drupal_get_path('theme', 'mayo') . '/images/base-layout.png') . '" /><br />');
    $form['layout']['page_margin'] = array('#type' => 'textfield', '#title' => t('Page margin'), '#default_value' => theme_get_setting('page_margin'), '#size' => 12, '#maxlength' => 8, '#description' => t('Specify the page margin which is spaces between page edge and contents in px.'));
    $form['layout']['layout_style'] = array('#type' => 'radios', '#title' => t('Layout style'), '#default_value' => theme_get_setting('layout_style'), '#options' => array(1 => t('1. Apply page margin to all (header, footer and main contents).'), 2 => t('2. Apply page margin to main contents only.')), '#description' => '<img src="' . file_create_url(drupal_get_path('theme', 'mayo') . '/images/page-layout.png') . '" /><br />' . t('When the layout 2 is selected, or header background image is selected, header borders are not drawn to make it look better.'));
    /* --------------- Responsive sidebar layout settings -------------- */
    /* -----------Big screen as in desktop pc monitor------------- */
    $form['layout']['bigscreen'] = array('#type' => 'fieldset', '#title' => t('Big Screen Sidebar layout'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#attributes' => array('class' => array('mayo-layout-form')));
    // Big screen Layout
    $form['layout']['bigscreen']['bigscreen-layout-wrapper'] = array('#type' => 'fieldset', '#title' => t('Choose sidebar layout'));
    // Options
    $form['layout']['bigscreen']['bigscreen-layout-wrapper']['bigscreen_layout'] = array('#type' => 'radios', '#title' => t('<strong>Choose sidebar positions</strong>'), '#default_value' => str_replace('-', '_', theme_get_setting('bigscreen_layout')), '#options' => $bigscreen_options);
    // Sidebars
    $form['layout']['bigscreen']['bigscreen-sidebar-wrapper'] = array('#type' => 'fieldset', '#title' => t('Set sidebar widths'), '#description' => t('<strong>Set the width of each sidebar</strong>'), '#collapsible' => FALSE);
    // Units
    $form['layout']['bigscreen']['bigscreen-sidebar-wrapper']['bigscreen_sidebar_unit'] = array('#type' => 'select', '#title' => t('Unit'), '#default_value' => theme_get_setting('bigscreen_sidebar_unit'), '#options' => $unit_options);
    // Sidebar first
    $form['layout']['bigscreen']['bigscreen-sidebar-wrapper']['bigscreen_sidebar_first'] = array('#type' => 'textfield', '#title' => t('First sidebar'), '#default_value' => check_plain(theme_get_setting('bigscreen_sidebar_first')), '#size' => 4, '#maxlenght' => 4, '#states' => array('required' => array(array('input[name="bigscreen_layout"]' => array('value' => 'three_col_grail')), array('input[name="bigscreen_layout"]' => array('value' => 'two_sidebars_left')), array('input[name="bigscreen_layout"]' => array('value' => 'two_sidebars_right')))));
    // Sidebar second
    $form['layout']['bigscreen']['bigscreen-sidebar-wrapper']['bigscreen_sidebar_second'] = array('#type' => 'textfield', '#title' => t('Second sidebar'), '#default_value' => check_plain(theme_get_setting('bigscreen_sidebar_second')), '#size' => 4, '#maxlenght' => 4, '#states' => array('required' => array(array('input[name="bigscreen_layout"]' => array('value' => 'three_col_grail')), array('input[name="bigscreen_layout"]' => array('value' => 'two_sidebars_left')), array('input[name="bigscreen_layout"]' => array('value' => 'two_sidebars_right')))));
    // Page width
    $form['layout']['bigscreen']['bigscreen-width-wrapper'] = array('#type' => 'fieldset', '#title' => t('Set the page width'), '#description' => t('<strong>Set the page width</strong>'));
    // Unit
    $form['layout']['bigscreen']['bigscreen-width-wrapper']['bigscreen_page_unit'] = array('#type' => 'select', '#title' => t('Unit'), '#default_value' => theme_get_setting('bigscreen_page_unit'), '#options' => $unit_options);
    // Width
    $form['layout']['bigscreen']['bigscreen-width-wrapper']['bigscreen_page_width'] = array('#type' => 'textfield', '#title' => t('Page width'), '#default_value' => check_plain(theme_get_setting('bigscreen_page_width')), '#size' => 4, '#maxlenght' => 4, '#required' => TRUE);
    // Media queries
    $form['layout']['bigscreen']['media-queries-wrapper'] = array('#type' => 'fieldset', '#title' => t('Standard Screen Media Queries'), '#weight' => 1, '#attributes' => array('class' => array('at-media-queries')));
    // Media query
    $form['layout']['bigscreen']['media-queries-wrapper']['bigscreen_media_query'] = array('#type' => 'textfield', '#title' => t('Media query for this layout'), '#default_value' => check_plain(theme_get_setting('bigscreen_media_query')), '#description' => t('Do not include @media, it\'s included automatically.'), '#size' => 100, '#required' => TRUE);
    /* ****************************************************************************
     *
     * Tablet
     *
     * ************************************************************************** */
    $form['layout']['tablet'] = array('#type' => 'fieldset', '#title' => t('Tablet Sidebar Layout'), '#description' => t('<h3>Tablet Layout</h3><p>Tablet devices such as iPad, Android and Windows tablets have two orientations - landscape and portrait, which can also be thought of as wide and narrow tablets. You can configure a different layout for each orientation.</p>'), '#attributes' => array('class' => array('mayo-layout-form')), '#collapsible' => TRUE, '#collapsed' => TRUE);
    /* ******************
     * Tablet landscape
     * **************** */
    $form['layout']['tablet']['landscape'] = array('#type' => 'fieldset', '#title' => t('Landscape'), '#description' => t('<h4>Landscape tablet <span class="field-description-info">(wide)</span></h4>'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Tablet landscape Layout options
    $form['layout']['tablet']['landscape']['tablet-landscape-layout-wrapper'] = array('#type' => 'fieldset', '#title' => t('Choose sidebar layout'));
    // Options
    $form['layout']['tablet']['landscape']['tablet-landscape-layout-wrapper']['tablet_landscape_layout'] = array('#type' => 'radios', '#title' => t('<strong>Choose sidebar positions</strong>'), '#default_value' => str_replace('-', '_', theme_get_setting('tablet_landscape_layout')), '#options' => $tablet_landscape_options);
    // Sidebars
    $form['layout']['tablet']['landscape']['tablet-landscape-sidebar-width-wrapper'] = array('#type' => 'fieldset', '#title' => t('Set sidebar widths'), '#description' => t('<strong>Set the width of each sidebar</strong>'));
    // Units
    $form['layout']['tablet']['landscape']['tablet-landscape-sidebar-width-wrapper']['tablet_landscape_sidebar_unit'] = array('#type' => 'select', '#title' => t('Unit'), '#default_value' => theme_get_setting('tablet_landscape_sidebar_unit'), '#options' => $unit_options);
    // Sidebar first
    $form['layout']['tablet']['landscape']['tablet-landscape-sidebar-width-wrapper']['tablet_landscape_sidebar_first'] = array('#type' => 'textfield', '#title' => t('First sidebar'), '#default_value' => check_plain(theme_get_setting('tablet_landscape_sidebar_first')), '#size' => 4, '#maxlenght' => 4, '#states' => array('required' => array(array('input[name="tablet_landscape_layout"]' => array('value' => 'three_col_grail')), array('input[name="tablet_landscape_layout"]' => array('value' => 'two_sidebars_left')), array('input[name="tablet_landscape_layout"]' => array('value' => 'two_sidebars_left_stack')), array('input[name="tablet_landscape_layout"]' => array('value' => 'two_sidebars_right')), array('input[name="tablet_landscape_layout"]' => array('value' => 'two_sidebars_right_stack')))));
    // Sidebar second
    $form['layout']['tablet']['landscape']['tablet-landscape-sidebar-width-wrapper']['tablet_landscape_sidebar_second'] = array('#type' => 'textfield', '#title' => t('Second sidebar'), '#default_value' => check_plain(theme_get_setting('tablet_landscape_sidebar_second')), '#size' => 4, '#maxlenght' => 4, '#states' => array('invisible' => array(array('input[name="tablet_landscape_layout"]' => array('value' => 'two_sidebars_left_stack')), array('input[name="tablet_landscape_layout"]' => array('value' => 'two_sidebars_right_stack'))), 'required' => array(array('input[name="tablet_landscape_layout"]' => array('value' => 'three_col_grail')), array('input[name="tablet_landscape_layout"]' => array('value' => 'two_sidebars_left')), array('input[name="tablet_landscape_layout"]' => array('value' => 'two_sidebars_right')))));
    // Conditional messages for sidebar layouts
    $form['layout']['tablet']['landscape']['tablet-landscape-sidebar-width-wrapper']['tablet-landscape-sidebar-message-wrapper'] = array('#type' => 'fieldset', '#states' => array('invisible' => array(array('input[name="tablet_landscape_layout"]' => array('value' => 'three_col_grail')), array('input[name="tablet_landscape_layout"]' => array('value' => 'two_sidebars_left')), array('input[name="tablet_landscape_layout"]' => array('value' => 'two_sidebars_right')))));
    $form['layout']['tablet']['landscape']['tablet-landscape-sidebar-width-wrapper']['tablet-landscape-sidebar-message-wrapper']['message'] = array('#markup' => t('<div class="description">In this layout <em>Second sidebar</em> wraps below.</div>'));
    // Page width
    $form['layout']['tablet']['landscape']['tablet-landscape-page-width-wrapper'] = array('#type' => 'fieldset', '#title' => t('Set the page width'), '#description' => t('<strong>Set the page width</strong>'));
    // Unit
    $form['layout']['tablet']['landscape']['tablet-landscape-page-width-wrapper']['tablet_landscape_page_unit'] = array('#type' => 'select', '#title' => t('Unit'), '#default_value' => theme_get_setting('tablet_landscape_page_unit'), '#options' => $unit_options);
    // Width
    $form['layout']['tablet']['landscape']['tablet-landscape-page-width-wrapper']['tablet_landscape_page_width'] = array('#type' => 'textfield', '#title' => t('Page width'), '#default_value' => check_plain(theme_get_setting('tablet_landscape_page_width')), '#size' => 4, '#maxlenght' => 4, '#required' => TRUE);
    // Media Queries
    $form['layout']['tablet']['landscape']['tablet-landscape-media-queries-wrapper'] = array('#type' => 'fieldset', '#title' => t('Tablet Landscape Media Queries'), '#weight' => 1, '#attributes' => array('class' => array('at-media-queries')));
    // Media query
    $form['layout']['tablet']['landscape']['tablet-landscape-media-queries-wrapper']['tablet_landscape_media_query'] = array('#type' => 'textfield', '#title' => t('Media query for this layout'), '#default_value' => check_plain(theme_get_setting('tablet_landscape_media_query')), '#description' => t('Do not include @media, it\'s included automatically.'), '#size' => 100, '#required' => TRUE);
    /* *****************
     * Tablet portrait
     * *************** */
    $form['layout']['tablet']['portrait'] = array('#type' => 'fieldset', '#title' => t('Portrait'), '#description' => t('<h4>Portrait tablet <span class="field-description-info">(narrow)</span></h4>'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Tablet portrait Layout options
    $form['layout']['tablet']['portrait']['tablet-portrait-layout-wrapper'] = array('#type' => 'fieldset', '#title' => t('Choose sidebar layout'));
    // Options
    $form['layout']['tablet']['portrait']['tablet-portrait-layout-wrapper']['tablet_portrait_layout'] = array('#type' => 'radios', '#title' => t('<strong>Choose sidebar positions</strong>'), '#default_value' => str_replace('-', '_', theme_get_setting('tablet_portrait_layout')), '#options' => $tablet_portrait_options);
    // Tablet portrait Sidebars
    $form['layout']['tablet']['portrait']['tablet-portrait-sidebar-width-wrapper'] = array('#type' => 'fieldset', '#title' => t('Set sidebar widths'), '#description' => t('<strong>Set the width of each sidebar</strong>'), '#states' => array('invisible' => array('input[name="tablet_portrait_layout"]' => array('value' => 'one_col_stack'))));
    // Units
    $form['layout']['tablet']['portrait']['tablet-portrait-sidebar-width-wrapper']['tablet_portrait_sidebar_unit'] = array('#type' => 'select', '#title' => t('Unit'), '#default_value' => theme_get_setting('tablet_portrait_sidebar_unit'), '#options' => $unit_options);
    // Sidebar first
    $form['layout']['tablet']['portrait']['tablet-portrait-sidebar-width-wrapper']['tablet_portrait_sidebar_first'] = array('#type' => 'textfield', '#title' => t('First sidebar'), '#default_value' => check_plain(theme_get_setting('tablet_portrait_sidebar_first')), '#size' => 4, '#maxlenght' => 4, '#states' => array('invisible' => array(array('input[name="tablet_portrait_layout"]' => array('value' => 'one_col_stack'))), 'required' => array(array('input[name="tablet_portrait_layout"]' => array('value' => 'one_col_vert')), array('input[name="tablet_portrait_layout"]' => array('value' => 'two_sidebars_left_stack')), array('input[name="tablet_portrait_layout"]' => array('value' => 'two_sidebars_right_stack')))));
    // Sidebar second
    $form['layout']['tablet']['portrait']['tablet-portrait-sidebar-width-wrapper']['tablet_portrait_sidebar_second'] = array('#type' => 'textfield', '#title' => t('Second sidebar'), '#default_value' => check_plain(theme_get_setting('tablet_portrait_sidebar_second')), '#size' => 4, '#maxlenght' => 4, '#states' => array('invisible' => array(array('input[name="tablet_portrait_layout"]' => array('value' => 'one_col_stack')), array('input[name="tablet_portrait_layout"]' => array('value' => 'two_sidebars_left_stack')), array('input[name="tablet_portrait_layout"]' => array('value' => 'two_sidebars_right_stack'))), 'required' => array(array('input[name="tablet_portrait_layout"]' => array('value' => 'one_col_vert')))));
    // Conditional messages for sidebar layouts
    $form['layout']['tablet']['portrait']['tablet-portrait-sidebar-width-wrapper']['tablet-portrait-sidebar-message-wrapper'] = array('#type' => 'fieldset', '#states' => array('invisible' => array(array('input[name="tablet_portrait_layout"]' => array('value' => 'one_col_vert')), array('input[name="tablet_portrait_layout"]' => array('value' => 'one_col_stack')))));
    $form['layout']['tablet']['portrait']['tablet-portrait-sidebar-width-wrapper']['tablet-portrait-sidebar-message-wrapper']['message'] = array('#markup' => t('<div class="description">In this layout <em>Second sidebar</em> wraps below.</div>'));
    // Tablet portrait Page width
    $form['layout']['tablet']['portrait']['tablet-portrait-page-width-wrapper'] = array('#type' => 'fieldset', '#title' => t('Set the page width'), '#description' => t('<strong>Set the page width</strong>'));
    // Unit
    $form['layout']['tablet']['portrait']['tablet-portrait-page-width-wrapper']['tablet_portrait_page_unit'] = array('#type' => 'select', '#title' => t('Unit'), '#default_value' => theme_get_setting('tablet_portrait_page_unit'), '#options' => $unit_options);
    // Width
    $form['layout']['tablet']['portrait']['tablet-portrait-page-width-wrapper']['tablet_portrait_page_width'] = array('#type' => 'textfield', '#title' => t('Page width'), '#default_value' => check_plain(theme_get_setting('tablet_portrait_page_width')), '#size' => 4, '#maxlenght' => 4, '#required' => TRUE);
    // Tablet portrait Media queries
    $form['layout']['tablet']['portrait']['tablet-portrait-media-queries-wrapper'] = array('#type' => 'fieldset', '#title' => t('Tablet Portrait Media Queries'), '#weight' => 1, '#attributes' => array('class' => array('at-media-queries')));
    // Media query
    $form['layout']['tablet']['portrait']['tablet-portrait-media-queries-wrapper']['tablet_portrait_media_query'] = array('#type' => 'textfield', '#title' => t('Media query for this layout'), '#default_value' => check_plain(theme_get_setting('tablet_portrait_media_query')), '#description' => t('Do not include @media, it\'s included automatically.'), '#size' => 100, '#required' => TRUE);
    /* ****************************************************************************
     *
     * Smalltouch
     *
     * ************************************************************************** */
    $form['layout']['smalltouch'] = array('#type' => 'fieldset', '#title' => t('Smalltouch Sidebar Layout'), '#description' => t('<h3>Smalltouch Layout</h3><p>Smalltouch devices such as iPhone, Android and Windows phones have two orientations - landscape and portrait, which can also be thought of as wide and arrow smalltouch devices. You can configure a layout for landscape orientation only - portrait orientation (narrow) will always display in one column (all regions full width and stacked) with sidebars below the main content.</p>'), '#attributes' => array('class' => array('mayo-layout-form')), '#collapsible' => TRUE, '#collapsed' => TRUE);
    /* **********************
     * Smalltouch landscape
     * ******************** */
    $form['layout']['smalltouch']['landscape'] = array('#type' => 'fieldset', '#title' => t('Landscape'), '#description' => t('<h4>Landscape smalltouch <span class="field-description-info">(wide)</span></h4>'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['layout']['smalltouch']['landscape']['smalltouch-landscape-layout-wrapper'] = array('#type' => 'fieldset', '#title' => t('Choose sidebar layout'));
    $form['layout']['smalltouch']['landscape']['smalltouch-landscape-layout-wrapper']['smalltouch_landscape_layout'] = array('#type' => 'radios', '#title' => t('<strong>Choose sidebar positions</strong>'), '#default_value' => theme_get_setting('smalltouch_landscape_layout') ? str_replace('-', '_', theme_get_setting('smalltouch_landscape_layout')) : str_replace('-', '_', theme_get_setting('smartphone_landscape_layout')), '#options' => $smalltouch_landscape_options);
    $form['layout']['smalltouch']['landscape']['smalltouch-landscape-sidebar-width-wrapper'] = array('#type' => 'fieldset', '#title' => t('Set sidebar widths'), '#description' => t('<strong>Set the width of each sidebar</strong>'), '#states' => array('!visible' => array('input[name="smalltouch_landscape_layout"]' => array('value' => 'one_col_stack'))));
    $form['layout']['smalltouch']['landscape']['smalltouch-landscape-sidebar-width-wrapper']['smalltouch_landscape_sidebar_unit'] = array('#type' => 'select', '#title' => t('Unit'), '#default_value' => theme_get_setting('smalltouch_landscape_sidebar_unit') ? theme_get_setting('smalltouch_landscape_sidebar_unit') : theme_get_setting('smartphone_landscape_sidebar_unit'), '#options' => $unit_options);
    $form['layout']['smalltouch']['landscape']['smalltouch-landscape-sidebar-width-wrapper']['smalltouch_landscape_sidebar_first'] = array('#type' => 'textfield', '#title' => t('First sidebar'), '#default_value' => theme_get_setting('smalltouch_landscape_sidebar_first') ? check_plain(theme_get_setting('smalltouch_landscape_sidebar_first')) : check_plain(theme_get_setting('smartphone_landscape_sidebar_first')), '#size' => 4, '#maxlenght' => 4, '#states' => array('required' => array('input[name="smalltouch_landscape_layout"]' => array('value' => 'one_col_vert'))));
    $form['layout']['smalltouch']['landscape']['smalltouch-landscape-sidebar-width-wrapper']['smalltouch_landscape_sidebar_second'] = array('#type' => 'textfield', '#title' => t('Second sidebar'), '#default_value' => theme_get_setting('smalltouch_landscape_sidebar_second') ? check_plain(theme_get_setting('smalltouch_landscape_sidebar_second')) : check_plain(theme_get_setting('smartphone_landscape_sidebar_second')), '#size' => 4, '#maxlenght' => 4, '#states' => array('required' => array('input[name="smalltouch_landscape_layout"]' => array('value' => 'one_col_vert'))));
    $form['layout']['smalltouch']['landscape']['smalltouch-landscape-media-queries-wrapper'] = array('#type' => 'fieldset', '#title' => t('Smalltouch Landscape Media Queries'), '#weight' => 1, '#attributes' => array('class' => array('at-media-queries')));
    $form['layout']['smalltouch']['landscape']['smalltouch-landscape-media-queries-wrapper']['smalltouch_landscape_media_query'] = array('#type' => 'textfield', '#title' => t('Media query for this layout'), '#default_value' => theme_get_setting('smalltouch_landscape_media_query') ? check_plain(theme_get_setting('smalltouch_landscape_media_query')) : check_plain(theme_get_setting('smartphone_landscape_media_query')), '#description' => t('Do not include @media, it\'s included automatically.'), '#size' => 100);
    // Pass hidden values to the sumbit function, these values are required but the user can't change them via the UI
    $form['layout']['smalltouch']['landscape']['hidden']['smalltouch_landscape_page_width'] = array('#type' => 'hidden', '#default_value' => theme_get_setting('smalltouch_landscape_page_width') ? check_plain(theme_get_setting('smalltouch_landscape_page_width')) : check_plain(theme_get_setting('smartphone_landscape_page_width')));
    $form['layout']['smalltouch']['landscape']['hidden']['smalltouch_landscape_page_unit'] = array('#type' => 'hidden', '#default_value' => theme_get_setting('smalltouch_landscape_page_unit') ? theme_get_setting('smalltouch_landscape_page_unit') : theme_get_setting('smartphone_landscape_page_unit'));
    /* *********************
     * Smalltouch portrait
     * ******************* */
    $form['layout']['smalltouch']['portrait'] = array('#type' => 'fieldset', '#title' => t('Portrait'), '#description' => t('<h4>Portrait smalltouch <span class="field-description-info">(narrow)</span></h4><div class="smalltouch-portrait-layout">One column</div><p>The smalltouch portrait layout always displays in one column with sidebars stacked horizontally below the main content. All widths are always 100%.</p>'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['layout']['smalltouch']['portrait']['smalltouch-portrait-media-queries-wrapper'] = array('#type' => 'fieldset', '#title' => t('Smalltouch Portrait Media Queries'), '#weight' => 1, '#attributes' => array('class' => array('at-media-queries')));
    $form['layout']['smalltouch']['portrait']['smalltouch-portrait-media-queries-wrapper']['smalltouch_portrait_media_query'] = array('#type' => 'textfield', '#title' => t('Media query for this layout'), '#default_value' => theme_get_setting('smalltouch_portrait_media_query') ? check_plain(theme_get_setting('smalltouch_portrait_media_query')) : check_plain(theme_get_setting('smartphone_portrait_media_query')), '#description' => t('Do not include @media, it\'s included automatically.'), '#size' => 100);
    // Pass hidden values to the sumbit function, these values are required but the user can't change them via the UI
    $form['layout']['smalltouch']['portrait']['hidden']['smalltouch_portrait_page_width'] = array('#type' => 'hidden', '#default_value' => theme_get_setting('smalltouch_portrait_page_width') ? check_plain(theme_get_setting('smalltouch_portrait_page_width')) : check_plain(theme_get_setting('smartphone_portrait_page_width')));
    $form['layout']['smalltouch']['portrait']['hidden']['smalltouch_portrait_page_unit'] = array('#type' => 'hidden', '#default_value' => theme_get_setting('smalltouch_portrait_page_unit') ? theme_get_setting('smalltouch_portrait_page_unit') : theme_get_setting('smartphone_portrait_page_unit'));
    $form['layout']['smalltouch']['portrait']['hidden']['smalltouch_portrait_sidebar_first'] = array('#type' => 'hidden', '#default_value' => theme_get_setting('smalltouch_portrait_sidebar_first') ? check_plain(theme_get_setting('smalltouch_portrait_sidebar_first')) : check_plain(theme_get_setting('smartphone_portrait_sidebar_first')));
    $form['layout']['smalltouch']['portrait']['hidden']['smalltouch_portrait_sidebar_second'] = array('#type' => 'hidden', '#default_value' => theme_get_setting('smalltouch_portrait_sidebar_second') ? check_plain(theme_get_setting('smalltouch_portrait_sidebar_second')) : check_plain(theme_get_setting('smartphone_portrait_sidebar_second')));
    $form['layout']['smalltouch']['portrait']['hidden']['smalltouch_portrait_sidebar_unit'] = array('#type' => 'hidden', '#default_value' => theme_get_setting('smalltouch_portrait_sidebar_unit') ? check_plain(theme_get_setting('smalltouch_portrait_sidebar_unit')) : check_plain(theme_get_setting('smartphone_portrait_sidebar_unit')));
    $form['layout']['smalltouch']['portrait']['hidden']['smalltouch_portrait_layout'] = array('#type' => 'hidden', '#default_value' => theme_get_setting('smalltouch_portrait_layout') ? str_replace('-', '_', theme_get_setting('smalltouch_portrait_layout')) : str_replace('-', '_', theme_get_setting('smartphone_portrait_layout')));
    /* --------------- Style settings -------------- */
    $form['style'] = array('#type' => 'fieldset', '#title' => t('Style settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['style']['legacy_superfish_styles'] = array('#type' => 'checkbox', '#title' => t('Use old legacy MAYO styles for Superfish.'), '#default_value' => theme_get_setting('legacy_superfish_styles'), '#description' => t('Check here if you want to add mayo-superfish.css.'));
    $form['style']['superfish_note'] = array('#type' => 'item', '#title' => t('Note:'), '#markup' => t('Use this only when coming from the older non-responsive versions of MAYO
     and your Superfish menu is broken without it. If you haven\'t been using Superfish or are
     installing MAYO for the first time you shouldn\'t need it and can leave it unchecked.'));
    $form['style']['round_corners'] = array('#type' => 'select', '#title' => t('Content box round corners'), '#default_value' => theme_get_setting('round_corners'), '#description' => t('Make the corner of sidebar block and/or node rounded.'), '#options' => array('rc-0' => t('No round corners'), 'rc-1' => t('Sidebar block only'), 'rc-2' => t('Node only'), 'rc-3' => t('Both sidebar block and node')), '#suffix' => '<img src="' . file_create_url(drupal_get_path('theme', 'mayo') . '/images/round-corners.png') . '" /><br />');
    $form['style']['menubar_style'] = array('#type' => 'radios', '#title' => t('Menubar style'), '#default_value' => theme_get_setting('menubar_style'), '#options' => array(1 => t('1. Normal (based on the colors specified by the color set)'), 2 => t('2. Gloss black image background.')), '#suffix' => '<img src="' . file_create_url(drupal_get_path('theme', 'mayo') . '/images/menubar-type.png') . '" />');
    $form['style']['note'] = array('#type' => 'item', '#title' => t('Note:'), '#markup' => t('When the menubar type 2 is selected, the menu text color, menu highlight color, menu divier color from the color set are ignored and the fixed colors that match to the menubar are used instead.  Besides, highlight color and menu divider color from the color set are still used for other places such as tabs and sub-menubar for superfish and nice_menus menu.'));
    $form['style']['menubar_background'] = array('#type' => 'checkbox', '#title' => t('Allow Menubar background color.'), '#default_value' => theme_get_setting('menubar_background'), '#description' => t('Add your own hex background color below.'));
    $form['style']['menubar_bg_value'] = array('#type' => 'textfield', '#title' => t('Meubar background color'), '#default_value' => theme_get_setting('menubar_bg_value'), '#size' => 7, '#maxlength' => 7, '#description' => t('Specify the background color for the menubar. This setting is used only when the <em>Allow Meubar background</em> option is checked above.'));
    /* --------------- Advanced header settings -------------- */
    $form['adv_header'] = array('#type' => 'fieldset', '#title' => t('Advanced header settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['adv_header']['header_searchbox'] = array('#type' => 'checkbox', '#title' => t('Add search form to the header'), '#default_value' => theme_get_setting('header_searchbox'), '#description' => t('Check here if you want to add search form block to the right side of the header.'));
    $form['adv_header']['header_fontsizer'] = array('#type' => 'checkbox', '#title' => t('Add font resizing controls'), '#default_value' => theme_get_setting('header_fontsizer'), '#description' => t('Check here if you want to add font resizing controls at side of the header.'));
    $form['adv_header']['header_border_width'] = array('#type' => 'textfield', '#title' => t('Header border width'), '#default_value' => theme_get_setting('header_border_width'), '#size' => 12, '#maxlength' => 8, '#description' => t('Specify the header border width in px. Note that header border is not drawn when you use header background image or when you use layout style 2.'));
    $form['adv_header']['searchbox_size'] = array('#type' => 'textfield', '#title' => t('Search form textfield width'), '#default_value' => theme_get_setting('searchbox_size'), '#size' => 10, '#maxlength' => 6, '#description' => t('Specify the width of the text field of the search forms in characters. This size is also applied for the search form in a block. NOTE: do not add px since this is not px size.'));
    $form['adv_header']['header_bg_file'] = array('#type' => 'textfield', '#title' => t('URL of the header background image'), '#default_value' => theme_get_setting('header_bg_file'), '#description' => t('If the background image is bigger than the header area, it is clipped. If it\'s smaller than the header area, it is tiled to fill the header area. To remove the background image, blank this field and save the settings.'), '#size' => 40, '#maxlength' => 120);
    $form['adv_header']['header_bg'] = array('#type' => 'file', '#title' => t('Upload header background image'), '#size' => 40, '#attributes' => array('enctype' => 'multipart/form-data'), '#description' => t('If you don\'t jave direct access to the server, use this field to upload your header background image'), '#element_validate' => array('mayo_header_bg_validate'));
    $form['adv_header']['header_bg_alignment'] = array('#type' => 'select', '#title' => t('Header backgeround image alignment'), '#default_value' => theme_get_setting('header_bg_alignment'), '#description' => t('Select the alignment of the header background image.'), '#options' => array('top left' => t('Top left'), 'top center' => t('Top center'), 'top right' => t('Top right'), 'center left' => t('Center left'), 'center center' => t('Center center'), 'center right' => t('Center right'), 'bottom left' => t('Bottom left'), 'bottom center' => t('Bottom center'), 'bottom right' => t('Bottom right')));
    $form['adv_header']['header_watermark'] = array('#type' => 'select', '#title' => t('Header watermark'), '#default_value' => theme_get_setting('header_watermark'), '#description' => t('Select the watermark you want from the list below. The sample below is scaled down and the actual size of the watermark is bigger.'), '#options' => array(0 => t('-None-'), 1 => t('Pixture'), 2 => t('Wave'), 3 => t('Bubble'), 4 => t('Flower'), 5 => t('Star'), 6 => t('Metal')), '#suffix' => '<img src="' . file_create_url(drupal_get_path('theme', 'mayo') . '/images/watermark-sample.png') . '" /><br />');
    /* --------------- Misellanenous settings -------------- */
    $form['misc'] = array('#type' => 'fieldset', '#title' => t('Miscellaneous settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['misc']['display_breadcrumb'] = array('#type' => 'checkbox', '#title' => t('Display breadcrumb'), '#default_value' => theme_get_setting('display_breadcrumb'), '#description' => t('Check here if you want to display breadcrumb.'));
    $form['misc']['homeless_breadcrumb'] = array('#type' => 'checkbox', '#title' => t('Display Mayo style breadcrumb'), '#default_value' => theme_get_setting('homeless_breadcrumb'), '#description' => t('Check here if you want to display breadcrumb with \'Home\' link removed and \'>\' seperator at end.'));
    $form['misc']['dark_messages'] = array('#type' => 'checkbox', '#title' => t('Use dark message colors'), '#default_value' => theme_get_setting('dark_messages'), '#return_value' => 'dark-messages', '#description' => t('Check here if you use the dark color set. Colors for the status/warning/error messages are adjusted.'));
    /*
     * Originally posted by dvessel (http://drupal.org/user/56782).
     * The following will be processed even if the theme is inactive.
     * If you are on a theme specific settings page but it is not an active
     * theme (example.com/admin/apearance/settings/THEME_NAME), it will
     * still be processed.
     *
     * Build a list of themes related to the theme specific form. If the form
     * is specific to a sub-theme, all parent themes leading to it will have
     * hook_form_theme_settings invoked. For example, if a theme named
     * 'grandchild' has its settings form in focus, the following will be invoked.
     * - parent_form_theme_settings()
     * - child_form_theme_settings()
     * - grandchild_form_theme_settings()
     *
     * If 'child' was in focus it will invoke:
     * - parent_form_theme_settings()
     * - child_form_theme_settings()
     *
     *  @see http://drupal.org/node/943212
     */
    $form_themes = array();
    $themes = list_themes();
    $_theme = $GLOBALS['theme_key'];
    while (isset($_theme)) {
        $form_themes[$_theme] = $_theme;
        $_theme = isset($themes[$_theme]->base_theme) ? $themes[$_theme]->base_theme : NULL;
    }
    $form_themes = array_reverse($form_themes);
    foreach ($form_themes as $theme_key) {
        if (function_exists($form_settings = "{$theme_key}_form_theme_settings")) {
            $form_settings($form, $form_state);
        }
    }
    // Include custom form validation and submit functions
    require_once drupal_get_path('theme', 'mayo') . '/inc/forms/mayo.validate.inc';
    require_once drupal_get_path('theme', 'mayo') . '/inc/forms/mayo.submit.inc';
    // Custom validate and submit functions
    $form['#validate'][] = 'mayo_settings_validate';
    $form['#submit'][] = 'mayo_settings_submit';
}
Example #21
0
</p>
            </div>
        </div>
        <div class = 'user-menu-inner-item-container'>  
            <?php 
foreach ($menus as $menu) {
    $title_class = drupal_html_class($menu['link']['link_title']);
    $link = $menu['link']['link_path'];
    if (!$menu['link']['hidden']) {
        echo "<div class='user-menu-inner-item user-menu-{$title_class}'>";
        echo l(drupal_ucfirst($menu['link']['link_title']), $link);
        if (!empty($menu['below'])) {
            echo "<div class='menu-container'>";
            foreach ($menu['below'] as $inner_menu) {
                $inner_title = $inner_menu['link']['link_title'];
                $inner_link = $inner_menu['link']['link_path'];
                echo l(drupal_ucfirst($inner_title), $inner_link);
            }
            echo '</div>';
        }
        echo '</div>';
    }
}
?>
        </div>

        <span id='clock'></span>
    </div>
    <div class='user-nav-slide'></div>
</div>
/**
 * Themes the question part of a select&order-question form.
 *
 * @param array $elements
 *   Asocaitive array containing one element:
 *   - form: array - The question part of the form, containing:
 *     - questionText: Drupal form-field with the quetsion text.
 *     - data['#value']: associative array with content:
 *       - elementname: The base-name used for form elements that need to be
 *           accessed by javascript.
 *       - duplicates: Are duplicates allowed?
 *       - alignment: string "horizontal" or "normal".
 *       - optionHeight: Minimal height to use for items to force nice alignment
 *         if contents are of varying height, or boolean FALSE if not set.
 *       - sourceTitle: title of the source-section
 *       - unselected: array of items, each one containing:
 *         - identifier: item identifier.
 *         - text: item text.
 *         - description: item description.
 *       - sections: array of target sections, each one containing:
 *         - identifier: section identifier.
 *         - text: section title.
 *         - items: array of items, each one containing:
 *           - identifier: item identifier.
 *           - text: item text.
 *           - description: item description.
 *
 * @ingroup themeable
 */
function theme_closedquestion_question_select_order($elements)
{
    $formpart = $elements['form'];
    drupal_add_js(drupal_get_path('module', 'closedquestion') . '/assets/closedquestion_so.js');
    drupal_add_library('system', 'ui.sortable');
    drupal_add_library('system', 'ui.draggable');
    $form_pos = strpos($formpart['questionText']['#markup'], '<formblock/>');
    if ($form_pos !== FALSE) {
        $pre_form = substr($formpart['questionText']['#markup'], 0, $form_pos);
        $post_form = substr($formpart['questionText']['#markup'], $form_pos + 12);
    } else {
        $pre_form = $formpart['questionText']['#markup'];
        $post_form = '';
    }
    $html = '';
    $html .= $pre_form;
    $data = $formpart['data']['#value'];
    if ($data['duplicates']) {
        $sourceclass = 'cqDDList cqCopyList cqNoDel';
        $targetclass = 'cqDDList cqDropableList';
    } else {
        $sourceclass = 'cqDDList cqDropableList cqNoDel';
        $targetclass = 'cqDDList cqDropableList cqNoDel';
    }
    $html .= '<div class="cqSo' . drupal_ucfirst($data['alignment']) . '">' . "\n";
    $html .= '<div class="cqSources" id="' . $data['elementname'] . 'sources">' . "\n";
    $html .= '  <div class="cqSource">' . "\n";
    $html .= '    <p>' . $data['sourceTitle'] . '</p>' . "\n";
    $html .= '<ul id="' . $data['elementname'] . 'source" class="' . $sourceclass . '">' . "\n";
    if (isset($data['unselected'])) {
        foreach ($data['unselected'] as $item) {
            $html .= cq_make_li($item['identifier'], $item['text'], $item['description'], $data['optionHeight']);
        }
    }
    $html .= '<div class="cqSoClear"></div>' . "\n";
    // To make sure that with horizontal alignment the ul encloses the li's
    $html .= '</ul>' . "\n";
    $html .= '</div>' . "\n";
    $html .= '</div>' . "\n";
    $html .= '<div class="cqTargets" id="' . $data['elementname'] . 'targets">' . "\n";
    foreach ($data['sections'] as $section_selected) {
        $html .= '  <div class="Cqtarget">' . "\n";
        $html .= '    <p>' . $section_selected['text'] . '</p>' . "\n";
        $html .= '    <ul class="' . $targetclass . '" cqvalue="' . $section_selected['identifier'] . '">' . "\n";
        foreach ($section_selected['items'] as $item) {
            $html .= cq_make_li($item['identifier'], $item['text'], $item['description'], $data['optionHeight']);
        }
        $html .= '    </ul>' . "\n";
        $html .= '  </div>' . "\n";
    }
    $html .= '</div>' . "\n";
    // cqSource
    $html .= '</div>' . "\n";
    // CqSO_normal
    $html .= '<div style="clear: left;">' . "\n";
    $html .= '</div>' . "\n";
    $html .= $post_form;
    return $html;
}
  <?php 
if ($submitted) {
    ?>
    <span class="submitted"><?php 
    print $submitted;
    ?>
</span>
  <?php 
}
?>

  <?php 
if ($comment->new) {
    ?>
    <span class="new"><?php 
    print drupal_ucfirst($new);
    ?>
</span>
  <?php 
}
?>

  <?php 
print $picture;
?>

    <h3><?php 
print $title;
?>
</h3>
Example #24
0
    <h2><?php 
print l($object->title, $object->path['URL'], array('query' => $object->path['QUERY'], 'fragment' => $object->path['BREADCRUMB']));
?>
</h2>
    <fieldset class="abuse-report corners fieldset collapsible form-wrapper">
      <legend><span class="fieldset-legend"><a class="fieldset-title" href="#"><span class="fieldset-legend-prefix element-invisible">Show</span><?php 
print t('User');
?>
</a><span class="summary"></span></span></legend>
      <div class="summary fieldset-wrapper">
        <label><?php 
print t('Type:');
?>
</label>
        <div class="description"><?php 
print drupal_ucfirst($object->content_type);
?>
</div>
        <label><?php 
print t('Status:');
?>
</label>
        <div class="description"><?php 
print $object->abuse_status_string;
?>
</div>
        <?php 
if (variable_get('abuse_assigned_moderators', FALSE)) {
    ?>
          <label><?php 
    print t('Assigned To:');