Пример #1
0
 /**
  * This function returns the title with the appropriate markup.
  * @param string $cut_at - if provided, the method will just cut at that point
  * and it will cut after that. If not setting is in the database the function will cut at the default value
  * @return string
  */
 function get_title($cut_at = '')
 {
     $buffy = '';
     $buffy .= '<h3 itemprop="name" class="entry-title td-module-title">';
     $buffy .= '<a itemprop="url" href="' . $this->href . '" rel="bookmark" title="' . $this->title_attribute . '">';
     //see if we have to cut the title and if we have the title lenght in the panel for ex: td_module_6__title_excerpt
     if ($cut_at != '') {
         //cut at the hard coded size
         $buffy .= td_util::excerpt($this->title, $cut_at, 'show_shortcodes');
     } else {
         $current_module_class = get_class($this);
         //see if we have a default setting for this module, and if so only apply it if we don't get other things form theme panel.
         if (td_api_module::_helper_check_excerpt_title($current_module_class)) {
             $db_title_excerpt = td_util::get_option($current_module_class . '_title_excerpt');
             if ($db_title_excerpt != '') {
                 //cut from the database settings
                 $buffy .= td_util::excerpt($this->title, $db_title_excerpt, 'show_shortcodes');
             } else {
                 //cut at the default size
                 $module_api = td_api_module::get_by_id($current_module_class);
                 $buffy .= td_util::excerpt($this->title, $module_api['excerpt_title'], 'show_shortcodes');
             }
         } else {
             /**
              * no $cut_at provided and no setting in td_config -> return the full title
              * @see td_global::$modules_list
              */
             $buffy .= $this->title;
         }
     }
     $buffy .= '</a>';
     $buffy .= '</h3>';
     return $buffy;
 }