Example #1
0
/**
 * Implements hook_form_FORM_ID_alter().
 *
 * @param $form
 *   The form.
 * @param $form_state
 *   The form state.
 */
function md_orenmode_form_system_theme_settings_alter(&$form, &$form_state, $form_id = NULL, $no_js_use = FALSE)
{
    global $base_url;
    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_orenmode_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="logo-right"><a href="http://megadrupal.com/forum"><img title="Visit our support forum" src="' . $base_url . '/' . THEME_PATH . '/img/theme-settings/logo.png" alt="Mega Drupal"></a></div>
			<div class="md-content-framewp">', '#weight' => -99);
    md_orenmode_theme_settings_general($form, $form_state);
    md_orenmode_theme_settings_design($form, $form_state);
    md_orenmode_theme_settings_display($form, $form_state);
    md_orenmode_theme_settings_text($form, $form_state);
    md_orenmode_theme_settings_code($form, $form_state);
    md_orenmode_theme_settings_config($form, $form_state);
    $form['actions']['reset'] = array('#type' => 'submit', '#value' => t('Reset Settings'), '#submit' => array('md_orenmode_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_orenmode_validate_theme_settings';
    $form['#submit'][] = 'md_orenmode_save_settings_submit';
}
Example #2
0
/**
 * @file
 * Template overrides as well as (pre-)process and alter hooks for the
 * friends theme.
 */
function pul_base_page_alter(&$page)
{
    if (arg(0) == 'search') {
        if (!empty($page['content']['system_main']['search_form'])) {
            hide($page['content']['system_main']['search_form']);
        }
    }
}
Example #3
0
function login($password)
{
    global $config;
    if (hide($password) !== $config['password']) {
        return false;
    }
    $_SESSION['role'] = 'admin';
    return true;
}
Example #4
0
/**
 * Pre-processes variables for the "page" theme hook.
 *
 * See template for list of available variables.
 *
 * @see page.tpl.php
 *
 * @ingroup theme_preprocess
 */
function walk_preprocess_page(&$vars)
{
    // Add information about the number of sidebars.
    if (!empty($vars['page']['sidebar_first']) && !empty($vars['page']['sidebar_second'])) {
        $vars['content_column_class'] = ' class="col-sm-6"';
    } elseif (!empty($vars['page']['sidebar_first']) || !empty($vars['page']['sidebar_second'])) {
        $vars['content_column_class'] = ' class="col-sm-9"';
    } else {
        $vars['content_column_class'] = ' class="col-sm-12"';
    }
    if (bootstrap_setting('fluid_container') == 1) {
        $vars['container_class'] = 'container-fluid';
    } else {
        $vars['container_class'] = 'container';
    }
    // Primary nav.
    $vars['primary_nav'] = FALSE;
    if ($vars['main_menu']) {
        // Build links.
        $vars['primary_nav'] = menu_tree(variable_get('menu_main_links_source', 'main-menu'));
        // Provide default theme wrapper function.
        $vars['primary_nav']['#theme_wrappers'] = array('menu_tree__primary');
    }
    // Secondary nav.
    $vars['secondary_nav'] = FALSE;
    if ($vars['secondary_menu']) {
        // Build links.
        $vars['secondary_nav'] = menu_tree(variable_get('menu_secondary_links_source', 'user-menu'));
        // Provide default theme wrapper function.
        $vars['secondary_nav']['#theme_wrappers'] = array('menu_tree__secondary');
    }
    $vars['navbar_classes_array'] = array('navbar');
    if (bootstrap_setting('navbar_position') !== '') {
        $vars['navbar_classes_array'][] = 'navbar-' . bootstrap_setting('navbar_position');
    } elseif (bootstrap_setting('fluid_container') == 1) {
        $vars['navbar_classes_array'][] = 'container-fluid';
    } else {
        $vars['navbar_classes_array'][] = 'container';
    }
    if (bootstrap_setting('navbar_inverse')) {
        $vars['navbar_classes_array'][] = 'navbar-inverse';
    } else {
        $vars['navbar_classes_array'][] = 'navbar-default';
    }
    if (arg(0) == 'node' && arg(1) == 'add' && arg(2) == 'walk') {
        drupal_set_title('Hosting a Walk');
    }
    if (isset($vars['node']) && $vars['node']->nid == 12) {
        //dpm($vars);
        hide($vars['page']['content']['system_main']['nodes']);
    }
}
Example #5
0
/**
 * Override or insert variables into the node templates.
 */
function moa_preprocess_node(&$vars)
{
    $vars['theme_hook_suggestions'][] = 'node__' . $vars['type'] . '__' . $vars['view_mode'];
    switch ($vars['type']) {
        case 'project':
            if ($vars['view_mode'] == 'full') {
                if (isset($vars['field_hide_feature_image_on_proj']['und'][0]['value']) && $vars['field_hide_feature_image_on_proj']['und'][0]['value'] == 1) {
                    hide($vars['content']['field_feature_image']);
                }
            }
            break;
    }
}
Example #6
0
 /**
  * Helper function to setup the faq answer.
  *
  * @param array &$data
  *   Array reference to store display data in.
  * @param Drupal\node\NodeInterface $node
  *   The node object.
  * @param string $back_to_top
  *   An array containing the "back to top" link.
  * @param bool $teaser
  *   Whether or not to use teasers.
  * @param bool $links
  *   Whether or not to show node links.
  */
 public static function viewAnswer(&$data, \Drupal\node\NodeInterface $node, $teaser)
 {
     $faq_settings = \Drupal::config('faq.settings');
     // TODO: hide 'submitted by ... on ...'
     $view_mode = $teaser ? 'teaser' : 'full';
     $node_build = node_view($node, $view_mode);
     hide($node_build['title']);
     if (!$faq_settings->get('question_long_form')) {
         hide($node_build['field_detailed_question']);
     }
     $content = drupal_render($node_build);
     $content .= FaqViewer::initBackToTop();
     $data['body'] = SafeMarkup::set($content);
 }
Example #7
0
/**
 * Preprocessor for theme('node_form').
 */
function europa_preprocess_node_form(&$variables)
{
    $i = 100;
    $variables['sidebar'] = array();
    $node_form_sidebar = theme_get_setting('node_form_sidebar');
    if ($node_form_sidebar) {
        foreach ($node_form_sidebar as $field_name) {
            if (isset($variables['form'][$field_name])) {
                $variables['form'][$field_name]['#weight'] = $i++;
                $variables['sidebar'][$field_name] = $variables['form'][$field_name];
                hide($variables['form'][$field_name]);
            }
        }
    }
    // Extract the form buttons, and put them in independent variable.
    $variables['buttons'] = $variables['form']['actions'];
    hide($variables['form']['actions']);
}
Example #8
0
/**
 * Implements hook_preprocess_page().
 * @param $variables
 */
function midnight_preprocess_page(&$variables)
{
    $theme_path = drupal_get_path('theme', 'midnight');
    // These files will be disable responsive feature on theme.
    $disable_rss = theme_get_setting('disabling_responsiveness');
    if ($disable_rss) {
        drupal_add_css($theme_path . '/css/non-responsive.css', array('group' => CSS_THEME));
        drupal_add_js($theme_path . '/js/non-responsive.js', array('group' => JS_THEME));
    } else {
        $viewport = array('#tag' => 'meta', '#attributes' => array('name' => 'viewport', 'content' => 'width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0'));
        drupal_add_html_head($viewport, 'viewport');
    }
    // Remove default message of system in front page.
    if ($variables['is_front']) {
        // This will remove the 'No front page content has been created yet.'
        hide($variables['page']['content']['system_main']['default_message']);
    }
}
Example #9
0
/**
 * Implements hook_form_id_alter()
 * Modify the user edit form for usability++
 */
function borg_form_user_profile_form_alter(&$form, &$form_state)
{
    drupal_add_js('core/misc/vertical-tabs.js');
    $account_fieldset = array('#type' => 'fieldset', '#title' => t('Change Email or Password'), '#collapsible' => true, '#collapsed' => true, '#weight' => -9);
    $fields_for_account_fieldset = array('current_pass', 'mail', 'pass');
    foreach ($fields_for_account_fieldset as $field_name) {
        if (isset($form['account'][$field_name])) {
            $account_fieldset[$field_name] = $form['account'][$field_name];
            hide($form['account'][$field_name]);
        }
    }
    $form['account']['account_fieldset'] = $account_fieldset;
    $form['account']['#weight'] = 1;
    $form['account']['name']['#weight'] = -50;
    $form['field_name']['#weight'] = -51;
    $form['field_forhire']['#weight'] = 2;
    $form['field_services']['#weight'] = 3;
    $form['field_expertise']['#weight'] = 4;
    $form['field_bio']['#weight'] = 5;
    $form['field_photo']['#weight'] = 6;
    $form['field_header_photo']['#weight'] = 7;
    $form['field_gender']['#weight'] = 8;
    $form['field_gender'][LANGUAGE_NONE]['#options']['_none'] = t('- Not specified -');
    $form['field_industries']['#weight'] = 9;
    $social_fieldset = array('#type' => 'fieldset', '#title' => t('Find me Online'), '#collapsible' => true, '#collapsed' => false, '#weight' => 10);
    $form['field_social']['#weight'] = 1;
    $form['field_irc']['#weight'] = 2;
    $form['field_websites']['#weight'] = 3;
    $fields_for_account_fieldset = array('field_irc', 'field_social', 'field_websites');
    foreach ($fields_for_account_fieldset as $field_name) {
        $social_fieldset[$field_name] = $form[$field_name];
        hide($form[$field_name]);
    }
    $form['social_fieldset'] = $social_fieldset;
    $form['field_contributions']['#weight'] = 11;
    $form['field_contributions_other']['#weight'] = 12;
    $form['contact']['#weight'] = 21;
    $form['timezone']['#weight'] = 22;
    $form['timezone']['#collapsed'] = TRUE;
    $form['redirect']['#weight'] = 23;
}
?>
            <?php 
print render($content['field_promotion_sortie_bio_en']);
?>
            <?php 
print render($content['field_promotion_sortie_liens']);
?>
        </div>
    </div>


    <?php 
// Hide comments, tags, and links now so that we can render them later.
hide($content['comments']);
hide($content['links']);
hide($content['field_tags']);
print render($content);
?>


    <?php 
if (!empty($content['field_tags']) || !empty($content['links'])) {
    ?>
        <footer>
            <?php 
    print render($content['field_tags']);
    ?>
            <?php 
    print render($content['links']);
    ?>
        </footer>
?>
>   
      <div class="node-header">
        <?php 
print $name;
if (array_key_exists('group_audience', $content)) {
    print " &#8658; ";
    print render($content['group_audience'][0]);
}
?>
      </div>
      <div class="node-body">
      <?php 
hide($content['comments']);
hide($content['links']);
hide($content['comment_form']);
print render($content);
?>
      </div>
      <?php 
// Remove the "Add new comment" link if the comment
// form is being displayed on the same page.
if (!empty($content['comments']['comment_form'])) {
    unset($content['links']['comment']['#links']['comment-add']);
}
// Only display the wrapper div if there are links.
$links = render($content['links']);
if ($links) {
    ?>
      <div class="link-wrapper">
        <?php 
    if (!empty($node->image)) {
        ?>
        <a href="<?php 
        print $node->node_url;
        ?>
"><?php 
        print $node->image;
        ?>
</a>
      <?php 
    }
    ?>
    </div>

      <div class='expert_network_text_block'>
          <?php 
    hide($content['comments']);
    hide($content['links']);
    hide($content['field_single_image']);
    print render($content);
    ?>
      </div>
      
  </div>
</div>
<?php 
}
?>


}
?>
    <!-- Tagline -->
    <div class="section-csrc-tagline">
      <?php 
print render($content['field_section_tagline']);
?>
    </div>


    <?php 
// We hide the comments and links now so that we can render them later.
hide($content['comments']);
// hide($content['links']);
hide($content['field_section_cover_image']);
hide($content['field_section_tagline']);
print render($content);
?>

    <a class="section-btn-postion btn btn-primary btn-lg" href="#updates" role="button">Project Updates</a>

  </div>


</div>

<a name="updates"></a>

<!-- Changes button to read as message
if no link added to register-button
field on admin form -->
    print $submitted;
    ?>
      </div>
    <?php 
}
?>

    <div class="content"<?php 
print $content_attributes;
?>
>
      <?php 
// We hide the comments and links now so that we can render them later.
hide($content['comments']);
hide($content['links']);
hide($content['field_est_lat_lot']);
print render($content);
?>
    </div>

    <?php 
print render($content['links']);
?>
    <?php 
print render($content['comments']);
?>
  </div>

  <div class="col-md-6">
    <?php 
print render($content['field_est_lat_lot']);
Example #15
0
  <?php 
}
?>

  <div class="article_content"<?php 
