| 1 | <?php |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | |
|---|
| 22 | |
|---|
| 23 | |
|---|
| 24 | |
|---|
| 25 | |
|---|
| 26 | |
|---|
| 27 | |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | |
|---|
| 31 | class ezipbOperators { |
|---|
| 32 | |
|---|
| 33 | private $Operators; |
|---|
| 34 | private $ezipb; |
|---|
| 35 | private $ipsclass; |
|---|
| 36 | |
|---|
| 37 | |
|---|
| 38 | |
|---|
| 39 | |
|---|
| 40 | |
|---|
| 41 | |
|---|
| 42 | function __construct() { |
|---|
| 43 | |
|---|
| 44 | |
|---|
| 45 | require_once( eZExtension::baseDirectory() . '/ezipb/classes/ezipb.php' ); |
|---|
| 46 | $this->ezipb = ezipb::instance(); |
|---|
| 47 | $this->ipsclass =& $this->ezipb->ipsclass; |
|---|
| 48 | |
|---|
| 49 | |
|---|
| 50 | $this->Operators = array( 'ezipb_isloggin', |
|---|
| 51 | 'ezipb_issupermodo', |
|---|
| 52 | 'ezipb_isadmin', |
|---|
| 53 | 'ezipb_member', |
|---|
| 54 | 'ezipb_md5_check', |
|---|
| 55 | 'ezipb_vars' ); |
|---|
| 56 | } |
|---|
| 57 | |
|---|
| 58 | |
|---|
| 59 | |
|---|
| 60 | |
|---|
| 61 | |
|---|
| 62 | |
|---|
| 63 | |
|---|
| 64 | function &operatorList() { |
|---|
| 65 | return $this->Operators; |
|---|
| 66 | } |
|---|
| 67 | |
|---|
| 68 | function namedParameterPerOperator() { |
|---|
| 69 | return true; |
|---|
| 70 | } |
|---|
| 71 | |
|---|
| 72 | function namedParameterList() { |
|---|
| 73 | |
|---|
| 74 | return array( 'ezipb_isloggin' => array(), |
|---|
| 75 | 'ezipb_issupermodo' => array(), |
|---|
| 76 | 'ezipb_isadmin' => array(), |
|---|
| 77 | 'ezipb_member' => array( 'index' => array( 'type' => 'string', 'required' => false, 'default' => '' ) ), |
|---|
| 78 | 'ezipb_md5_check' => array(), |
|---|
| 79 | 'ezipb_vars' => array( 'index' => array( 'type' => 'string', 'required' => false, 'default' => '' ) ), |
|---|
| 80 | ); |
|---|
| 81 | } |
|---|
| 82 | |
|---|
| 83 | function modify( &$tpl, &$operatorName, &$operatorParameters, &$rootNamespace, |
|---|
| 84 | &$currentNamespace, &$operatorValue, &$namedParameters ) { |
|---|
| 85 | |
|---|
| 86 | switch ( $operatorName ) { |
|---|
| 87 | |
|---|
| 88 | case 'ezipb_isloggin': |
|---|
| 89 | $operatorValue = $this->isLoggin(); |
|---|
| 90 | break; |
|---|
| 91 | case 'ezipb_issupermodo': |
|---|
| 92 | $operatorValue = $this->isSuperModo(); |
|---|
| 93 | break; |
|---|
| 94 | case 'ezipb_isadmin': |
|---|
| 95 | $operatorValue = $this->isAdmin(); |
|---|
| 96 | break; |
|---|
| 97 | case 'ezipb_member': |
|---|
| 98 | $operatorValue = $this->getMember( $namedParameters['index'] ); |
|---|
| 99 | break; |
|---|
| 100 | case 'ezipb_md5_check': |
|---|
| 101 | $operatorValue = $this->ipsclass->md5_check; |
|---|
| 102 | break; |
|---|
| 103 | case 'ezipb_vars': |
|---|
| 104 | $operatorValue = $this->getVars( $namedParameters['index'] ); |
|---|
| 105 | break; |
|---|
| 106 | } |
|---|
| 107 | } |
|---|
| 108 | |
|---|
| 109 | |
|---|
| 110 | |
|---|
| 111 | |
|---|
| 112 | |
|---|
| 113 | |
|---|
| 114 | |
|---|
| 115 | |
|---|
| 116 | private function isLoggin() { |
|---|
| 117 | |
|---|
| 118 | return $this->ezipb->isLoggin(); |
|---|
| 119 | } |
|---|
| 120 | |
|---|
| 121 | |
|---|
| 122 | |
|---|
| 123 | |
|---|
| 124 | |
|---|
| 125 | |
|---|
| 126 | |
|---|
| 127 | |
|---|
| 128 | private function isSuperModo() { |
|---|
| 129 | |
|---|
| 130 | return $this->ezipb->isSuperModo(); |
|---|
| 131 | } |
|---|
| 132 | |
|---|
| 133 | |
|---|
| 134 | |
|---|
| 135 | |
|---|
| 136 | |
|---|
| 137 | |
|---|
| 138 | |
|---|
| 139 | |
|---|
| 140 | private function isAdmin() { |
|---|
| 141 | |
|---|
| 142 | return $this->ezipb->isAdmin(); |
|---|
| 143 | } |
|---|
| 144 | |
|---|
| 145 | |
|---|
| 146 | |
|---|
| 147 | |
|---|
| 148 | |
|---|
| 149 | |
|---|
| 150 | |
|---|
| 151 | |
|---|
| 152 | |
|---|
| 153 | |
|---|
| 154 | private function getMember ( $index ) { |
|---|
| 155 | |
|---|
| 156 | if ( empty( $index ) ) |
|---|
| 157 | return $this->ipsclass->member; |
|---|
| 158 | |
|---|
| 159 | return $this->ipsclass->member[$index]; |
|---|
| 160 | } |
|---|
| 161 | |
|---|
| 162 | |
|---|
| 163 | |
|---|
| 164 | |
|---|
| 165 | |
|---|
| 166 | |
|---|
| 167 | |
|---|
| 168 | |
|---|
| 169 | |
|---|
| 170 | private function getVars ( $index ) { |
|---|
| 171 | |
|---|
| 172 | if ( empty( $index ) ) |
|---|
| 173 | return $this->ipsclass->vars; |
|---|
| 174 | |
|---|
| 175 | return $this->ipsclass->vars[$index]; |
|---|
| 176 | } |
|---|
| 177 | |
|---|
| 178 | } |
|---|
| 179 | |
|---|
| 180 | ?> |
|---|