예제 #1
0
function teca3_links__locale_block(&$variables)
{
    $variables['attributes']['class'][] = 'nav';
    $variables['attributes']['class'][] = 'navbar-nav';
    return theme_links($variables);
    //return '<ul class="language-switcher-locale-url nav nav-pills">'.$variables['tree'].'</ul>';
}
예제 #2
0
/**
  Draw menu.
*/
function k373k_links($variables) {
  if (array_key_exists('id', $variables['attributes']) && $variables['attributes']['id'] == 'main-menu-links') {
      $pid = variable_get('menu_main_links_source', 'main-menu');
    $tree = menu_tree($pid);
    return drupal_render($tree);
  }
  return theme_links($variables);
}
예제 #3
0
/**
 * @file
 * template.php
 */
function paeme_links__locale_block(&$vars)
{
    foreach ($vars['links'] as $language => $langInfo) {
        $vars['links'][$language]['title'] = $language;
    }
    $content = theme_links($vars);
    return $content;
}
예제 #4
0
파일: template.php 프로젝트: maxocub/solsud
/**
 * Implements theme_links().
 */
function solsud_links($variables)
{
    if (array_key_exists('id', $variables['attributes']) && $variables['attributes']['id'] == 'main-menu-links') {
        $tree = menu_tree('main-menu');
        return drupal_render($tree);
    }
    return theme_links($variables);
}
예제 #5
0
function bartik_plus_links($variables)
{
    if (array_key_exists('id', $variables['attributes']) && $variables['attributes']['id'] == 'main-menu-links') {
        $pid = variable_get('menu_main_links_source', 'main-menu');
        $tree = menu_tree($pid);
        return '<div id="main-menu-links">' . drupal_render($tree) . "</div>";
    }
    return theme_links($variables);
}
예제 #6
0
function THEME_links__locale_block(&$vars)
{
    foreach ($vars['links'] as $language => $langInfo) {
        $abbr = $langInfo['language']->language;
        $name = $langInfo['language']->native;
        $vars['links'][$language]['title'] = '<abbr title="' . $name . '">' . $abbr . '</abbr>';
        $vars['links'][$language]['html'] = TRUE;
    }
    $content = theme_links($vars);
    return $content;
}
예제 #7
0
/**
 * Implements theme_links().
 */