print $content_attributes;
?>
>
    <?php 
// Hide comments, tags, and links now so that we can render them later.
hide($content['taxonomy_forums']);
hide($content['comments']);
hide($content['links']);
hide($content['field_tags']);
hide($content['field_image']);
print render($content);
?>
  </div>

  <div class="post_share_wrap">
    <ul class="post_share">
      <li><a href="http://twitter.com/home?status=<?php 
print $share_url;
?>
"><i class="social foundicon-twitter"></i></a></li>
      <li><a href="http://www.facebook.com/sharer.php?u=<?php 
print $share_url;
?>
"><i class="social foundicon-facebook"></i></a></li>
      <li><a href="http://www.stumbleupon.com/submit?url=<?php 
  </div><!-- /.row -->

  <div class="content"<?php 
print $content_attributes;
?>
>
    <?php 
// We hide the comments and links now so that we can render them later.
hide($content['comments']);
hide($content['links']);
hide($content['field_date']);
hide($content['field_is_free']);
hide($content['field_age_range']);
hide($content['field_campaign_type']);
hide($content['field_image']);
hide($content['field_establishment']);
print render($content);
?>

    <?php 
print render($content['links']);
?>
    <?php 
print render($content['comments']);
?>

    <?php 
if ($content['field_campaign_type']) {
    ?>
      <?php 
    print render($content['field_campaign_type']);
    ?>
    </header>
  <?php 
}
?>

  <?php 
