Exemplo n.º 1
0
 /**
  * Clean
  *
  * Prepare a string to be used as a url argument
  *
  * @param  string $input_string The string to convert to argument syntax.
  *
  * @return string               The converted string.
  */
 public static function clean($input_string)
 {
     module_load_include('inc', 'pathauto');
     if (function_exists('pathauto_cleanstring')) {
         return pathauto_cleanstring($input_string);
     } else {
         $os = strtolower($input_string);
         $os = preg_replace('/(\\/| )/', "-", $os);
         $os = preg_replace('/[^-a-z0-9]/', "", $os);
         $os = preg_replace('/--/', "-", $os);
         return $os;
     }
 }
Exemplo n.º 2
0
function drupal_tagadelic_weighted($terms)
{
    $output = '';
    require_once drupal_get_path('module', 'pathauto') . '/pathauto.inc';
    switch ($terms[0]->vid) {
        case 4:
            foreach ($terms as $term) {
                $output .= l($term->name, "clanky/" . check_plain(strtolower(pathauto_cleanstring($term->name))), array('attributes' => array('class' => "tagadelic level{$term->weight}"))) . " \n";
            }
            break;
        case 10:
            $output = l("všechny", "katalog", array('class' => 'tagadelic level1')) . "\n";
            foreach ($terms as $term) {
                $output .= l($term->name, "katalog/tagy/" . check_plain(pathauto_cleanstring($term->name)), array('attributes' => array('class' => "tagadelic level{$term->weight}"))) . " \n";
            }
            break;
    }
    return $output;
}
Exemplo n.º 3
0
/**
 * Implements theme_node_project
 */
function rwom_node__project__full($variables)
{
    global $base_path;
    module_load_include('inc', 'pathauto');
    $output = array();
    $node = menu_get_object();
    if (is_object($node) && $node->type === 'project') {
        $body = $variables['content']['body'];
        $body['#label_display'] = 'above';
        $body['#title'] = t('Project Description');
        $terms = $variables['content']['field_tags']['#items'];
        //drupal_set_message("<pre>" . print_r($images, TRUE) . "</pre>");
        $term_list = array();
        foreach ($terms as $term) {
            $term_name = $term['taxonomy_term']->name;
            $term_name_class = trim(strtolower(str_replace(' ', '-', $term_name)));
            $term_tag = "<a class='tech-tag " . $term_name_class . "' href='" . $base_path . "tags/" . pathauto_cleanstring($term_name) . "'>" . ucwords($term_name) . "</a>";
            array_push($term_list, $term_tag);
        }
        $tech_term_list = array('#theme' => 'item_list', '#items' => $term_list, '#title' => "<h4>" . t('Technologies used:') . "</h4>");
        //drupal_set_message("<pre>" . print_r($terms, TRUE) . "</pre>");
        $images = $variables['content']['field_project_images']['#items'];
        $img_list = array();
        foreach ($images as $image) {
            $img_tag = "<div class='flex-image'><img src='" . image_style_url('flex_full', $image['uri']) . "' /></div>";
            $img_title = "<div class='flex-title'>{$image['title']}</div>";
            $flex_item = "<div class='flex-content'>" . $img_tag . $img_title . "</div>";
            array_push($img_list, $flex_item);
        }
        $image_flex = array('#theme' => 'item_list', '#items' => $img_list, '#suffix' => drupal_render($disqus_comments) . drupal_render($disqus_recent_comments), '#attributes' => array('class' => array('slides')), '#attached' => array('js' => array(libraries_get_path('flexslider') . '/jquery.flexslider-min.js', drupal_get_path('module', 'custom_render') . '/js/node-themes/project.js'), 'css' => array(array('data' => libraries_get_path('flexslider') . '/flexslider.css', 'group' => CSS_DEFAULT), path_to_theme("rwom") . '/css/pages/project-page.css')));
        $images['#label_display'] = 0;
        $live_link = $variables['content']['field_link'];
        $live_link['#title'] = t("View Site Live");
        $live_link['#label_display'] = "inline";
        $disqus_recent_comments_block = block_load('disqus', 'disqus_recent_comments');
        $disqus_recent_comments = _block_get_renderable_array(_block_render_blocks(array($disqus_recent_comments_block)));
        $disqus_comments_block = block_load('disqus', 'disqus_comments');
        $disqus_comments = _block_get_renderable_array(_block_render_blocks(array($disqus_comments_block)));
        $output = array('#markup' => "<div class='project-view-mode-full'>\n\t\t<div class='project-images-slideshow'>" . render($image_flex) . "</div>\n\t\t<div class='project-body'>" . render($body) . "</div>\n\t\t<div class='project-tech-terms'>" . render($tech_term_list) . "</div>\n\t\t<div class='live-link'>" . render($live_link) . "</div>\n\t\t</div>", '#attached' => array('css' => array(path_to_theme("rwom") . '/css/pages/project-page.css')));
    }
    return render($output);
}
"><?php 
    print theme('imagecache', 'katalogwebu', $item['filepath']);
    ?>