function glossy_links($vars) {
	// Add superfish dropdowns effect to main menu
  if (array_key_exists('id', $vars['attributes']) && $vars['attributes']['id'] == 'main-menu' && variable_get('dh_display_menu_tree', true)) {
      $pid = variable_get('menu_main_links_source', 'main-menu');
			$tree = menu_tree($pid);
			$output = drupal_render($tree);
			$output = '<div class="superfish">' .$output. '</div>';
			return preg_replace('/<ul class="menu/i', '<ul class="main-menu clearfix', $output, 1);
  }
  return theme_links($vars);
}
예제 #8
0
파일: template.php 프로젝트: lcube45/hyx
function hyx_links__locale_block(&$variables)
{
    global $language;
    $variables['attributes']['class'][] = 'list-inline';
    foreach ($variables['links'] as $id => $link) {
        $variables['links'][$id]['attributes']['class'][] = 'btn hyx-radio';
        //$variables['links'][$id]['attributes']['data-title-xs'] = ucfirst($id);
        $variables['links'][$id]['title'] = ucfirst($id);
    }
    $content = theme_links($variables);
    return $content;
}
예제 #9
0
function phptemplate_taxonomy_links($node, $vid)
{
    if (count($node->taxonomy)) {
        $tags = array();
        foreach ($node->taxonomy as $term) {
            if ($term->vid == $vid) {
                $tags[] = array('title' => $term->name, 'href' => taxonomy_term_path($term), 'attributes' => array('rel' => 'tag'));
            }
        }
        if ($tags) {
            return theme_links($tags, array('class' => 'links inline'));
        }
    }
}
예제 #10
0
function mies_links($links, $attributes = array('class' => 'links'))
{
    global $teaser;
    //dprint_r($links);
    // Unset the "node read more" link.
    if (isset($links["node_read_more"])) {
        $readmore = $links["node_read_more"];
        unset($links["node_read_more"]);
        //array_push($links,$readmore);
    }
    // Redirect the "comment add" to the Node-Page
    if (isset($links["comment_add"])) {
        $links["comment_add"]["href"] = ereg_replace("comment/reply", "node", $links["comment_add"]["href"]);
    }
    return theme_links($links, $attributes);
}
function popularity_page() {
  print theme_header(FALSE);
  print <<<EOS
<h1>How do we calculate popularity?</h1>

<p>In Status Time Capsule, your popularity depends on:</p>

<ul>
  <li>average number of comments per status,</li>
  <li>average number of likes per status, and</li>
  <li>variance of these numbers among your statuses.</li>
</ul>

<p>Therefore, someone that consistently attracts comments and likes to all of his/her statuses may be ranked as more popular, compared to someone that has occasional popular statuses (with lots of likes and comments).</p>

<p>Technically, we calculate the lower bound of Wilson score confidence interval for a Bernoulli parameter for each user of our app. Then, we rank these lower bound values and derive the top most popular users as well as the percentage of people ranked below yours. For more explanation about the algorithm, see <a href="http://www.evanmiller.org/how-not-to-sort-by-average-rating.html">the article by Evan Miller</a>.</p>

EOS;
  print theme_links();
  print theme_footer();
  // Ugly error suppression
  @log_insert('popularity_hit');
}
예제 #12
0
function _phptemplate_links_inline($links, $attributes)
{
    foreach ($links as $key => $link) {
        $index = strpos($key, '_');
        if (!$index) {
            $index = strpos($key, '-');
        }
        if ($index) {
            $group = substr($key, 0, $index);
        } else {
            $group = 'other';
        }
        $link_groups[$group][$key] = $link;
    }
    $output = '';
    if (count($link_groups) == 0) {
        return '';
    } else {
        if (count($link_groups) == 1) {
            return theme_links($links, $attributes);
        } else {
            $output = '<div' . drupal_attributes($attributes) . ">\n";
            foreach ($link_groups as $group => $links) {
                $output .= _phptemplate_links_as_div($links, array('class' => "link-group link-group-{$group}")) . "\n";
            }
            $output .= '</div>';
            return $output;
        }
    }
}
 /**
  * Render the links to display when editing a pane.
  */
 function get_pane_links($pane, $content_type)
 {
     if (!empty($this->no_edit_links)) {
         return '';
     }
     $links = array();
     if (!empty($pane->shown)) {
         $links['top']['disabled'] = array('title' => t('Disable this pane'), 'href' => $this->get_url('hide', $pane->pid), 'attributes' => array('class' => array('use-ajax')));
     } else {
         $links['top']['enable'] = array('title' => t('Enable this pane'), 'href' => $this->get_url('show', $pane->pid), 'attributes' => array('class' => array('use-ajax')));
     }
     if (isset($this->display->title_pane) && $this->display->title_pane == $pane->pid) {
         $links['top']['panels-set-title'] = array('title' => t('&#x2713;Panel title'), 'html' => TRUE);
     } else {
         $links['top']['panels-set-title'] = array('title' => t('Panel title'), 'href' => $this->get_url('panel-title', $pane->pid), 'attributes' => array('class' => array('use-ajax')));
     }
     $subtype = ctools_content_get_subtype($content_type, $pane->subtype);
     if (ctools_content_editable($content_type, $subtype, $pane->configuration)) {
         $links['top']['settings'] = array('title' => isset($content_type['edit text']) ? $content_type['edit text'] : t('Settings'), 'href' => $this->get_url('edit-pane', $pane->pid), 'attributes' => array('class' => array('ctools-use-modal')));
     }
     if (user_access('administer advanced pane settings')) {
         $links['top']['css'] = array('title' => t('CSS properties'), 'href' => $this->get_url('pane-css', $pane->pid), 'attributes' => array('class' => array('ctools-use-modal')));
     }
     if (user_access('administer panels styles')) {
         $links['style'] = $this->get_style_links('pane', $pane->pid);
     }
     if (user_access('administer pane access')) {
         $contexts = $this->display->context;
         // Make sure we have the logged in user context
         if (!isset($contexts['logged-in-user'])) {
             $contexts['logged-in-user'] = ctools_access_get_loggedin_context();
         }
         $visibility_links = array();
         if (!empty($pane->access['plugins'])) {
             foreach ($pane->access['plugins'] as $id => $test) {
                 $plugin = ctools_get_access_plugin($test['name']);
                 $access_title = isset($plugin['title']) ? $plugin['title'] : t('Broken/missing access plugin %plugin', array('%plugin' => $test['name']));
                 $access_description = ctools_access_summary($plugin, $contexts, $test);
                 $visibility_links[] = array('title' => $access_description, 'href' => $this->get_url('access-configure-test', $pane->pid, $id), 'attributes' => array('class' => array('ctools-use-modal', 'panels-italic')));
             }
         }
         if (empty($visibility_links)) {
             $visibility_links['no_rules'] = array('title' => t('No rules'), 'attributes' => array('class' => array('panels-text')));
         }
         $visibility_links['add_rule'] = array('title' => t('Add new rule'), 'href' => $this->get_url('access-add-test', $pane->pid), 'attributes' => array('class' => array('ctools-use-modal')));
         $visibility_links['settings'] = array('title' => t('Settings'), 'href' => $this->get_url('access-settings', $pane->pid), 'attributes' => array('class' => array('ctools-use-modal')));
         $links['visibility'] = $visibility_links;
     }
     if (user_access('use panels locks')) {
         $lock_type = !empty($pane->locks['type']) ? $pane->locks['type'] : 'none';
         switch ($lock_type) {
             case 'immovable':
                 $lock_method = t('Immovable');
                 break;
             case 'regions':
                 $lock_method = t('Regions');
                 break;
             case 'none':
             default:
                 $lock_method = t('No lock');
                 break;
         }
         $lock_links['lock'] = array('title' => $lock_method, 'attributes' => array('class' => array('panels-text')));
         $lock_links['change'] = array('title' => t('Change'), 'href' => $this->get_url('lock', $pane->pid), 'attributes' => array('class' => array('ctools-use-modal')));
         $links['lock'] = $lock_links;
     }
     if (panels_get_caches() && user_access('use panels caching features')) {
         $method = isset($pane->cache['method']) ? $pane->cache['method'] : 0;
         $info = panels_get_cache($method);
         $cache_method = isset($info['title']) ? $info['title'] : t('No caching');
         $cache_links['title'] = array('title' => $cache_method, 'attributes' => array('class' => array('panels-text')));
         $cache_links['change'] = array('title' => t('Change'), 'href' => $this->get_url('cache-method', $pane->pid), 'attributes' => array('class' => array('ctools-use-modal')));
         if (panels_plugin_get_function('cache', $info, 'settings form')) {
             $cache_links['settings'] = array('title' => t('Settings'), 'href' => $this->get_url('cache-settings', $pane->pid), 'attributes' => array('class' => array('ctools-use-modal')));
         }
         $links['cache'] = $cache_links;
     }
     $links['bottom']['remove'] = array('title' => t('Remove'), 'href' => '#', 'attributes' => array('class' => array('pane-delete'), 'id' => "pane-delete-panel-pane-{$pane->pid}"));
     // Allow others to add/remove links from pane context menu.
     // Grouped by 'top', 'style', 'visibility', 'lock', 'cache' and 'bottom'
     drupal_alter('get_pane_links', $links, $pane, $content_type);
     $dropdown_links = $links['top'];
     $category_labels = array('style' => 'Style', 'visibility' => 'Visibility rules', 'lock' => 'Locking', 'cache' => 'Caching');
     foreach ($category_labels as $category => $label) {
         if (array_key_exists($category, $links)) {
             $dropdown_links[] = array('title' => '<hr />', 'html' => TRUE);
             $dropdown_links[] = array('title' => '<span class="dropdown-header">' . t($label) . '</span>' . theme_links(array('links' => $links[$category], 'attributes' => array(), 'heading' => array())), 'html' => TRUE, 'attributes' => array('class' => array('panels-sub-menu')));
         }
     }
     $dropdown_links[] = array('title' => '<hr />', 'html' => TRUE);
     $dropdown_links = array_merge($dropdown_links, $links['bottom']);
     return theme('ctools_dropdown', array('title' => theme('image', array('path' => ctools_image_path('icon-configure.png', 'panels'))), 'links' => $dropdown_links, 'image' => TRUE));
 }