// We hide the comments and links now so that we can render them later.
hide($content['comments']);
hide($content['links']);
// unset to render below after a div
if (isset($content['field_related_oshwiki_articles'])) {
    hide($content['field_related_oshwiki_articles']);
}
if (isset($content['field_aditional_resources'])) {
    hide($content['field_aditional_resources']);
}
print render($content);
// render related publications(dynamic from template preprocess_node
if ($view_mode == 'full') {
    if ($total_related_publications > 0) {
        ?>
      <div id="related-publications">
        <div class="related_publications_head"><span><?php 
        print t('Related publications');
        ?>
<span></div>
      <div>
    <?php 
        foreach ($tagged_related_publications as $related_pub) {
            print render($related_pub);
Example #18
0
    print $submitted;
    ?>
    </div>
  <?php 
}
?>

  <div class="content"<?php 
print $content_attributes;
?>
>
    <?php 
// We hide the comments and links now so that we can render them later.
hide($content['comments']);
hide($content['links']);
hide($content['field_rich_title']);
print render($content);
$bnav = '';
$bnav .= booktree_mostra_figli($node->book['mlid'], $node->nid, $node->title, 1, 3, 500, $node->book['mlid']);
print render($bnav);
?>
  </div>

  <!--<?php 
//print render($content['links']);
?>
-->

  <?php 
print render($content['comments']);
?>
<div class="accordion-group">
    <div class="accordion-heading">
        <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapse<?php 
echo $node->nid;
?>
">
            <em class="fa fa-plus icon-fixed-width"></em><?php 
echo $title;
?>
        </a>
    </div>
    <div id="collapse<?php 
echo $node->nid;
?>
" class="accordion-body collapse">
        <div class="accordion-inner">
            <?php 
// Hide comments, tags, and links now so that we can render them later.
hide($content['links']);
hide($content['comments']);
print render($content);
?>
        </div>
    </div>
</div>
      <?php 
    print $submitted;
    ?>
    </div>
  <?php 
}
?>

  <div class="content"<?php 
print $content_attributes;
?>
>
    <?php 
// We hide the comments and links now so that we can render them later.
hide($content['comments']);
hide($content['links']);
hide($content['body']);
print render($content);
?>
  </div>

  <?php 
print render($content['links']);
?>

  <?php 
print render($content['comments']);
?>

</div>
}
?>
    <?php 