</a></div>
          <?php 
}
?>
        </div>
      </div>
    </div>

    <h3>Tagy</h3>
    <?php 
_pathauto_include();
foreach ($taxonomy as $term) {
    echo l($term['title'], "katalog/tagy/" . pathauto_cleanstring($term['title'])) . "\n";
}
?>
  </div>
  <?php 
if ($links) {
    ?>
<div class="links"><?php 
    print $links;
    ?>
</div><?php 
}
?>
</div> <!-- article end -->
<div class="article-spacer">&nbsp;</div>
Exemplo n.º 5
0
db_set_active('boinc');
$boincteam = db_fetch_object(db_query('SELECT * FROM team WHERE id=%d', array($team_id)));
$boincteam_members = db_query('SELECT id FROM user WHERE teamid=%d', array($team_id));
$boincteam_admin = (int) db_result(db_query('SELECT userid FROM team_admin WHERE teamid=%d', array($team_id)));
db_set_active('default');
$team_exists = db_query('SELECT team_id FROM {boincteam} WHERE team_id = %d', $boincteam->id);
// FIXME: $team_exists==FALSE should be handled as an error and return an error code!
if ($team_exists != FALSE && db_fetch_object($team_exists) == FALSE) {
    $boincteam->description = _boincimport_text_sanitize($boincteam->description);
    $teaser = node_teaser($boincteam->description);
    // Construct the team as an organic group node
    $node = array('type' => 'team', 'title' => $boincteam->name, 'body' => $boincteam->description, 'teaser' => $teaser, 'uid' => boincuser_lookup_uid($boincteam->userid), 'path' => null, 'status' => 1, 'promote' => 0, 'created' => $boincteam->create_time, 'comment' => 0, 'moderate' => 0, 'sticky' => 0, 'format' => $input_format);
    // Use pathauto function, if available, to clean up the path
    if (module_exists('pathauto')) {
        module_load_include('inc', 'pathauto', 'pathauto');
        $node['path'] = pathauto_cleanstring($boincteam->name);
    } else {
        echo 'Pathauto module is required!';
        exit;
    }
    $node = (object) $node;
    // node_save requires an object form
    $node->taxonomy[] = taxonomy_get_term($team_type_tid);
    // Save the team node
    node_save($node);
    // Save the team IDs to a BOINC <--> Drupal reference table.
    db_query('INSERT INTO {boincteam} (team_id, nid) VALUES (%d, %d)', $boincteam->id, $node->nid);
}
// Determine team membership
db_set_active('boinc');
$boincteam_member_ids = array();
function camp_links($links, $attributes = array('class' => 'links'))
{
    $output = '';
    if (count($links) > 0) {
        $output = '<ul' . drupal_attributes($attributes) . '>';
        $num_links = count($links);
        $i = 1;
        foreach ($links as $key => $link) {
            $class = $key;
            // Add first, last and active classes to the list of links to help out themers.
            if ($i == 1) {
                $class .= ' first';
            }
            if ($i == $num_links) {
                $class .= ' last';
            }
            if (isset($link['href']) && ($link['href'] == $_GET['q'] || $link['href'] == '<front>' && drupal_is_front_page())) {
                $class .= ' active';
            }
            if (function_exists('pathauto_cleanstring')) {
                $class .= ' ' . pathauto_cleanstring(url($link['href']));
            }
            $output .= '<li' . drupal_attributes(array('class' => $class)) . '>';
            if (isset($link['href'])) {
                // Pass in $link as $options, they share the same keys.
                $output .= l($link['title'], $link['href'], $link);
            } else {
                if (!empty($link['title'])) {
                    // Some links are actually not links, but we wrap these in <span> for adding title and class attributes
                    if (empty($link['html'])) {
                        $link['title'] = check_plain($link['title']);
                    }
                    $span_attributes = '';
                    if (isset($link['attributes'])) {
                        $span_attributes = drupal_attributes($link['attributes']);
                    }
                    $output .= '<span' . $span_attributes . '>' . $link['title'] . '</span>';
                }
            }
            $i++;
            $output .= "</li>\n";
        }
        $output .= '</ul>';
    }
    return $output;
}
Exemplo n.º 7
0
 * - $block->region: The block region embedding the current block.
 *
 * Helper variables:
 * - $block_zebra: Outputs 'odd' and 'even' dependent on each block region.
 * - $zebra: Same output as $block_zebra but independent of any block region.
 * - $block_id: Counter dependent on each block region.
 * - $id: Same output as $block_id but independent of any block region.
 * - $is_front: Flags true when presented in the front page.
 * - $logged_in: Flags true when the current user is a logged-in member.
 * - $is_admin: Flags true when the current user is an administrator.
 *
 * @see template_preprocess()
 * @see template_preprocess_block()
 */