예제 #14
0
function zen_swissmon_links($variables)
{
    if (!isset($variables['links'])) {
        return theme_links($variables);
    }
    $links = $variables['links'];
    foreach ($links as $key => $link) {
        if ($link['title'] == t('My account')) {
            global $user;
            $link['title'] = t('Signed in as') . ' ' . $user->name;
        }
        $links[$key] = $link;
    }
    $variables['links'] = $links;
    return theme_links($variables);
}
예제 #15
0
파일: event.php 프로젝트: pvidali/BCSR-1
		</div>
		
		<div id="hc_popular" style="display:none;">
		<?php 
event_list(1);
?>
		
		</div>
		
		<div id="hc_newest" style="display:none;">
		<?php 
event_list(2);
?>
		
		</div>
		
		<h2>Theme: <?php 
select_theme();
?>
</h2>
		
		<h2>&nbsp;</h2>
		<?php 
theme_links();
?>
		
	</aside>
	
	<?php 
get_footer();
  /**
   * Render the links to display when editing a pane.
   */
  function get_pane_links($pane, $content_type) {
    $links = array();

    if (!empty($pane->shown)) {
      $links[] = array(
        'title' => t('Disable this pane'),
        'href' => $this->get_url('hide', $pane->pid),
        'attributes' => array('class' => array('use-ajax')),
      );
    }
    else {
      $links[] = array(
        'title' => t('Enable this pane'),
        'href' => $this->get_url('show', $pane->pid),
        'attributes' => array('class' => array('use-ajax')),
      );
    }

    if (isset($this->display->title_pane) && $this->display->title_pane == $pane->pid) {
      $links['panels-set-title'] = array(
        'title' => t('&#x2713;Panel title'),
        'html' => TRUE,
      );
    }
    else {
      $links['panels-set-title'] = array(
        'title' => t('Panel title'),
        'href' => $this->get_url('panel-title', $pane->pid),
        'attributes' => array('class' => array('use-ajax')),
      );
    }

    $subtype = ctools_content_get_subtype($content_type, $pane->subtype);

    if (ctools_content_editable($content_type, $subtype, $pane->configuration)) {
      $links[] = array(
        'title' => isset($content_type['edit text']) ? $content_type['edit text'] : t('Settings'),
        'href' => $this->get_url('edit-pane', $pane->pid),
        'attributes' => array('class' => array('ctools-use-modal')),
      );
    }

    if (user_access('administer advanced pane settings')) {
      $links[] = array(
        'title' => t('CSS properties'),
        'href' => $this->get_url('pane-css', $pane->pid),
        'attributes' => array('class' => array('ctools-use-modal')),
      );
    }

    if (user_access('administer panels styles')) {
      $links[] = array(
        'title' => '<hr />',
        'html' => TRUE,
      );

      $style_links = $this->get_style_links('pane', $pane->pid);

      $links[] = array(
        'title' => '<span class="dropdown-header">' . t('Style') . '</span>' . theme_links(array('links' => $style_links, 'attributes' => array(), 'heading' => array())),
        'html' => TRUE,
        'attributes' => array('class' => array('panels-sub-menu')),
      );
    }

    if (user_access('administer pane access')) {
      $links[] = array(
        'title' => '<hr />',
        'html' => TRUE,
      );

      $contexts = $this->display->context;
      // Make sure we have the logged in user context
      if (!isset($contexts['logged-in-user'])) {
        $contexts['logged-in-user'] = ctools_access_get_loggedin_context();
      }

      $visibility_links = array();

      if (!empty($pane->access['plugins'])) {
        foreach ($pane->access['plugins'] as $id => $test) {
          $plugin = ctools_get_access_plugin($test['name']);
          $access_title  = isset($plugin['title']) ? $plugin['title'] : t('Broken/missing access plugin %plugin', array('%plugin' => $test['name']));
          $access_description = ctools_access_summary($plugin, $contexts, $test);

          $visibility_links[] = array(
            'title' => $access_description,
            'href' => $this->get_url('access-configure-test', $pane->pid, $id),
            'attributes' => array('class' => array('ctools-use-modal', 'panels-italic')),
          );
        }
      }
      if (empty($visibility_links)) {
        $visibility_links[] = array(
          'title' => t('No rules'),
          'attributes' => array('class' => array('panels-text')),
        );
      }

      $visibility_links[] = array(
        'title' => t('Add new rule'),
        'href' => $this->get_url('access-add-test', $pane->pid),
        'attributes' => array('class' => array('ctools-use-modal')),
      );

      $visibility_links[] = array(
        'title' => t('Settings'),
        'href' => $this->get_url('access-settings', $pane->pid),
        'attributes' => array('class' => array('ctools-use-modal')),
      );

      $links[] = array(
        'title' => '<span class="dropdown-header">' . t('Visibility rules') . '</span>' . theme_links(array('links' => $visibility_links, 'attributes' => array(), 'heading' => array())),
        'html' => TRUE,
        'attributes' => array('class' => array('panels-sub-menu')),
      );
    }

    if (panels_get_caches() && user_access('use panels caching features')) {
      $links[] = array(
        'title' => '<hr />',
        'html' => TRUE,
      );

      $method = isset($pane->cache['method']) ? $pane->cache['method'] : 0;
      $info = panels_get_cache($method);
      $cache_method = isset($info['title']) ? $info['title'] : t('No caching');
      $cache_links[] = array(
        'title' => $cache_method,
        'attributes' => array('class' => array('panels-text')),
      );
      $cache_links[] = array(
        'title' => t('Change'),
        'href' => $this->get_url('cache-method', $pane->pid),
        'attributes' => array('class' => array('ctools-use-modal')),
      );
      if (panels_plugin_get_function('cache', $info, 'settings form')) {
        $cache_links[] = array(
          'title' => t('Settings'),
          'href' => $this->get_url('cache-settings', $pane->pid),
          'attributes' => array('class' => array('ctools-use-modal')),
        );
      }

      $links[] = array(
        'title' => '<span class="dropdown-header">' . t('Caching') . '</span>' . theme_links(array('links' => $cache_links, 'attributes' => array(), 'heading' => array())),
        'html' => TRUE,
        'attributes' => array('class' => array('panels-sub-menu')),
      );
    }

    $links[] = array(
      'title' => '<hr />',
      'html' => TRUE,
    );

    $links[] = array(
      'title' => t('Remove'),
      'href' => '#',
      'attributes' => array(
        'class' => array('pane-delete'),
        'id' => "pane-delete-panel-pane-$pane->pid",
      ),
    );

    return theme('ctools_dropdown', array('title' => theme('image', array('path' => ctools_image_path('icon-configure.png', 'panels'))), 'links' => $links, 'image' => TRUE));
  }