if (!empty($body)) {
    ?>
      <div id="description">
        <?php 
    print render($content['body']);
    ?>
      </div>
    <?php 
}
?>
    <div class="details">
      <?php 
hide($content['field_program']);
?>
      <?php 
print render($content);
?>
    </div>
    <?php 
if (!empty($content['field_program'])) {
    ?>
      <div id="programs">
        <h4>Associated Programs</h4>
        <?php 
    print render($content['field_program']);
    ?>
      </div>
    <?php 
Example #22
0
}
?>
    <div class="taxonomy">
      <?php 
print render($content['field_category']);
?>
      <?php 
print render($content['field_tags']);
?>
    </div>
  </header>

  <?php 
// Hide comments, tags, and links now so that we can render them later.
hide($content['links']);
hide($content['field_comment']);
print render($content);
?>
</article> <!-- /.node -->

<?php 
if (!empty($content['links']) || !empty($content['field_comment'])) {
    ?>
  <footer>
    <?php 
    print render($content['field_comment']);
    ?>
    <?php 
    print render($content['links']);
    ?>
  </footer>
 * Variables available:
 * - $pane->type: the content type inside this pane
 * - $pane->subtype: The subtype, if applicable. If a view it will be the
 *   view name; if a node it will be the nid, etc.
 * - $title: The title of the content
 * - $content: The actual content
 * - $links: Any links associated with the content
 * - $more: An optional 'more' link (destination only)
 * - $admin_links: Administrative links associated with the content
 * - $feeds: Any feed icons or associated with the content
 * - $display: The complete panels display object containing all kinds of
 *   data including the contexts and all of the other panes being displayed.
 */
$text = $content['mailchimp_lists']['mailchimp_nyt_fra_ringsted_kongrescenter']['mergevars']['TEXT'];
$text['#markup'] = '<div class="mailchimp-text">"Nyt Fra Ringsted Kongrescenter" med nyheder, inspiration, events og meget mere.</div>';
hide($text);
$content['mailchimp_lists']['mailchimp_nyt_fra_ringsted_kongrescenter']['mergevars']['EMAIL']['#attributes']['placeholder'] = 'Skriv din email her';
?>
<div class="content">
  <?php 
if ($pane_prefix) {
    ?>
    <?php 
    print $pane_prefix;
    ?>
  <?php 
}
?>
  <div class="<?php 
print $classes;
?>
?>
  
  <div class="article_content"<?php 
print $content_attributes;
?>
>
  
  
  
    <?php 
// Hide comments, tags, and links now so that we can render them later.
hide($content['taxonomy_forums']);
hide($content['comments']);
hide($content['links']);
hide($content['field_portfolio_image']);
hide($content['field_portfolio_tags']);
?>
	
	
  </div>
  
<?php 
if (!$page) {
    ?>
  </article> <!-- /.node -->
<?php 
}
?>

  </div>
  </div>
	
	<div class="content clearfix"<?php 
print $content_attributes;
?>
>
		<div class="comic-page-nav top clearfix">
			<?php 
print render($content['nav_links']);
?>
		</div>
	  <?php 
// We hide the comments and links now so that we can render them later.
hide($content['comments']);
hide($content['links']);
hide($content['disqus']);
print render($content);
?>
	  <div class="comic-page-nav bottom clearfix">
		<?php 
print render($content['nav_links']);
?>
		</div>
	</div>
	
	<div id="comments" class="stick-bg">
		
		<h2 class="title sticky-title">Comments</h2>
		<?php 
//print render($content['comments']);
?>
Example #26
0
/**
 * Override or insert variables into the node templates.
 */
function commons_beehive_preprocess_node(&$variables, $hook)
{
    $node = $variables['node'];
    // Some content does not get a user image on the full node.
    $no_avatar = array('event', 'group', 'page', 'wiki');
    if (!$variables['teaser'] && in_array($node->type, $no_avatar)) {
        $variables['user_picture'] = '';
    }
    // If there does happen to be a user image, add a class for styling purposes.
    if (!empty($variables['user_picture'])) {
        $variables['classes_array'][] = 'user-picture-available';
    }
    // Style node links like buttons.
    if (isset($variables['content']['links'])) {
        foreach ($variables['content']['links'] as $type => &$linkgroup) {
            // Button styling for the "rate" and "flag" types will be handled
            // separately.
            if ($type != 'rate' && $type != 'flag' && substr($type, 0, 1) != '#') {
                foreach ($linkgroup['#links'] as $name => &$link) {
                    // Prevent errors when no classes have been defined.
                    if (!isset($link['attributes']['class'])) {
                        $link['attributes']['class'] = array();
                    }
                    // Apply button classes to everything but comment_forbidden.
                    if ($name != 'comment_forbidden' && $name != 'answer-add' && !is_string($link['attributes']['class'])) {
                        $link['attributes']['class'][] = 'action-item-small';
                        $link['attributes']['class'][] = 'action-item-inline';
                    } elseif ($name != 'comment_forbidden' && $name != 'answer-add') {
                        $link['attributes']['class'] .= ' action-item-small action-item-inline';
                    }
                }
                // Clean the reference so it does not confuse things further down.
                unset($link);
            }
        }
    }
    // Add classes to render the comment-comments link as a button with a number
    // attached.
    if (!empty($variables['content']['links']['comment']['#links']['comment-comments'])) {
        $comments_link =& $variables['content']['links']['comment']['#links']['comment-comments'];
        $comments_link['attributes']['class'][] = 'link-with-counter';
        $chunks = explode(' ', $comments_link['title']);
        // Add appropriate classes to words in the title.
        foreach ($chunks as &$chunk) {
            if ($chunk == $variables['comment_count']) {
                $chunk = '<span class="action-item-small-append">' . $variables['comment_count'] . '</span>';
            } else {
                $chunk = '<span class="element-invisible">' . $chunk . '</span>';
            }
        }
        $comments_link['title'] = implode(' ', $chunks);
    }
    // Push the reporting link to the end.
    if (!empty($variables['content']['links']['flag']['#links']['flag-inappropriate_node'])) {
        $variables['content']['report_link'] = array('#markup' => $variables['content']['links']['flag']['#links']['flag-inappropriate_node']['title']);
    }
    if (!empty($variables['content']['links'])) {
        // Hide some of the node links.
        $hidden_links = array('node' => array('node-readmore'), 'comment' => array('comment-add', 'comment-new-comments'), 'flag' => array('flag-inappropriate_node'));
        foreach ($hidden_links as $element => $links) {
            foreach ($links as $link) {
                if (!empty($variables['content']['links'][$element]['#links'][$link])) {
                    $variables['content']['links'][$element]['#links'][$link]['#access'] = FALSE;
                }
            }
        }
    }
    // Add a class to the node when there is a logo image.
    if (!empty($variables['field_logo'])) {
        $variables['classes_array'][] = 'logo-available';
    }
    // Move the answer link on question nodes to the top of the content.
    if ($variables['node']->type == 'question' && !empty($variables['content']['links']['answer'])) {
        $variables['content']['answer'] = $variables['content']['links']['answer'];
        $variables['content']['answer']['#attributes']['class'][] = 'node-actions';
        $variables['content']['answer']['#links']['answer-add']['attributes']['class'][] = 'action-item-primary';
        $variables['content']['answer']['#weight'] = -100;
        $variables['content']['links']['answer']['#access'] = FALSE;
    }
    // Groups the related fields into their own container.
    $related_information = array('og_group_ref', 'field_related_question', 'field_topics');
    foreach ($related_information as $field) {
        if (!empty($variables['content'][$field])) {
            $variables['content']['related_information'][$field] = $variables['content'][$field];
            hide($variables['content'][$field]);
        }
    }
    if (!empty($variables['content']['related_information'])) {
        $variables['content']['related_information'] += array('#theme_wrappers' => array('container'), '#attributes' => array('class' => array('related-information', 'clearfix')), '#weight' => 1000);
    }
    // Add classes when there is a voting widget present.
    if (!empty($variables['content']['rate_commons_answer'])) {
        $variables['content_attributes_array']['class'][] = 'has-rate-widget';
        $variables['content']['rate_commons_answer']['#weight'] = 999;
    }
    // Add a general class to the node links.
    if (!empty($variables['content']['links'])) {
        $variables['content']['links']['#attributes']['class'][] = 'node-action-links';
        // For some reason, the node links processing is not always added and
        // multiple ul elements are output instead of a single.
        if (!isset($variables['content']['links']['#pre_render']) || !in_array('drupal_pre_render_links', $variables['content']['links']['#pre_render'])) {
            $variables['content']['links']['#pre_render'][] = 'drupal_pre_render_links';
        }
    }
}
Example #27
0
        ?>
</p>
      <?php 
    }
    ?>
    </header>
  <?php 
}
?>

  <div class="content">
    <?php 