if ($block->subject && arg(0) != 'admin') {
    $id = strtolower(pathauto_cleanstring($block->subject));
} else {
    $id = $block->module . '-' . $block->delta;
}
?>
<div id="block-<?php 
echo $id;
?>
" class="block block-<?php 
print $block->module;
?>
">
<?php 
if ($block->subject) {
    ?>
  <h2><?php 
    <a href="http://open.nysenate.gov/legislation/sponsor/<?php 
echo $sponsor;
?>
" title="<?php 
echo t('Search open legislation by sponsor');
?>
"><?php 
echo $sponsor;
?>
</a>
  </strong><br />
  <?php 
echo t('Committee: ');
?>
  <a href="/committee/<?php 
echo pathauto_cleanstring(strtolower(str_replace(' ', '-', $committee)));
?>
" title="<?php 
echo t('Visit this committee page');
?>
"><?php 
echo $committee;
?>
</a>
  <span class="leginfo-committee-search"> |
    <a href="http://open.nysenate.gov/legislation/committee/<?php 
echo $committee;
?>
" title="<?php 
echo t('Search open legislation by committee');
?>
Exemplo n.º 9
0
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php 
print $language->language;
?>
" lang="<?php 
print $language->language;
?>
" dir="<?php 
print $language->dir;
?>
">

<?php 
_pathauto_include();
$path = base_path() . drupal_get_path('theme', 'default');
$class = strtolower(pathauto_cleanstring($title));
?>

<head>
	<meta name="google-site-verification" content="jnc9hYXvS4KZFt-evHuY7a9IWyy79AT62lAK6qnXNYk" />	
	<link href="http://www.internacional.com.br/imagens/confronto/internacional.gif" rel="shortcut icon" />
	<title><?php 
print $head_title;
?>
</title>
	<?php 
print $head;
?>
	<?php 
print $styles;
?>