예제 #17
0
파일: int.php 프로젝트: pvidali/BCSR-1
/**
 * Output RSS feed and iCalendar subscription links to a page outside of Helios Calendar.
 * @since 2.0.0
 * @version 2.0.0
 * @return void
 */
function int_links()
{
    theme_links();
}
예제 #18
0
function nys_links($links, $attributes = array('class' => 'links'))
{
    unset($links['node_read_more']);
    unset($links['blog_usernames_blog']);
    return theme_links($links, $attributes);
}
예제 #19
0
/**
* function to overwrite links. removes the reply link per node type
*
* @param $links
* @param $attributes
* @return unknown_type
*/
function fly_links($links, $attributes = array('class' => 'links'))
{
    // Link 'Add a comment' link to node page instead of comments reply page
    if ($links['comment_add']['href']) {
        $arr_linkparts = explode('/', $links['comment_add']['href']);
        $links['comment_add']['href'] = 'node/' . $arr_linkparts[2];
    }
    // Don't show 'reply' link for comments
    unset($links['comment_reply']);
    return theme_links($links, $attributes);
}
예제 #20
0
/**
 * Implements theme_links()
 * specifically for the user_menu only!
 * 1. Add a SMACCS / BEM style CSS classes
 * 2. Add ARIA roles for accessibility
 */