// We hide the comments to render below.
hide($content['comments']);
hide($content['links']);
hide($content['links']['#links']['comment-add']);
print render($content);
?>
  </div> <!-- /content -->

  <?php 
if (!empty($content['links']['terms'])) {
    ?>
    <div class="terms">
      <?php 
    print render($content['links']['terms']);
    ?>
    </div> <!-- /terms -->
  <?php 
}
?>
</span>
	    <?php 
    }
    ?>
        </p>
        <?php 
    print render($content['product:field_product_description']);
    ?>
        <?php 
    hide($content['field_rating']);
    hide($content['product:field_image']);
    hide($content['product:commerce_price']);
    hide($content['field_product_category']);
    hide($content['field_tags']);
    hide($content['product:field_commerce_saleprice']);
    hide($content['product:field_product_details']);
    print render($content);
    ?>
        </p>
    </div>
</div>
<div class="row">
    <div class="col-lg-12">
        <div class="m-tabs tabs-info-product" data-active="1">
            <header>
                <span><i class="glyphicon glyphicon-globe"></i><?php 
    print t('Product details');
    ?>
</span>
                <span><i class="glyphicon glyphicon-tower"></i><?php 
    print t('Rating');
        <mark class="unpublished"><?php 
        print t('Unpublished');
        ?>
