Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Более гибкая обрезка текста в поле html #1350

Merged
merged 3 commits into from
Sep 2, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update html.php
  • Loading branch information
fuzegit authored Sep 2, 2021
commit 164a6a38e3c776c5e4d9a25a61eb344187a1f2f0
20 changes: 10 additions & 10 deletions system/fields/html.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function getOptions(){
)),
new fieldCheckbox('is_html_filter', array(
'title' => LANG_PARSER_HTML_FILTERING,
'extended_option' => true
'extended_option' => true
)),
new fieldCheckbox('parse_patterns', array(
'title' => LANG_PARSER_PARSE_PATTERNS,
Expand All @@ -79,28 +79,28 @@ public function getOptions(){
new fieldNumber('teaser_len', array(
'title' => LANG_PARSER_HTML_TEASER_LEN,
'hint' => LANG_PARSER_HTML_TEASER_LEN_HINT,
'extended_option' => true
'extended_option' => true
)),
new fieldString('teaser_postfix', array(
'title' => LANG_PARSER_HTML_TEASER_POSTFIX,
'visible_depend' => array('options:teaser_len' => array('hide' => array(''))),
'extended_option' => true
)),
)),
new fieldList('teaser_type', array(
'title' => LANG_PARSER_HTML_TEASER_TYPE,
'items' => array(
'title' => LANG_PARSER_HTML_TEASER_TYPE,
'items' => array(
'' => LANG_PARSER_HTML_TEASER_TYPE_NULL,
's' => LANG_PARSER_HTML_TEASER_TYPE_S,
'w' => LANG_PARSER_HTML_TEASER_TYPE_W
),
'visible_depend' => array('options:teaser_len' => array('hide' => array(''))),
'extended_option' => true,
'extended_option' => true
)),
new fieldCheckbox('show_show_more', array(
'title' => LANG_PARSER_SHOW_SHOW_MORE,
'default' => false,
'visible_depend' => array('options:teaser_len' => array('hide' => array(''))),
'extended_option' => true
'extended_option' => true
)),
new fieldCheckbox('in_fulltext_search', array(
'title' => LANG_PARSER_IN_FULLTEXT_SEARCH,
Expand Down Expand Up @@ -157,10 +157,10 @@ public function parseTeaser($value) {

if ($max_len){

$teaser_postfix = $this->getOption('teaser_postfix','');
$teaser_type = $this->getOption('teaser_type','s');
$teaser_postfix = $this->getOption('teaser_postfix', '');
$teaser_type = $this->getOption('teaser_type', 's');

$value = string_short($value, $max_len,$teaser_postfix,$teaser_type);
$value = string_short($value, $max_len, $teaser_postfix, $teaser_type);

if($this->getOption('show_show_more') && !empty($this->item['ctype']['name']) && !empty($this->item['slug'])){
$value .= '<span class="d-block mt-2"><a class="read-more btn btn-outline-info btn-sm" href="'.href_to($this->item['ctype']['name'], $this->item['slug'].'.html').'">'.LANG_MORE.'</a></span>';
Expand Down