function bear_skin_links__user_menu(&$variables)
{
    // add the ARIA role for accessibility
    $variables['attributes']['role'] = 'menubar';
    foreach ($variables['links'] as $key => &$link) {
        if (!is_array($link)) {
            continue;
        }
        $link['attributes'] = !empty($link['attributes']) ? $link['attributes'] : array();
        $link['attributes']['class'][] = 'nav-user__link';
        $link['attributes']['role'] = 'menuitem';
    }
    return theme_links($variables);
}
function privacy_page() {
  print theme_header(FALSE);
  print <<<EOS
<h1>Privacy Policy</h1>
 <p>This Privacy Policy describes how users' personal information is handled in order to
  engage in the services available on our application. It applies generally to web pages
  where this policy appears in the footer. By accepting the Privacy Policy, you express
  consent to our collection, storage, use and disclosure of your personal information as
  described in this Privacy Policy. This Privacy Policy is effective upon acceptance for
  new users and is otherwise effective on August 08, 2011.</p>

  <h2>Definitions</h2>

  <ol>
    <li>References to "Our", "We", "Us" and Status Time Capsule shall be references
    to Status Time Capsule.</li>

    <li>References to "You", "Users" and "Your" shall mean references to user(s) visiting this web site, as the context requires.</li>
  </ol>

  <h2>Information Collection</h2>

  <p>Browsing our websites does not require your identities to be revealed. However,
  under the following circumstances, you are not anonymous to us.</p>

  <h2>User</h2>

  <p>We will ask for your personal information. The personal information collected includes but not restricting to the following:</p>

  <ol>
    <li>Private information such as name and birthdate</li>

    <li>Contact information such as email address, mobile number and physical address</li>

    <li>Additional information which we may ask for if we believe the site policies are
    violated</li>
  </ol>

  <p>Once you log into the account, your identity will be revealed to us.</p>

  <h2>Information Usage</h2>

  <p>The primary purpose in collecting personal information is to provide the users with
  a smooth and customized experience.</p>

  <p>We will use the information collected for the following purposes</p>

  <ol>
    <li>To provide its intended services</li>

    <li>To resolve disputes, and troubleshoot problems and errors</li>

    <li>To assist in law enforcement purposes and prevent/restrict the occurrences of
    potentially illegal or prohibited activities</li>
  </ol>

  <h2>Disclosure of information</h2>

  <p>We may share information with governmental agencies or other companies assisting us
  in fraud prevention or investigation. We may do so when:</p>

  <ol>
    <li>permitted or required by law; or,</li>

    <li>trying to protect against or prevent actual or potential fraud or unauthorized
    transactions; or,</li>

    <li>investigating fraud which has already taken place.</li>
  </ol>

  <p>The information is not provided to these companies for marketing purposes.</p>

  <h2>Usage of Cookies</h2>

  <p>Cookies are small files placed in your computer hard drives. We use it to analyse
  our site traffic. We have also used cookies to maintain your signed in status when you
  login to our websites.</p>

  <h2>Commitment to Data Security</h2>

  <p>Your personally identifiable information is kept secure. Only authorized employees,
  agents and contractors (who have agreed to keep information secure and confidential)
  have access to this information. All emails and newsletters from this site allow you to
  opt out of further mailings.</p>

  <h2>Changes to the policies</h2>

  <p>We reserved the rights to amend this Privacy Policy at any time. Upon posting of new
  policies, it will take immediate effect. We may notify you should there be any major
  changes to the policies.</p>
  
EOS;
  print theme_links();
  print theme_footer();
  // Ugly error suppression
  @log_insert('tos_hit');
}
예제 #22
0
function Coeus_links__locale_block($variables)
{
    foreach ($variables['links'] as $key => $lang) {
        $output .= l($variables['links']);
        // return theme_links($variables);
    }
    //echo '<pre>';
    //var_dump(array_keys($variables['links']));
    return theme_links($variables);
}
예제 #23
0
function clash_zen_links__system_main_menu(&$vars)
{
    foreach ($vars['links'] as &$link) {
        // do what you need here...
        $link['title'] = str_replace(' ', '&nbsp;', $link['title']);
        $link['html'] = TRUE;
    }
    return theme_links($vars);
}
예제 #24
0
function phptemplate_links($links, $attributes = array('class' => 'links'))
{
    if (isset($links['comment_reply'])) {
        unset($links['comment_reply']);
    }
    return theme_links($links, $attributes);
}
예제 #25
0
/**
 * Hide comment links on teaser views
 */
