PluginProbe
ShiftController Employee Shift Scheduling / 4.9.85
ShiftController Employee Shift Scheduling v4.9.85
4.9.97 4.9.96 4.9.95 4.9.74 4.9.75 4.9.76 4.9.77 4.9.78 4.9.84 4.9.85 4.9.87 4.9.91 4.9.92 trunk 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 3.2.4 All 38 releases
shiftcontroller / hc3 / ui / element / ahref.php

ahref.php in ShiftController Employee Shift Scheduling 4.9.85, at hc3/ui/element/ahref.php

60 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if (! defined('ABSPATH')) exit; // Exit if accessed directly
2 class HC3_Ui_Element_Ahref extends HC3_Ui_Abstract_Element
3 {
4 protected $uiType = 'ahref';
5 protected $to = NULL;
6 protected $actionMode = FALSE;
7
8 public function __construct( $to, $label = NULL )
9 {
10 $this->to = $to;
11 if( $label === NULL ){
12 $label = $to;
13 }
14 parent::__construct( 'a', $label );
15
16 // $title = strip_tags( $label );
17 // $title = substr_count( $label, "\n" );
18
19 // $title = str_replace( $tags, "\n", $label );
20 // $title = strip_tags( $title );
21 // $title = preg_replace( "/(\n){2,}/", "\n", $title );
22
23 $title = $label;
24
25 $tags = array('</div>', '</p>','<br />', '<br>' );
26 $title = str_replace( $tags, ' ', $title );
27
28 $tags = array('&gt;', '&lt;' );
29 $title = str_replace( $tags, '', $title );
30
31 $title = strip_tags( $title );
32 $title = preg_replace( "/(\s){2,}/", " ", $title );
33
34 $this
35 ->addAttr( 'title', $title )
36 ;
37 }
38
39 public function actionMode( $set = TRUE )
40 {
41 $this->actionMode = $set;
42 return $this;
43 }
44
45 public function isActionMode()
46 {
47 return $this->actionMode;
48 }
49
50 public function getTo()
51 {
52 return $this->to;
53 }
54
55 public function newWindow( $set = TRUE )
56 {
57 $this->addAttr('target', '_blank');
58 return $this;
59 }
60 }