Beispiel #1
0
/**
 * Echo HTML tag for a link
 *
 */
function yourls_html_link($href, $title = '', $element = '')
{
    if (!$title) {
        $title = $href;
    }
    if ($element) {
        $element = sprintf('id="%s"', yourls_esc_attr($element));
    }
    $link = sprintf('<a href="%s" %s>%s</a>', yourls_esc_url($href), $element, yourls_esc_html($title));
    echo yourls_apply_filter('html_link', $link);
}
Beispiel #2
0
 /**
  * Action: html_tfooter
  */
 public function action_html_tfooter()
 {
     global $params;
     ob_end_clean();
     $select = ['search_in' => array('all' => yourls__('All fields'), 'keyword' => yourls__('Short URL'), 'url' => yourls__('URL'), 'title' => yourls__('Title'), 'ip' => yourls__('IP')), 'sort_by' => array('keyword' => yourls__('Short URL'), 'url' => yourls__('URL'), 'timestamp' => yourls__('Date'), 'ip' => yourls__('IP'), 'clicks' => yourls__('Clicks')), 'sort_order' => array('asc' => yourls__('Ascending'), 'desc' => yourls__('Descending')), 'click_filter' => array('more' => yourls__('more'), 'less' => yourls__('less')), 'date_filter' => array('before' => yourls__('before'), 'after' => yourls__('after'), 'between' => yourls__('between'))];
     echo $this->getTemplate()->render('table_head', ['main_table_head' => $this->_string_main_table_head, 'select' => $select, 'search_text' => yourls_esc_attr($params['search_text']), 'perpage' => isset($params['perpage']) ? $params['perpage'] : '', 'click_limit' => isset($params['click_limit']) ? $params['click_limit'] : '', 'date_first' => isset($params['date_first']) ? $params['date_first'] : '', 'date_second' => isset($params['date_second']) ? $params['date_second'] : '', 'search_in' => isset($params['search_in']) ? $params['search_in'] : '', 'sort_by' => isset($params['sort_by']) ? $params['sort_by'] : '', 'sort_order' => isset($params['sort_order']) ? $params['sort_order'] : '', 'click_filter' => isset($params['click_filter']) ? $params['click_filter'] : '', 'date_filter' => isset($params['date_filter']) ? $params['date_filter'] : '']);
     echo '<tfoot>';
 }
Beispiel #3
0
/**
 * Return translated text, with context, that has been escaped for safe use in an attribute
 *
 * @see yourls_translate() Return returned yourls_translate() string
 * @see yourls_esc_attr()
 * @see yourls_x()
 * @since 1.6
 *
 * @param string   $single
 * @param string   $context
 * @param string   $domain Optional. Domain to retrieve the translated text
 * @internal param string $text Text to translate
 * @return string
 */
function yourls_esc_attr_x($single, $context, $domain = 'default')
{
    return yourls_esc_attr(yourls_translate_with_context($single, $context, $domain));
}