function boldy_links($links)
{
    if (count($links) > 0) {
        if (isset($links["node_read_more"])) {
            if (isset($links["comment_add"])) {
                unset($links["comment_add"]);
            }
            if (isset($links["comment_comments"])) {
                unset($links["comment_comments"]);
            }
        }
    }
    return theme_links($links);
}
예제 #26
0
function guifi_device_print($device = NULL)
{
    if ($device == NULL) {
        print theme('page', t('Not found'), FALSE);
        return;
    }
    $output = '<div id="guifi">';
    $node = node_load(array('nid' => $device[nid]));
    $title = t('Node:') . ' <a href="' . url('node/' . $node->nid) . '">' . $node->nick . '</a> &middot; ' . t('Device:') . '&nbsp;' . $device[nick];
    drupal_set_breadcrumb(guifi_node_ariadna($node));
    switch (arg(4)) {
        case 'all':
        case 'data':
        default:
            $table = theme_table(null, guifi_device_print_data($device), array('class' => 'device-data'));
            $output .= theme('box', $title, $table);
            if (arg(4) == 'data') {
                break;
            }
        case 'comment':
            if (!empty($device['comment'])) {
                $output .= theme('box', t('Comments'), $device['comment']);
            }
            if (arg(4) == 'comment') {
                break;
            }
        case 'graphs':
            if (empty($device['interfaces'])) {
                break;
            }
            // device graphs
            $table = theme('table', array(t('traffic overview')), guifi_device_graph_overview($device));
            $output .= theme('box', t('device graphs'), $table);
            if (arg(4) == 'graphs') {
                break;
            }
        case 'links':
            // links
            $output .= theme('box', NULL, guifi_device_links_print($device));
            if (arg(4) == 'links') {
                break;
            }
        case 'interfaces':
            if (empty($device['interfaces'])) {
                break;
            }
            $header = array(t('id'), t('connects with'), t('connector'), t('comments'), t('mac'), t('ip address'), t('netmask'));
            $tables = theme_table($header, guifi_device_print_interfaces($device), array('class' => 'device-data'));
            $output .= theme('box', t('physical ports & connections'), $tables);
            foreach (array('vlans', 'aggregations', 'tunnels') as $iClass) {
                $rows = guifi_device_print_iclass($iClass, $device);
                if (empty($rows)) {
                    continue;
                }
                if ($iClass == 'vlans') {
                    $header = array(t('type'), t('name'), t('parent'), t('vlan'), t('comments'), t('mac'), t('ip address'), t('netmask'));
                } else {
                    $header = array(t('type'), t('name'), t('parent'), t('comments'), t('mac'), t('ip address'), t('netmask'));
                }
                $tables = theme_table($header, $rows, array('class' => 'device-data'));
                $output .= theme('box', t($iClass), $tables);
            }
            break;
        case 'services':
            $output .= theme('box', t('services information'), theme_guifi_services_list($device['id']));
            $output .= '</div>';
            return;
    }
    $output .= '</div>';
    drupal_set_title(t('View device %dname', array('%dname' => $device['nick'])));
    $output .= theme_links(module_invoke_all('link', 'node', $node, FALSE));
    print theme('page', $output, FALSE);
    return;
}
예제 #27
0
/**
 * Edit action links
 */