</mark>
      <?php 
    }
    ?>
    </header>
  <?php 
}
?>

  <?php 
// We hide the comments and links now so that we can render them later.
hide($content['comments']);
hide($content['links']);
if ($page && $title) {
    print "<h2>Over {$title}</h2>";
}
print render($content);
?>

  <?php 
print render($content['links']);
?>

  <?php 
print render($content['comments']);
?>

</article>
Example #30
0
function action($_arg)
{
    //------------------------------------------------------------------------------
    // extrace action from coordinate system
    while ($entry = each($_arg)) {
        $argArray = explode("_", $entry[key]);
        if (count($argArray) > 1) {
            $indexString = $argArray[0];
            $valueString = $argArray[1];
            $_arg[$indexString] = $valueString;
            if (isset($argArray[2])) {
                $_arg['_ID'] = $argArray[2];
            }
        }
    }
    //echoalert($_arg);
    //echoalert($_SESSION);
    //------------------------------------------------------------------------------
    // parse reset value
    if ($_arg[reset]) {
        $_arg = array();
        session::destroy(searchshow);
        session::destroy(show);
        session::destroy(search);
        session::destroy(searchtype);
        session::destroy(searchcom);
        session::destroy(searchorder);
        session::destroy(searchString);
        session::destroy(searchexact);
        session::destroy(searchstart);
        session::destroy(searchowner);
        session::destroy(searchentrytype);
        session::destroy(searchstatus);
    }
    //------------------------------------------------------------------------------
    // parse action parameter
    switch ($_arg[action]) {
        //------------------------------------------------------------------------------
        // login / out
        case login:
            // login user
            user::login($_arg[user], $_arg[password]);
            // restore program status if new session
            restore_status();
            // reset linking
            session::destroy("linkaction");
            session::destroy("link");
            break;
        case logout:
            // logout user
            user::logout();
            break;
        case changedo:
            // change password
            if ($password = $_GET[password]) {
                database::query("UPDATE user SET password='******' WHERE ID='" . session::get("user") . "'");
                echojavascript("Passwort erfolgreich geƤndert");
            }
            break;
            //------------------------------------------------------------------------------
            // inherit entrytype to children
        //------------------------------------------------------------------------------
        // inherit entrytype to children
        case inherit:
            $childArray = thesaurus::get_child($_arg[id]);
            foreach ($childArray as $entry) {
                database::query("UPDATE entry SET entrytype={$_arg['entrytype']} WHERE ID={$entry}");
            }
            break;
            //------------------------------------------------------------------------------
        //------------------------------------------------------------------------------
        case update:
            if ($_arg[orderdefault]) {
                session::set(orderdefault, $_arg[id]);
            } elseif (isset($_arg[orderdefault])) {
                session::destroy(orderdefault);
            }
            break;
            //------------------------------------------------------------------------------
        //------------------------------------------------------------------------------
        case edit:
            session::set("edit", TRUE);
            session::set("show", $_arg[id]);
            session::destroy("searchshow");
            break;
        case noedit:
            session::destroy("edit");
            break;
            //------------------------------------------------------------------------------
        //------------------------------------------------------------------------------
        case open:
            session::open($_arg[id]);
            break;
        case close:
            session::close($_arg[id]);
            break;
        case closeall:
            session::close_all();
            break;
            //------------------------------------------------------------------------------
        //------------------------------------------------------------------------------
        case deleteid:
            end_link();
            hide();
            database::delete($_arg[id]);
            break;
            //------------------------------------------------------------------------------
        //------------------------------------------------------------------------------
        case suchen:
            if (!$_arg[searchString] and ($_arg[searchowner] or $_arg[searchtype] or $_arg[searchstatus])) {
                $_arg[searchString] = "%";
            }
            if ($_arg[searchString]) {
                session::set("searchshow", true);
            }
            // show search result
            session::set("search", $_arg[searchString]);
            session::set("searchcom", $_arg[searchcom]);
            session::set("searchorder", $_arg[searchorder]);
            session::set("searchentrytype", $_arg[searchentrytype]);
            session::set("searchstatus", $_arg[searchstatus]);
            if ($_arg[searchowner]) {
                session::set("searchowner", $_arg[searchowner]);
            } else {
                session::destroy("searchowner");
            }
            switch ($_arg[searchtype]) {
                case 0:
                    session::destroy("searchexact");
                    session::destroy("searchstart");
                    break;
                case 1:
                    session::destroy("searchexact");
                    session::set("searchstart", TRUE);
                    break;
                case 2:
                    session::destroy("searchstart");
                    session::set("searchexact", TRUE);
                    break;
            }
            break;
        case hidesearch:
            session::destroy(searchshow);
            break;
            //------------------------------------------------------------------------------
        //------------------------------------------------------------------------------
        case show:
            session::destroy("searchshow");
            $_arg[linkaction] = "";
            if ($_arg[id] == NULL) {
                break;
            } elseif ($_arg[id] > 0) {
                session::set("show", $_arg[id]);
                break;
            } else {
                session::delete("show");
                break;
            }
            break;
            //------------------------------------------------------------------------------
        //------------------------------------------------------------------------------
        case swap:
            if ($_arg[id]) {
                thesaurus::swap_link($_arg[id], $_arg[_ID]);
            }
            break;
        case change:
            if ($_arg[id]) {
                //        thesaurus::change_link($_arg);
            }
            break;
        case add:
            // add new descriptor
            session::destroy("show");
            session::destroy("searchshow");
            //      session::set("",1);
            break;
            // clean database
        // clean database
        case correct:
            thesaurus::validate(true);
            echoalert("Datenbank bereinigt");
            break;
            //------------------------------------------------------------------------------
            // open hyrarchy down to selected entry
        //------------------------------------------------------------------------------
        // open hyrarchy down to selected entry
        case showhyrarchy:
            if ($_arg[id]) {
                $hyrarchyArray = thesaurus::get_hyrarchy($_arg[id]);
                // don't open selected entry
                //        array_pop($hyrarchyArray);
                foreach ($hyrarchyArray as $entry) {
                    //        echo $entry . " ";
                    echo session::open($entry);
                }
                session::set("hyrarchy", TRUE);
                // hide search window
                session::destroy("searchshow");
                // if nothing selected for display, show ID
                if (!session::get(show)) {
                    session::set("show", $_arg[id]);
                }
                break;
            }
            //------------------------------------------------------------------------------
            // debug on/off
        //------------------------------------------------------------------------------
        // debug on/off
        case debugon:
            system::setval(debug, TRUE);
            break;
        case debugoff:
            system::setval(debug, FALSE);
            // legend on/off
        // legend on/off
        case legendon:
            session::set("legend", TRUE);
            break;
        case legendoff:
            session::destroy("legend");
            break;
            // display / hide non descriptors
        // display / hide non descriptors
        case toggleND:
            if (session::get("descriptor")) {
                session::destroy("descriptor");
            } else {
                session::set("descriptor", TRUE);
            }
            break;
            // display / hide orders
        // display / hide orders
        case toggleVI:
            if (session::get("visible")) {
                session::destroy("visible");
            } else {
                session::set("visible", TRUE);
            }
            break;
            // toggle tooltips on/off
        // toggle tooltips on/off
        case off:
            session::set("tooltips", TRUE);
            break;
        case on:
            session::destroy("tooltips");
            break;
            // toggle hyrarchy
        // toggle hyrarchy
        case hyrarchyon:
            session::set("hyrarchy", TRUE);
            break;
        case hyrarchyoff:
            session::set("hyrarchy", FALSE);
            break;
    }
    //------------------------------------------------------------------------------
    // parse linkaction parameter
    switch ($_arg[linkaction]) {
        // link
        case link:
            session::set("link", $_arg[id]);
            session::set("linkaction", $_arg[linkaction]);
            session::set("linktype", $_arg[linktype]);
            break;
            // execute linking
        // execute linking
        case linkdo:
            switch (session::get('linkaction')) {
                case link:
                    database::parent_insert(session::get("link"), $_arg[id], session::get("linktype"));
                    session::set("show", session::get("link"));
                    // set display to linked objects
                    // with BS set linked descriptor to "no descriptor"
                    if (session::get("linktype") == 2) {
                        database::set_desc($_arg[id], 0);
                    }
                    //          session::destroy("link"); // end linking
                    break;
                case change:
                    database::link_change(session::get('linkparent'), session::get('link'), $_arg['id']);
                    // parent,oldlink,newlink
                    break;
            }
            break;
        case linkend:
            end_link();
            break;
            // unlink
        // unlink
        case unlink:
            if ($_arg[id]) {
                database::parent_delete(session::get("show"), $_arg[id]);
            }
            break;
            // change OB
        // change OB
        case change:
            if ($_arg[id]) {
                session::set("link", $_arg[id]);
                session::set("linkaction", $_arg[linkaction]);
                session::set("linkparent", $_arg[_ID]);
                session::set("linktype", $_arg[linktype]);
            }
            break;
    }
    // TEMP SETTINGS
    // if not link rights, set descriptor and visible to true
    if (!right::link()) {
        session::set(descriptor, FALSE);
    }
    //if (!right::link()) session::set(visible,TRUE);
    // save program status
    save_status($_SESSION);
}