예제 #1
0
 public function tagcloudsListVocs($tagclouds_vocs = NULL)
 {
     $vocs = tagclouds_vocs_load($tagclouds_vocs);
     if (empty($vocs)) {
         throw new NotFoundHttpException();
     }
     $output = '';
     foreach ($vocs as $vid) {
         $vocabulary = entity_load('taxonomy_vocabulary', $vid);
         if ($vocabulary == FALSE) {
             throw new NotFoundHttpException();
         }
         // Clean out vocabulary, so that we don't have to leave security to our
         // theme layer.
         $vocabulary->description = filter_xss_admin($vocabulary->description);
         $vocabulary->name = filter_xss_admin($vocabulary->name);
         $config = \Drupal::config('tagclouds.admin_page');
         $tags = tagclouds_get_tags(array($vocabulary->vid), $config->get('tagclouds_levels'), $config->get('tagclouds_page_amount'));
         $tags = tagclouds_sort_tags($tags);
         $output .= _theme('tagclouds_list_box', array('vocabulary' => $vocabulary, 'tags' => $tags));
     }
     if (!$output) {
         throw new NotFoundHttpException();
     }
     $output = "<div class=\"wrapper tagclouds\">{$output}</div>";
     return $output;
 }
예제 #2
0
 /**
  * Test that _theme() returns expected data types.
  */
 function testThemeDataTypes()
 {
     // theme_test_false is an implemented theme hook so _theme() should return a
     // string, even though the theme function itself can return anything.
     $foos = array('null' => NULL, 'false' => FALSE, 'integer' => 1, 'string' => 'foo');
     foreach ($foos as $type => $example) {
         $output = _theme('theme_test_foo', array('foo' => $example));
         $this->assertTrue(is_string($output), format_string('_theme() returns a string for data type !type.', array('!type' => $type)));
     }
     // suggestionnotimplemented is not an implemented theme hook so _theme()
     // should return FALSE instead of a string.
     $output = _theme(array('suggestionnotimplemented'));
     $this->assertIdentical($output, FALSE, '_theme() returns FALSE when a hook suggestion is not implemented.');
 }
예제 #3
0
 public function tagcloudsPageChunk($tagclouds_vocs = '')
 {
     $vocs = tagclouds_vocs_load($tagclouds_vocs);
     if (empty($vocs)) {
         foreach (entity_load_multiple('taxonomy_vocabulary') as $vocabulary) {
             $vocs[] = $vocabulary->vid;
         }
     }
     $config = \Drupal::config('tagclouds.admin_page');
     $tags = tagclouds_get_tags($vocs, $config->get('tagclouds_levels'), $config->get('tagclouds_page_amount'));
     $tags = tagclouds_sort_tags($tags);
     $output = _theme('tagclouds_weighted', array('terms' => $tags));
     if (!$output) {
         throw new NotFoundHttpException();
     }
     $output = "<div class=\"wrapper tagclouds\">{$output}</div>";
     return $output;
 }
예제 #4
0
 /**
  * {@inheritdoc}
  */
 public function build()
 {
     $field = $this->getConfiguration();
     $format = $this->formatter();
     return array('#markup' => _theme($format, $field));
 }
예제 #5
0
 function teklifler()
 {
     $data['veri'] = $this->topla();
     _theme('teklifler', $data);
 }
예제 #6
0
 function hata404()
 {
     $data['veri'] = $this->topla();
     _theme('404', $data);
 }
예제 #7
0
 /**
  * Calls a theme hook suggestion.
  *
  * @return string
  *   An HTML string containing the themed output.
  */
 public function testSuggestion()
 {
     return _theme(array('theme_test__suggestion', 'theme_test'), array());
 }
 /**
  * {@inheritdoc}
  */
 public function render($hook, array $variables)
 {
     return _theme($hook, $variables);
 }
 /**
  * Menu callback for testing PHP variables in a Twig template.
  */
 public function phpVariablesRender()
 {
     return _theme('twig_theme_test_php_variables');
 }