function phptemplate_links($links, $attributes = array('class' => 'links'))
{
    if ($links) {
        // Reorder the links however you need them.
        $links = reorder_links($links, array(), array('comment_reply', 'comment_edit'));
        // Use the built-in theme_links() function to format the $links array.
        return theme_links($links, $attributes);
    }
}
예제 #28
0
파일: template.php 프로젝트: kreynen/elmsln
/**
 * Overrides theme_links__ctools_dropbutton().
 *
 * This override adds a wrapper div so that we can maintain appropriate
 * vertical spacing.
 */
function ember_links__ctools_dropbutton($variables)
{
    // Check to see if the number of links is greater than 1;
    // otherwise just treat this like a button.
    if (!empty($variables['links'])) {
        $is_drop_button = count($variables['links']) > 1;
        // Add needed files
        if ($is_drop_button) {
            ctools_add_js('dropbutton');
            ctools_add_css('dropbutton');
        }
        ctools_add_css('button');
        // Provide a unique identifier for every button on the page.
        static $id = 0;
        $id++;
        // Wrapping div
        $class = 'ctools-no-js';
        $class .= $is_drop_button ? ' ctools-dropbutton' : '';
        $class .= ' ctools-button';
        if (!empty($variables['class'])) {
            $class .= $variables['class'] ? ' ' . implode(' ', $variables['class']) : '';
        }
        $output = '';
        $output .= '<div class="' . $class . '" id="ctools-button-' . $id . '">';
        // Add a twisty if this is a dropbutton
        if ($is_drop_button) {
            $variables['title'] = $variables['title'] ? check_plain($variables['title']) : t('open');
            $output .= '<div class="ctools-link">';
            if ($variables['image']) {
                $output .= '<a href="#" class="ctools-twisty ctools-image">' . $variables['title'] . '</a>';
            } else {
                $output .= '<a href="#" class="ctools-twisty ctools-text">' . $variables['title'] . '</a>';
            }
            $output .= '</div>';
            // ctools-link
        }
        // The button content
        $output .= '<div class="ctools-content">';
        // Check for attributes. theme_links expects an array().
        $variables['attributes'] = !empty($variables['attributes']) ? $variables['attributes'] : array();
        // Remove the inline and links classes from links if they exist.
        // These classes are added and styled by Drupal core and mess up the default
        // styling of any link list.
        if (!empty($variables['attributes']['class'])) {
            $classes = $variables['attributes']['class'];
            foreach ($classes as $key => $class) {
                if ($class === 'inline' || $class === 'links') {
                    unset($variables['attributes']['class'][$key]);
                }
            }
        }
        // Call theme_links to render the list of links.
        $output .= theme_links(array('links' => $variables['links'], 'attributes' => $variables['attributes'], 'heading' => ''));
        $output .= '</div>';
        // ctools-content
        $output .= '</div>';
        // ctools-dropbutton
        // Wrap the output in our container.
        $output = '<div class="ctools-dropbutton-wrapper">' . $output . '</div>';
        return $output;
    } else {
        return '';
    }
}
예제 #29
0
function alpha_links__comment(&$variables)
{
    $cid = $variables['links']['#cid'];
    unset($variables['links']['#cid']);
    if (!empty($variables['links'])) {
        $variables['attributes']['class'] = array('links comment-links');
        return '' . '<div id="comment-links-' . $cid . '" class="comment-actions">' . theme_links($variables) . '</div>';
    } else {
        return '';
    }
}
예제 #30
0
function guifi_domain_print($domain = NULL)
{
    if ($domain == NULL) {
        print theme('page', t('Not found'), FALSE);
        return;
    }
    $output = '<div id="guifi">';
    $title = '';
    drupal_set_breadcrumb(guifi_node_ariadna($node));
    switch (arg(4)) {
        case 'all':
        case 'data':
        default:
            $table = theme('table', NULL, guifi_domain_print_data($domain));
            $output .= theme('box', $title, $table);
            if (arg(4) == 'data') {
                break;
            }
        case 'delegations':
            $header = array(t('Delegation'), t('IPv4 Address'), t('Nameserver'));
            $table = theme('table', $header, guifi_delegations_print_data($domain['name'], $domain['scope']));
            $output .= theme('box', t('Delegations'), $table);
            if (arg(4) == 'delegations') {
                break;
            }
        case 'hosts':
            $header = array(t('HostName'), t('Alias'), t('IPv4 Address'), t('IPv6 Address'), t('Namserver'), t('MailServer'), t('MX Priority'));
            $table = theme('table', $header, guifi_hosts_print_data($domain['id']));
            $output .= theme('box', t('Hostnames'), $table);
            break;
    }
    $output .= '</div>';
    drupal_set_title(t('View domain %dname', array('%dname' => $domain['name'])));
    $output .= theme_links(module_invoke_all('link', 'node', $node, FALSE));
    print theme('page', $output, FALSE);
    return;
}