Complex classes like TbHtml often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use TbHtml, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 14 | class TbHtml extends CHtml // required in order to access the protected methods in CHtml |
||
| 15 | { |
||
| 16 | // |
||
| 17 | // TYPOGRAPHY |
||
| 18 | // -------------------------------------------------- |
||
| 19 | |||
| 20 | const TEXT_ALIGN_LEFT = 'left'; |
||
| 21 | const TEXT_ALIGN_CENTER = 'center'; |
||
| 22 | const TEXT_ALIGN_RIGHT = 'right'; |
||
| 23 | |||
| 24 | const TEXT_COLOR_DEFAULT = ''; |
||
| 25 | const TEXT_COLOR_WARNING = 'warning'; |
||
| 26 | const TEXT_COLOR_ERROR = 'error'; |
||
| 27 | const TEXT_COLOR_INFO = 'info'; |
||
| 28 | const TEXT_COLOR_SUCCESS = 'success'; |
||
| 29 | |||
| 30 | const HELP_TYPE_INLINE = 'inline'; |
||
| 31 | const HELP_TYPE_BLOCK = 'block'; |
||
| 32 | |||
| 33 | // |
||
| 34 | // FORM |
||
| 35 | // -------------------------------------------------- |
||
| 36 | |||
| 37 | const FORM_LAYOUT_VERTICAL = 'vertical'; |
||
| 38 | const FORM_LAYOUT_HORIZONTAL = 'horizontal'; |
||
| 39 | const FORM_LAYOUT_INLINE = 'inline'; |
||
| 40 | const FORM_LAYOUT_SEARCH = 'search'; |
||
| 41 | |||
| 42 | const INPUT_TYPE_TEXT = 'textField'; |
||
| 43 | const INPUT_TYPE_PASSWORD = 'passwordField'; |
||
| 44 | const INPUT_TYPE_URL = 'urlField'; |
||
| 45 | const INPUT_TYPE_EMAIL = 'emailField'; |
||
| 46 | const INPUT_TYPE_NUMBER = 'numberField'; |
||
| 47 | const INPUT_TYPE_RANGE = 'rangeField'; |
||
| 48 | const INPUT_TYPE_DATE = 'dateField'; |
||
| 49 | const INPUT_TYPE_TEXTAREA = 'textArea'; |
||
| 50 | const INPUT_TYPE_FILE = 'fileField'; |
||
| 51 | const INPUT_TYPE_RADIOBUTTON = 'radioButton'; |
||
| 52 | const INPUT_TYPE_CHECKBOX = 'checkBox'; |
||
| 53 | const INPUT_TYPE_DROPDOWNLIST = 'dropDownList'; |
||
| 54 | const INPUT_TYPE_LISTBOX = 'listBox'; |
||
| 55 | const INPUT_TYPE_CHECKBOXLIST = 'checkBoxList'; |
||
| 56 | const INPUT_TYPE_INLINECHECKBOXLIST = 'inlineCheckBoxList'; |
||
| 57 | const INPUT_TYPE_RADIOBUTTONLIST = 'radioButtonList'; |
||
| 58 | const INPUT_TYPE_INLINERADIOBUTTONLIST = 'inlineRadioButtonList'; |
||
| 59 | const INPUT_TYPE_UNEDITABLE = 'uneditableField'; |
||
| 60 | const INPUT_TYPE_SEARCH = 'searchQuery'; |
||
| 61 | const INPUT_TYPE_CUSTOM = 'widget'; |
||
| 62 | |||
| 63 | const INPUT_SIZE_MINI = 'mini'; |
||
| 64 | const INPUT_SIZE_SMALL = 'small'; |
||
| 65 | const INPUT_SIZE_DEFAULT = ''; |
||
| 66 | const INPUT_SIZE_MEDIUM = 'medium'; |
||
| 67 | const INPUT_SIZE_LARGE = 'large'; |
||
| 68 | const INPUT_SIZE_XLARGE = 'xlarge'; |
||
| 69 | const INPUT_SIZE_XXLARGE = 'xxlarge'; |
||
| 70 | |||
| 71 | const INPUT_COLOR_DEFAULT = ''; |
||
| 72 | const INPUT_COLOR_WARNING = 'warning'; |
||
| 73 | const INPUT_COLOR_ERROR = 'error'; |
||
| 74 | const INPUT_COLOR_INFO = 'info'; |
||
| 75 | const INPUT_COLOR_SUCCESS = 'success'; |
||
| 76 | |||
| 77 | // |
||
| 78 | // BUTTONS |
||
| 79 | // -------------------------------------------------- |
||
| 80 | |||
| 81 | const BUTTON_TYPE_LINK = 'link'; |
||
| 82 | const BUTTON_TYPE_HTML = 'htmlButton'; |
||
| 83 | const BUTTON_TYPE_SUBMIT = 'submitButton'; |
||
| 84 | const BUTTON_TYPE_RESET = 'resetButton'; |
||
| 85 | const BUTTON_TYPE_IMAGE = 'imageButton'; |
||
| 86 | const BUTTON_TYPE_LINKBUTTON = 'linkButton'; |
||
| 87 | const BUTTON_TYPE_AJAXLINK = 'ajaxLink'; |
||
| 88 | const BUTTON_TYPE_AJAXBUTTON = 'ajaxButton'; |
||
| 89 | const BUTTON_TYPE_INPUTBUTTON = 'inputButton'; |
||
| 90 | const BUTTON_TYPE_INPUTSUBMIT = 'inputSubmit'; |
||
| 91 | |||
| 92 | const BUTTON_COLOR_DEFAULT = ''; |
||
| 93 | const BUTTON_COLOR_PRIMARY = 'primary'; |
||
| 94 | const BUTTON_COLOR_INFO = 'info'; |
||
| 95 | const BUTTON_COLOR_SUCCESS = 'success'; |
||
| 96 | const BUTTON_COLOR_WARNING = 'warning'; |
||
| 97 | const BUTTON_COLOR_DANGER = 'danger'; |
||
| 98 | const BUTTON_COLOR_INVERSE = 'inverse'; |
||
| 99 | const BUTTON_COLOR_LINK = 'link'; |
||
| 100 | |||
| 101 | const BUTTON_SIZE_MINI = 'mini'; |
||
| 102 | const BUTTON_SIZE_SMALL = 'small'; |
||
| 103 | const BUTTON_SIZE_DEFAULT = ''; |
||
| 104 | const BUTTON_SIZE_LARGE = 'large'; |
||
| 105 | |||
| 106 | const BUTTON_TOGGLE_CHECKBOX = 'checkbox'; |
||
| 107 | const BUTTON_TOGGLE_RADIO = 'radio'; |
||
| 108 | |||
| 109 | // |
||
| 110 | // IMAGES |
||
| 111 | // -------------------------------------------------- |
||
| 112 | |||
| 113 | const IMAGE_TYPE_ROUNDED = 'rounded'; |
||
| 114 | const IMAGE_TYPE_CIRCLE = 'circle'; |
||
| 115 | const IMAGE_TYPE_POLAROID = 'polaroid'; |
||
| 116 | |||
| 117 | // |
||
| 118 | // NAV |
||
| 119 | // -------------------------------------------------- |
||
| 120 | |||
| 121 | const NAV_TYPE_NONE = ''; |
||
| 122 | const NAV_TYPE_TABS = 'tabs'; |
||
| 123 | const NAV_TYPE_PILLS = 'pills'; |
||
| 124 | const NAV_TYPE_LIST = 'list'; |
||
| 125 | |||
| 126 | const TABS_PLACEMENT_ABOVE = ''; |
||
| 127 | const TABS_PLACEMENT_BELOW = 'below'; |
||
| 128 | const TABS_PLACEMENT_LEFT = 'left'; |
||
| 129 | const TABS_PLACEMENT_RIGHT = 'right'; |
||
| 130 | |||
| 131 | // |
||
| 132 | // NAVBAR |
||
| 133 | // -------------------------------------------------- |
||
| 134 | |||
| 135 | const NAVBAR_DISPLAY_NONE = ''; |
||
| 136 | const NAVBAR_DISPLAY_FIXEDTOP = 'fixed-top'; |
||
| 137 | const NAVBAR_DISPLAY_FIXEDBOTTOM = 'fixed-bottom'; |
||
| 138 | const NAVBAR_DISPLAY_STATICTOP = 'static-top'; |
||
| 139 | |||
| 140 | const NAVBAR_COLOR_INVERSE = 'inverse'; |
||
| 141 | |||
| 142 | // |
||
| 143 | // PAGINATION |
||
| 144 | // -------------------------------------------------- |
||
| 145 | |||
| 146 | const PAGINATION_SIZE_MINI = 'mini'; |
||
| 147 | const PAGINATION_SIZE_SMALL = 'small'; |
||
| 148 | const PAGINATION_SIZE_DEFAULT = ''; |
||
| 149 | const PAGINATION_SIZE_LARGE = 'large'; |
||
| 150 | |||
| 151 | const PAGINATION_ALIGN_LEFT = 'left'; |
||
| 152 | const PAGINATION_ALIGN_CENTER = 'centered'; |
||
| 153 | const PAGINATION_ALIGN_RIGHT = 'right'; |
||
| 154 | |||
| 155 | // |
||
| 156 | // LABELS AND BADGES |
||
| 157 | // -------------------------------------------------- |
||
| 158 | |||
| 159 | const LABEL_COLOR_DEFAULT = ''; |
||
| 160 | const LABEL_COLOR_SUCCESS = 'success'; |
||
| 161 | const LABEL_COLOR_WARNING = 'warning'; |
||
| 162 | const LABEL_COLOR_IMPORTANT = 'important'; |
||
| 163 | const LABEL_COLOR_INFO = 'info'; |
||
| 164 | const LABEL_COLOR_INVERSE = 'inverse'; |
||
| 165 | |||
| 166 | const BADGE_COLOR_DEFAULT = ''; |
||
| 167 | const BADGE_COLOR_SUCCESS = 'success'; |
||
| 168 | const BADGE_COLOR_WARNING = 'warning'; |
||
| 169 | const BADGE_COLOR_IMPORTANT = 'important'; |
||
| 170 | const BADGE_COLOR_INFO = 'info'; |
||
| 171 | const BADGE_COLOR_INVERSE = 'inverse'; |
||
| 172 | |||
| 173 | // |
||
| 174 | // TOOLTIPS AND POPOVERS |
||
| 175 | // -------------------------------------------------- |
||
| 176 | |||
| 177 | const TOOLTIP_PLACEMENT_TOP = 'top'; |
||
| 178 | const TOOLTIP_PLACEMENT_BOTTOM = 'bottom'; |
||
| 179 | const TOOLTIP_PLACEMENT_LEFT = 'left'; |
||
| 180 | const TOOLTIP_PLACEMENT_RIGHT = 'right'; |
||
| 181 | |||
| 182 | const TOOLTIP_TRIGGER_CLICK = 'click'; |
||
| 183 | const TOOLTIP_TRIGGER_HOVER = 'hover'; |
||
| 184 | const TOOLTIP_TRIGGER_FOCUS = 'focus'; |
||
| 185 | const TOOLTIP_TRIGGER_MANUAL = 'manual'; |
||
| 186 | |||
| 187 | const POPOVER_PLACEMENT_TOP = 'top'; |
||
| 188 | const POPOVER_PLACEMENT_BOTTOM = 'bottom'; |
||
| 189 | const POPOVER_PLACEMENT_LEFT = 'left'; |
||
| 190 | const POPOVER_PLACEMENT_RIGHT = 'right'; |
||
| 191 | |||
| 192 | const POPOVER_TRIGGER_CLICK = 'click'; |
||
| 193 | const POPOVER_TRIGGER_HOVER = 'hover'; |
||
| 194 | const POPOVER_TRIGGER_FOCUS = 'focus'; |
||
| 195 | const POPOVER_TRIGGER_MANUAL = 'manual'; |
||
| 196 | |||
| 197 | // |
||
| 198 | // ALERT |
||
| 199 | // -------------------------------------------------- |
||
| 200 | |||
| 201 | const ALERT_COLOR_DEFAULT = ''; |
||
| 202 | const ALERT_COLOR_INFO = 'info'; |
||
| 203 | const ALERT_COLOR_SUCCESS = 'success'; |
||
| 204 | const ALERT_COLOR_WARNING = 'warning'; |
||
| 205 | const ALERT_COLOR_ERROR = 'error'; |
||
| 206 | const ALERT_COLOR_DANGER = 'danger'; |
||
| 207 | |||
| 208 | // |
||
| 209 | // PROGRESS BARS |
||
| 210 | // -------------------------------------------------- |
||
| 211 | |||
| 212 | const PROGRESS_COLOR_DEFAULT = ''; |
||
| 213 | const PROGRESS_COLOR_INFO = 'info'; |
||
| 214 | const PROGRESS_COLOR_SUCCESS = 'success'; |
||
| 215 | const PROGRESS_COLOR_WARNING = 'warning'; |
||
| 216 | const PROGRESS_COLOR_DANGER = 'danger'; |
||
| 217 | |||
| 218 | // |
||
| 219 | // MISC |
||
| 220 | // -------------------------------------------------- |
||
| 221 | |||
| 222 | const WELL_SIZE_SMALL = 'small'; |
||
| 223 | const WELL_SIZE_DEFAULT = ''; |
||
| 224 | const WELL_SIZE_LARGE = 'large'; |
||
| 225 | |||
| 226 | const PULL_LEFT = 'left'; |
||
| 227 | const PULL_RIGHT = 'right'; |
||
| 228 | |||
| 229 | const CLOSE_DISMISS_ALERT = 'alert'; |
||
| 230 | const CLOSE_DISMISS_MODAL = 'modal'; |
||
| 231 | |||
| 232 | // |
||
| 233 | // DETAIL VIEW |
||
| 234 | // -------------------------------------------------- |
||
| 235 | |||
| 236 | const DETAIL_TYPE_STRIPED = 'striped'; |
||
| 237 | const DETAIL_TYPE_BORDERED = 'bordered'; |
||
| 238 | const DETAIL_TYPE_CONDENSED = 'condensed'; |
||
| 239 | const DETAIL_TYPE_HOVER = 'hover'; |
||
| 240 | |||
| 241 | // |
||
| 242 | // GRID VIEW |
||
| 243 | // -------------------------------------------------- |
||
| 244 | |||
| 245 | const GRID_TYPE_STRIPED = 'striped'; |
||
| 246 | const GRID_TYPE_BORDERED = 'bordered'; |
||
| 247 | const GRID_TYPE_CONDENSED = 'condensed'; |
||
| 248 | const GRID_TYPE_HOVER = 'hover'; |
||
| 249 | |||
| 250 | // |
||
| 251 | // AFFIX |
||
| 252 | // -------------------------------------------------- |
||
| 253 | |||
| 254 | const AFFIX_POSITION_TOP = 'top'; |
||
| 255 | const AFFIX_POSITION_BOTTOM = 'bottom'; |
||
| 256 | |||
| 257 | // |
||
| 258 | // ICON |
||
| 259 | // -------------------------------------------------- |
||
| 260 | |||
| 261 | const ICON_COLOR_DEFAULT = ''; |
||
| 262 | const ICON_COLOR_WHITE = 'white'; |
||
| 263 | |||
| 264 | const ICON_GLASS = 'icon-glass'; |
||
| 265 | const ICON_MUSIC = 'icon-music'; |
||
| 266 | const ICON_SEARCH = 'icon-search'; |
||
| 267 | const ICON_ENVELOPE = 'icon-envelope'; |
||
| 268 | const ICON_HEART = 'icon-heart'; |
||
| 269 | const ICON_STAR = 'icon-star'; |
||
| 270 | const ICON_STAR_EMPTY = 'icon-star-empty'; |
||
| 271 | const ICON_USER = 'icon-user'; |
||
| 272 | const ICON_FILM = 'icon-film'; |
||
| 273 | const ICON_TH_LARGE = 'icon-th-large'; |
||
| 274 | const ICON_TH = 'icon-th'; |
||
| 275 | const ICON_TH_LIST = 'icon-th-list'; |
||
| 276 | const ICON_OK = 'icon-ok'; |
||
| 277 | const ICON_REMOVE = 'icon-remove'; |
||
| 278 | const ICON_ZOOM_IN = 'icon-zoom-in'; |
||
| 279 | const ICON_ZOOM_OUT = 'icon-zoom-out'; |
||
| 280 | const ICON_OFF = 'icon-off'; |
||
| 281 | const ICON_SIGNAL = 'icon-signal'; |
||
| 282 | const ICON_COG = 'icon-cog'; |
||
| 283 | const ICON_TRASH = 'icon-trash'; |
||
| 284 | const ICON_HOME = 'icon-home'; |
||
| 285 | const ICON_FILE = 'icon-file'; |
||
| 286 | const ICON_TIME = 'icon-time'; |
||
| 287 | const ICON_ROAD = 'icon-road'; |
||
| 288 | const ICON_DOWNLOAD_ALT = 'icon-download-alt'; |
||
| 289 | const ICON_DOWNLOAD = 'icon-download'; |
||
| 290 | const ICON_UPLOAD = 'icon-upload'; |
||
| 291 | const ICON_INBOX = 'icon-inbox'; |
||
| 292 | const ICON_PLAY_CIRCLE = 'icon-play-circle'; |
||
| 293 | const ICON_REPEAT = 'icon-repeat'; |
||
| 294 | const ICON_REFRESH = 'icon-refresh'; |
||
| 295 | const ICON_LIST_ALT = 'icon-list-alt'; |
||
| 296 | const ICON_LOCK = 'icon-lock'; |
||
| 297 | const ICON_FLAG = 'icon-flag'; |
||
| 298 | const ICON_HEADPHONES = 'icon-headphones'; |
||
| 299 | const ICON_VOLUME_OFF = 'icon-volume-off'; |
||
| 300 | const ICON_VOLUME_DOWN = 'icon-volume-down'; |
||
| 301 | const ICON_VOLUME_UP = 'icon-volume-up'; |
||
| 302 | const ICON_QRCODE = 'icon-qrcode'; |
||
| 303 | const ICON_BARCODE = 'icon-barcode'; |
||
| 304 | const ICON_TAG = 'icon-tag'; |
||
| 305 | const ICON_TAGS = 'icon-tags'; |
||
| 306 | const ICON_BOOK = 'icon-book'; |
||
| 307 | const ICON_BOOKMARK = 'icon-bookmark'; |
||
| 308 | const ICON_PRINT = 'icon-print'; |
||
| 309 | const ICON_CAMERA = 'icon-camera'; |
||
| 310 | const ICON_FONT = 'icon-font'; |
||
| 311 | const ICON_BOLD = 'icon-bold'; |
||
| 312 | const ICON_ITALIC = 'icon-italic'; |
||
| 313 | const ICON_TEXT_HEIGHT = 'icon-text-height'; |
||
| 314 | const ICON_TEXT_WIDTH = 'icon-text-width'; |
||
| 315 | const ICON_ALIGN_LEFT = 'icon-align-left'; |
||
| 316 | const ICON_ALIGN_CENTER = 'icon-align-center'; |
||
| 317 | const ICON_ALIGN_RIGHT = 'icon-align-right'; |
||
| 318 | const ICON_ALIGN_JUSTIFY = 'icon-align-justify'; |
||
| 319 | const ICON_LIST = 'icon-list'; |
||
| 320 | const ICON_INDENT_LEFT = 'icon-indent-left'; |
||
| 321 | const ICON_INDENT_RIGHT = 'icon-indent-right'; |
||
| 322 | const ICON_FACETIME_VIDEO = 'icon-facetime-video'; |
||
| 323 | const ICON_PICTURE = 'icon-picture'; |
||
| 324 | const ICON_PENCIL = 'icon-pencil'; |
||
| 325 | const ICON_MAP_MARKER = 'icon-map-marker'; |
||
| 326 | const ICON_ADJUST = 'icon-adjust'; |
||
| 327 | const ICON_TINT = 'icon-tint'; |
||
| 328 | const ICON_EDIT = 'icon-edit'; |
||
| 329 | const ICON_SHARE = 'icon-share'; |
||
| 330 | const ICON_CHECK = 'icon-check'; |
||
| 331 | const ICON_MOVE = 'icon-move'; |
||
| 332 | const ICON_STEP_BACKWARD = 'icon-step-backward'; |
||
| 333 | const ICON_FAST_BACKWARD = 'icon-fast-backward'; |
||
| 334 | const ICON_BACKWARD = 'icon-backward'; |
||
| 335 | const ICON_PLAY = 'icon-play'; |
||
| 336 | const ICON_PAUSE = 'icon-pause'; |
||
| 337 | const ICON_STOP = 'icon-pause'; |
||
| 338 | const ICON_FORWARD = 'icon-forward'; |
||
| 339 | const ICON_FAST_FORWARD = 'icon-fast-forward'; |
||
| 340 | const ICON_STEP_FORWARD = 'icon-step-forward'; |
||
| 341 | const ICON_EJECT = 'icon-eject'; |
||
| 342 | const ICON_CHEVRON_LEFT = 'icon-chevron-left'; |
||
| 343 | const ICON_CHEVRON_RIGHT = 'icon-chevron-right'; |
||
| 344 | const ICON_PLUS_SIGN = 'icon-plus-sign'; |
||
| 345 | const ICON_MINUS_SIGN = 'icon-minus-sign'; |
||
| 346 | const ICON_REMOVE_SIGN = 'icon-remove-sign'; |
||
| 347 | const ICON_OK_SIGN = 'icon-ok-sign'; |
||
| 348 | const ICON_QUESTION_SIGN = 'icon-question-sign'; |
||
| 349 | const ICON_INFO_SIGN = 'icon-info-sign'; |
||
| 350 | const ICON_SCREENSHOT = 'icon-screenshot'; |
||
| 351 | const ICON_REMOVE_CIRCLE = 'icon-remove-circle'; |
||
| 352 | const ICON_OK_CIRCLE = 'icon-ok-circle'; |
||
| 353 | const ICON_BAN_CIRCLE = 'icon-ban-circle'; |
||
| 354 | const ICON_ARROW_LEFT = 'icon-arrow-left'; |
||
| 355 | const ICON_ARROW_RIGHT = 'icon-arrow-right'; |
||
| 356 | const ICON_ARROW_UP = 'icon-arrow-up'; |
||
| 357 | const ICON_ARROW_DOWN = 'icon-arrow-down'; |
||
| 358 | const ICON_SHARE_ALT = 'icon-share-alt'; |
||
| 359 | const ICON_RESIZE_FULL = 'icon-resize-full'; |
||
| 360 | const ICON_RESIZE_SMALL = 'icon-resize-small'; |
||
| 361 | const ICON_PLUS = 'icon-plus'; |
||
| 362 | const ICON_MINUS = 'icon-minus'; |
||
| 363 | const ICON_ASTERISK = 'icon-asterisk'; |
||
| 364 | const ICON_EXCLAMATION_SIGN = 'icon-exclamation-sign'; |
||
| 365 | const ICON_GIFT = 'icon-gift'; |
||
| 366 | const ICON_LEAF = 'icon-leaf'; |
||
| 367 | const ICON_FIRE = 'icon-fire'; |
||
| 368 | const ICON_EYE_OPEN = 'icon-eye-open'; |
||
| 369 | const ICON_EYE_CLOSE = 'icon-eye-close'; |
||
| 370 | const ICON_WARNING_SIGN = 'icon-warning-sign'; |
||
| 371 | const ICON_PLANE = 'icon-plane'; |
||
| 372 | const ICON_CALENDAR = 'icon-calendar'; |
||
| 373 | const ICON_RANDOM = 'icon-random'; |
||
| 374 | const ICON_COMMENT = 'icon-comment'; |
||
| 375 | const ICON_MAGNET = 'icon-magnet'; |
||
| 376 | const ICON_CHEVRON_UP = 'icon-chevron-up'; |
||
| 377 | const ICON_CHEVRON_DOWN = 'icon-chevron-down'; |
||
| 378 | const ICON_RETWEET = 'icon-retweet'; |
||
| 379 | const ICON_SHOPPING_CART = 'icon-shopping-cart'; |
||
| 380 | const ICON_FOLDER_CLOSE = 'icon-folder-close'; |
||
| 381 | const ICON_FOLDER_OPEN = 'icon-folder-open'; |
||
| 382 | const ICON_RESIZE_VERTICAL = 'icon-resize-vertical'; |
||
| 383 | const ICON_RESIZE_HORIZONTAL = 'icon-resize-horizontal'; |
||
| 384 | const ICON_HDD = 'icon-hdd'; |
||
| 385 | const ICON_BULLHORN = 'icon-bullhorn'; |
||
| 386 | const ICON_BELL = 'icon-bell'; |
||
| 387 | const ICON_CERTFICATE = 'icon-certificate'; |
||
| 388 | const ICON_THUMBS_UP = 'icon-thumbs-up'; |
||
| 389 | const ICON_THUMBS_DOWN = 'icon-thumbs-down'; |
||
| 390 | const ICON_HAND_RIGHT = 'icon-hand-right'; |
||
| 391 | const ICON_HAND_LEFT = 'icon-hand-left'; |
||
| 392 | const ICON_HAND_UP = 'icon-hand-up'; |
||
| 393 | const ICON_HAND_DOWN = 'icon-hand-down'; |
||
| 394 | const ICON_CIRCLE_ARROW_RIGHT = 'icon-circle-arrow-right'; |
||
| 395 | const ICON_CIRCLE_ARROW_LEFT = 'icon-circle-arrow-left'; |
||
| 396 | const ICON_CIRCLE_ARROW_UP = 'icon-circle-arrow-up'; |
||
| 397 | const ICON_CIRCLE_ARROW_DOWN = 'icon-circle-arrow-down'; |
||
| 398 | const ICON_GLOBE = 'icon-globe'; |
||
| 399 | const ICON_WRENCH = 'icon-wrench'; |
||
| 400 | const ICON_TASKS = 'icon-tasks'; |
||
| 401 | const ICON_FILTER = 'icon-filter'; |
||
| 402 | const ICON_BRIEFCASE = 'icon-briefcase'; |
||
| 403 | const ICON_FULLSCREEN = 'icon-fullscreen'; |
||
| 404 | |||
| 405 | // Default close text. |
||
| 406 | const CLOSE_TEXT = '×'; |
||
| 407 | |||
| 408 | /** |
||
| 409 | * @var string the CSS class for displaying error summaries. |
||
| 410 | */ |
||
| 411 | public static $errorSummaryCss = 'alert alert-block alert-error'; |
||
| 412 | |||
| 413 | // |
||
| 414 | // BASE CSS |
||
| 415 | // -------------------------------------------------- |
||
| 416 | |||
| 417 | // Typography |
||
| 418 | // http://twitter.github.io/bootstrap/2.3.2/base-css.html#typography |
||
| 419 | // -------------------------------------------------- |
||
| 420 | |||
| 421 | /** |
||
| 422 | * Generates a paragraph that stands out. |
||
| 423 | * @param string $text the lead text. |
||
| 424 | * @param array $htmlOptions additional HTML attributes. |
||
| 425 | * @return string the generated paragraph. |
||
| 426 | */ |
||
| 427 | public static function lead($text, $htmlOptions = array()) |
||
| 432 | |||
| 433 | /** |
||
| 434 | * Generates small text. |
||
| 435 | * @param string $text the text to style. |
||
| 436 | * @param array $htmlOptions additional HTML attributes. |
||
| 437 | * @return string the generated text. |
||
| 438 | */ |
||
| 439 | public static function small($text, $htmlOptions = array()) |
||
| 443 | |||
| 444 | /** |
||
| 445 | * Generates bold text. |
||
| 446 | * @param string $text the text to style. |
||
| 447 | * @param array $htmlOptions additional HTML attributes. |
||
| 448 | * @return string the generated text. |
||
| 449 | */ |
||
| 450 | public static function b($text, $htmlOptions = array()) |
||
| 454 | |||
| 455 | /** |
||
| 456 | * Generates italic text. |
||
| 457 | * @param string $text the text to style. |
||
| 458 | * @param array $htmlOptions additional HTML attributes. |
||
| 459 | * @return string the generated text. |
||
| 460 | */ |
||
| 461 | public static function i($text, $htmlOptions = array()) |
||
| 465 | |||
| 466 | /** |
||
| 467 | * Generates an emphasized text. |
||
| 468 | * @param string $text the text to emphasize. |
||
| 469 | * @param array $htmlOptions additional HTML attributes. |
||
| 470 | * @param string $tag the HTML tag. |
||
| 471 | * @return string the generated text. |
||
| 472 | */ |
||
| 473 | public static function em($text, $htmlOptions = array(), $tag = 'p') |
||
| 485 | |||
| 486 | /** |
||
| 487 | * Generates a muted text block. |
||
| 488 | * @param string $text the text. |
||
| 489 | * @param array $htmlOptions additional HTML attributes. |
||
| 490 | * @param string $tag the HTML tag. |
||
| 491 | * @return string the generated text block. |
||
| 492 | */ |
||
| 493 | public static function muted($text, $htmlOptions = array(), $tag = 'p') |
||
| 498 | |||
| 499 | /** |
||
| 500 | * Generates a muted span. |
||
| 501 | * @param string $text the text. |
||
| 502 | * @param array $htmlOptions additional HTML attributes. |
||
| 503 | * @return string the generated span. |
||
| 504 | */ |
||
| 505 | public static function mutedSpan($text, $htmlOptions = array()) |
||
| 509 | |||
| 510 | /** |
||
| 511 | * Generates an abbreviation with a help text. |
||
| 512 | * @param string $text the abbreviation. |
||
| 513 | * @param string $word the word the abbreviation is for. |
||
| 514 | * @param array $htmlOptions additional HTML attributes. |
||
| 515 | * @return string the generated abbreviation. |
||
| 516 | */ |
||
| 517 | public static function abbr($text, $word, $htmlOptions = array()) |
||
| 525 | |||
| 526 | /** |
||
| 527 | * Generates a small abbreviation with a help text. |
||
| 528 | * @param string $text the abbreviation. |
||
| 529 | * @param string $word the word the abbreviation is for. |
||
| 530 | * @param array $htmlOptions additional HTML attributes. |
||
| 531 | * @return string the generated abbreviation. |
||
| 532 | */ |
||
| 533 | public static function smallAbbr($text, $word, $htmlOptions = array()) |
||
| 538 | |||
| 539 | /** |
||
| 540 | * Generates an address block. |
||
| 541 | * @param array $htmlOptions additional HTML attributes. |
||
| 542 | * @return string the generated block. |
||
| 543 | */ |
||
| 544 | public static function address($text, $htmlOptions = array()) |
||
| 548 | |||
| 549 | /** |
||
| 550 | * Generates a quote. |
||
| 551 | * @param string $text the quoted text. |
||
| 552 | * @param array $htmlOptions additional HTML attributes. |
||
| 553 | * @return string the generated quote. |
||
| 554 | */ |
||
| 555 | public static function quote($text, $htmlOptions = array()) |
||
| 567 | |||
| 568 | /** |
||
| 569 | * Generates a help text. |
||
| 570 | * @param string $text the help text. |
||
| 571 | * @param array $htmlOptions additional HTML attributes. |
||
| 572 | * @return string the generated text. |
||
| 573 | */ |
||
| 574 | public static function help($text, $htmlOptions = array()) |
||
| 580 | |||
| 581 | /** |
||
| 582 | * Generates a help block. |
||
| 583 | * @param string $text the help text. |
||
| 584 | * @param array $htmlOptions additional HTML attributes. |
||
| 585 | * @return string the generated block. |
||
| 586 | */ |
||
| 587 | public static function helpBlock($text, $htmlOptions = array()) |
||
| 592 | |||
| 593 | // Code |
||
| 594 | // http://twitter.github.io/bootstrap/2.3.2/base-css.html#code |
||
| 595 | // -------------------------------------------------- |
||
| 596 | |||
| 597 | /** |
||
| 598 | * Generates inline code. |
||
| 599 | * @param string $code the code. |
||
| 600 | * @param array $htmlOptions additional HTML attributes. |
||
| 601 | * @return string the generated code. |
||
| 602 | */ |
||
| 603 | public static function code($code, $htmlOptions = array()) |
||
| 607 | |||
| 608 | /** |
||
| 609 | * Generates a code block. |
||
| 610 | * @param string $code the code. |
||
| 611 | * @param array $htmlOptions additional HTML attributes. |
||
| 612 | * @return string the generated block. |
||
| 613 | */ |
||
| 614 | public static function codeBlock($code, $htmlOptions = array()) |
||
| 618 | |||
| 619 | /** |
||
| 620 | * Generates an HTML element. |
||
| 621 | * @param string $tag the tag name. |
||
| 622 | * @param array $htmlOptions the element attributes. |
||
| 623 | * @param mixed $content the content to be enclosed between open and close element tags. |
||
| 624 | * @param boolean $closeTag whether to generate the close tag. |
||
| 625 | * @return string the generated HTML element tag. |
||
| 626 | */ |
||
| 627 | public static function tag($tag, $htmlOptions = array(), $content = false, $closeTag = true) |
||
| 634 | |||
| 635 | /** |
||
| 636 | * Generates an open HTML element. |
||
| 637 | * @param string $tag the tag name. |
||
| 638 | * @param array $htmlOptions the element attributes. |
||
| 639 | * @return string the generated HTML element tag. |
||
| 640 | */ |
||
| 641 | public static function openTag($tag, $htmlOptions = array()) |
||
| 645 | |||
| 646 | // Tables |
||
| 647 | // http://twitter.github.io/bootstrap/2.3.2/base-css.html#forms |
||
| 648 | // -------------------------------------------------- |
||
| 649 | |||
| 650 | // todo: create table methods here. |
||
| 651 | |||
| 652 | // Forms |
||
| 653 | // http://twitter.github.io/bootstrap/2.3.2/base-css.html#tables |
||
| 654 | // -------------------------------------------------- |
||
| 655 | |||
| 656 | /** |
||
| 657 | * Generates a form tag. |
||
| 658 | * @param string $layout the form layout. |
||
| 659 | * @param string $action the form action URL. |
||
| 660 | * @param string $method form method (e.g. post, get). |
||
| 661 | * @param array $htmlOptions additional HTML attributes. |
||
| 662 | * @return string the generated tag. |
||
| 663 | */ |
||
| 664 | public static function formTb( |
||
| 672 | |||
| 673 | /** |
||
| 674 | * Generates an open form tag. |
||
| 675 | * @param string $layout the form layout. |
||
| 676 | * @param string $action the form action URL. |
||
| 677 | * @param string $method form method (e.g. post, get). |
||
| 678 | * @param array $htmlOptions additional HTML attributes. |
||
| 679 | * @return string the generated tag. |
||
| 680 | */ |
||
| 681 | public static function beginFormTb( |
||
| 692 | |||
| 693 | /** |
||
| 694 | * Generates a stateful form tag. |
||
| 695 | * @param mixed $action the form action URL. |
||
| 696 | * @param string $method form method (e.g. post, get). |
||
| 697 | * @param array $htmlOptions additional HTML attributes. |
||
| 698 | * @return string the generated form tag. |
||
| 699 | */ |
||
| 700 | public static function statefulFormTb( |
||
| 709 | |||
| 710 | /** |
||
| 711 | * Generates a text field input. |
||
| 712 | * @param string $name the input name. |
||
| 713 | * @param string $value the input value. |
||
| 714 | * @param array $htmlOptions additional HTML attributes. |
||
| 715 | * @return string the generated input field. |
||
| 716 | * @see self::textInputField |
||
| 717 | */ |
||
| 718 | public static function textField($name, $value = '', $htmlOptions = array()) |
||
| 722 | |||
| 723 | /** |
||
| 724 | * Generates a password field input. |
||
| 725 | * @param string $name the input name. |
||
| 726 | * @param string $value the input value. |
||
| 727 | * @param array $htmlOptions additional HTML attributes. |
||
| 728 | * @return string the generated input field. |
||
| 729 | * @see self::textInputField |
||
| 730 | */ |
||
| 731 | public static function passwordField($name, $value = '', $htmlOptions = array()) |
||
| 735 | |||
| 736 | /** |
||
| 737 | * Generates an url field input. |
||
| 738 | * @param string $name the input name. |
||
| 739 | * @param string $value the input value. |
||
| 740 | * @param array $htmlOptions additional HTML attributes. |
||
| 741 | * @return string the generated input field. |
||
| 742 | * @see self::textInputField |
||
| 743 | */ |
||
| 744 | public static function urlField($name, $value = '', $htmlOptions = array()) |
||
| 748 | |||
| 749 | /** |
||
| 750 | * Generates an email field input. |
||
| 751 | * @param string $name the input name. |
||
| 752 | * @param string $value the input value. |
||
| 753 | * @param array $htmlOptions additional HTML attributes. |
||
| 754 | * @return string the generated input field. |
||
| 755 | * @see self::textInputField |
||
| 756 | */ |
||
| 757 | public static function emailField($name, $value = '', $htmlOptions = array()) |
||
| 761 | |||
| 762 | /** |
||
| 763 | * Generates a number field input. |
||
| 764 | * @param string $name the input name. |
||
| 765 | * @param string $value the input value. |
||
| 766 | * @param array $htmlOptions additional HTML attributes. |
||
| 767 | * @return string the generated input field. |
||
| 768 | * @see self::textInputField |
||
| 769 | */ |
||
| 770 | public static function numberField($name, $value = '', $htmlOptions = array()) |
||
| 774 | |||
| 775 | /** |
||
| 776 | * Generates a range field input. |
||
| 777 | * @param string $name the input name. |
||
| 778 | * @param string $value the input value. |
||
| 779 | * @param array $htmlOptions additional HTML attributes. |
||
| 780 | * @return string the generated input field. |
||
| 781 | * @see self::textInputField |
||
| 782 | */ |
||
| 783 | public static function rangeField($name, $value = '', $htmlOptions = array()) |
||
| 787 | |||
| 788 | /** |
||
| 789 | * Generates a date field input. |
||
| 790 | * @param string $name the input name. |
||
| 791 | * @param string $value the input value. |
||
| 792 | * @param array $htmlOptions additional HTML attributes. |
||
| 793 | * @return string the generated input field. |
||
| 794 | * @see self::textInputField |
||
| 795 | */ |
||
| 796 | public static function dateField($name, $value = '', $htmlOptions = array()) |
||
| 800 | |||
| 801 | /** |
||
| 802 | * Generates a file field input. |
||
| 803 | * @param string $name the input name. |
||
| 804 | * @param string $value the input value. |
||
| 805 | * @param array $htmlOptions additional HTML attributes. |
||
| 806 | * @return string the generated input field. |
||
| 807 | * @see CHtml::fileField |
||
| 808 | */ |
||
| 809 | public static function fileField($name, $value = '', $htmlOptions = array()) |
||
| 813 | |||
| 814 | /** |
||
| 815 | * Generates a text area input. |
||
| 816 | * @param string $name the input name. |
||
| 817 | * @param string $value the input value. |
||
| 818 | * @param array $htmlOptions additional HTML attributes. |
||
| 819 | * @return string the generated text area. |
||
| 820 | */ |
||
| 821 | public static function textArea($name, $value = '', $htmlOptions = array()) |
||
| 826 | |||
| 827 | /** |
||
| 828 | * Generates a radio button. |
||
| 829 | * @param string $name the input name. |
||
| 830 | * @param boolean $checked whether the radio button is checked. |
||
| 831 | * @param array $htmlOptions additional HTML attributes. |
||
| 832 | * @return string the generated radio button. |
||
| 833 | */ |
||
| 834 | public static function radioButton($name, $checked = false, $htmlOptions = array()) |
||
| 842 | |||
| 843 | /** |
||
| 844 | * Generates a check box. |
||
| 845 | * @param string $name the input name. |
||
| 846 | * @param boolean $checked whether the check box is checked. |
||
| 847 | * @param array $htmlOptions additional HTML attributes. |
||
| 848 | * @return string the generated check box. |
||
| 849 | */ |
||
| 850 | public static function checkBox($name, $checked = false, $htmlOptions = array()) |
||
| 858 | |||
| 859 | /** |
||
| 860 | * Generates a drop down list. |
||
| 861 | * @param string $name the input name. |
||
| 862 | * @param string $select the selected value. |
||
| 863 | * @param array $data data for generating the list options (value=>display). |
||
| 864 | * @return string the generated drop down list. |
||
| 865 | */ |
||
| 866 | public static function dropDownList($name, $select, $data, $htmlOptions = array()) |
||
| 875 | |||
| 876 | /** |
||
| 877 | * Generates a list box. |
||
| 878 | * @param string $name the input name. |
||
| 879 | * @param string $select the selected value(s). |
||
| 880 | * @param array $data data for generating the list options (value=>display). |
||
| 881 | * @param array $htmlOptions additional HTML attributes. |
||
| 882 | * @return string the generated list box |
||
| 883 | */ |
||
| 884 | public static function listBox($name, $select, $data, $htmlOptions = array()) |
||
| 894 | |||
| 895 | /** |
||
| 896 | * Generates a radio button list. |
||
| 897 | * @param string $name name of the radio button list. |
||
| 898 | * @param mixed $select selection of the radio buttons. |
||
| 899 | * @param array $data $data value-label pairs used to generate the radio button list. |
||
| 900 | * @param array $htmlOptions additional HTML attributes. |
||
| 901 | * @return string the generated list. |
||
| 902 | */ |
||
| 903 | public static function radioButtonList($name, $select, $data, $htmlOptions = array()) |
||
| 934 | |||
| 935 | /** |
||
| 936 | * Generates an inline radio button list. |
||
| 937 | * @param string $name name of the radio button list. |
||
| 938 | * @param string $select selection of the radio buttons. |
||
| 939 | * @param array $data $data value-label pairs used to generate the radio button list. |
||
| 940 | * @param array $htmlOptions additional HTML attributes. |
||
| 941 | * @return string the generated list. |
||
| 942 | */ |
||
| 943 | public static function inlineRadioButtonList($name, $select, $data, $htmlOptions = array()) |
||
| 948 | |||
| 949 | /** |
||
| 950 | * Generates a check box list. |
||
| 951 | * @param string $name name of the check box list. |
||
| 952 | * @param mixed $select selection of the check boxes. |
||
| 953 | * @param array $data $data value-label pairs used to generate the check box list. |
||
| 954 | * @param array $htmlOptions additional HTML attributes. |
||
| 955 | * @return string the generated list. |
||
| 956 | */ |
||
| 957 | public static function checkBoxList($name, $select, $data, $htmlOptions = array()) |
||
| 1026 | |||
| 1027 | /** |
||
| 1028 | * Generates an inline check box list. |
||
| 1029 | * @param string $name name of the check box list. |
||
| 1030 | * @param string $select selection of the check boxes. |
||
| 1031 | * @param array $data $data value-label pairs used to generate the check box list. |
||
| 1032 | * @param array $htmlOptions additional HTML attributes. |
||
| 1033 | * @return string the generated list. |
||
| 1034 | */ |
||
| 1035 | public static function inlineCheckBoxList($name, $select, $data, $htmlOptions = array()) |
||
| 1040 | |||
| 1041 | /** |
||
| 1042 | * Generates an uneditable input. |
||
| 1043 | * @param string $value the value. |
||
| 1044 | * @param array $htmlOptions additional HTML attributes. |
||
| 1045 | * @return string the generated input. |
||
| 1046 | */ |
||
| 1047 | public static function uneditableField($value, $htmlOptions = array()) |
||
| 1053 | |||
| 1054 | /** |
||
| 1055 | * Generates a search input. |
||
| 1056 | * @param string $name the input name. |
||
| 1057 | * @param string $value the input value. |
||
| 1058 | * @param array $htmlOptions additional HTML attributes. |
||
| 1059 | * @return string the generated input. |
||
| 1060 | */ |
||
| 1061 | public static function searchQueryField($name, $value = '', $htmlOptions = array()) |
||
| 1066 | |||
| 1067 | /** |
||
| 1068 | * Generates a control group with a text field. |
||
| 1069 | * @param string $name the input name. |
||
| 1070 | * @param string $value the input value. |
||
| 1071 | * @param array $htmlOptions additional HTML attributes. |
||
| 1072 | * @return string the generated control group. |
||
| 1073 | * @see self::controlGroup |
||
| 1074 | */ |
||
| 1075 | public static function textFieldControlGroup($name, $value = '', $htmlOptions = array()) |
||
| 1079 | |||
| 1080 | /** |
||
| 1081 | * Generates a control group with a password field. |
||
| 1082 | * @param string $name the input name. |
||
| 1083 | * @param string $value the input value. |
||
| 1084 | * @param array $htmlOptions additional HTML attributes. |
||
| 1085 | * @return string the generated control group. |
||
| 1086 | * @see self::textInputField |
||
| 1087 | */ |
||
| 1088 | public static function passwordFieldControlGroup($name, $value = '', $htmlOptions = array()) |
||
| 1092 | |||
| 1093 | /** |
||
| 1094 | * Generates a control group with an url field. |
||
| 1095 | * @param string $name the input name. |
||
| 1096 | * @param string $value the input value. |
||
| 1097 | * @param array $htmlOptions additional HTML attributes. |
||
| 1098 | * @return string the generated control group. |
||
| 1099 | * @see self::controlGroup |
||
| 1100 | */ |
||
| 1101 | public static function urlFieldControlGroup($name, $value = '', $htmlOptions = array()) |
||
| 1105 | |||
| 1106 | /** |
||
| 1107 | * Generates a control group with an email field. |
||
| 1108 | * @param string $name the input name. |
||
| 1109 | * @param string $value the input value. |
||
| 1110 | * @param array $htmlOptions additional HTML attributes. |
||
| 1111 | * @return string the generated control group. |
||
| 1112 | * @see self::controlGroup |
||
| 1113 | */ |
||
| 1114 | public static function emailFieldControlGroup($name, $value = '', $htmlOptions = array()) |
||
| 1118 | |||
| 1119 | /** |
||
| 1120 | * Generates a control group with a number field. |
||
| 1121 | * @param string $name the input name. |
||
| 1122 | * @param string $value the input value. |
||
| 1123 | * @param array $htmlOptions additional HTML attributes. |
||
| 1124 | * @return string the generated control group. |
||
| 1125 | * @see self::textInputField |
||
| 1126 | */ |
||
| 1127 | public static function numberFieldControlGroup($name, $value = '', $htmlOptions = array()) |
||
| 1131 | |||
| 1132 | /** |
||
| 1133 | * Generates a control group with a range field. |
||
| 1134 | * @param string $name the input name |
||
| 1135 | * @param string $value the input value |
||
| 1136 | * @param array $htmlOptions additional HTML attributes. |
||
| 1137 | * @return string the generated control group. |
||
| 1138 | * @see self::controlGroup |
||
| 1139 | */ |
||
| 1140 | public static function rangeFieldControlGroup($name, $value = '', $htmlOptions = array()) |
||
| 1144 | |||
| 1145 | /** |
||
| 1146 | * Generates a control group with a file field. |
||
| 1147 | * @param string $name the input name. |
||
| 1148 | * @param string $value the input value. |
||
| 1149 | * @param array $htmlOptions additional HTML attributes. |
||
| 1150 | * @return string the generated control group. |
||
| 1151 | * @see self::controlGroup |
||
| 1152 | */ |
||
| 1153 | public static function dateFieldControlGroup($name, $value = '', $htmlOptions = array()) |
||
| 1157 | |||
| 1158 | /** |
||
| 1159 | * Generates a control group with a text area. |
||
| 1160 | * @param string $name the input name. |
||
| 1161 | * @param string $value the input value. |
||
| 1162 | * @param array $htmlOptions additional HTML attributes. |
||
| 1163 | * @return string the generated control group. |
||
| 1164 | * @see self::controlGroup |
||
| 1165 | */ |
||
| 1166 | public static function textAreaControlGroup($name, $value = '', $htmlOptions = array()) |
||
| 1170 | |||
| 1171 | /** |
||
| 1172 | * Generates a control group with a file field. |
||
| 1173 | * @param string $name the input name. |
||
| 1174 | * @param string $value the input value. |
||
| 1175 | * @param array $htmlOptions additional HTML attributes. |
||
| 1176 | * @return string the generated control group. |
||
| 1177 | * @see self::controlGroup |
||
| 1178 | */ |
||
| 1179 | public static function fileFieldControlGroup($name, $value = '', $htmlOptions = array()) |
||
| 1183 | |||
| 1184 | /** |
||
| 1185 | * Generates a control group with a radio button. |
||
| 1186 | * @param string $name the input name. |
||
| 1187 | * @param string $checked whether the radio button is checked. |
||
| 1188 | * @param array $htmlOptions additional HTML attributes. |
||
| 1189 | * @return string the generated control group. |
||
| 1190 | * @see self::controlGroup |
||
| 1191 | */ |
||
| 1192 | public static function radioButtonControlGroup($name, $checked = false, $htmlOptions = array()) |
||
| 1196 | |||
| 1197 | /** |
||
| 1198 | * Generates a control group with a check box. |
||
| 1199 | * @param string $name the input name. |
||
| 1200 | * @param string $checked whether the check box is checked. |
||
| 1201 | * @param array $htmlOptions additional HTML attributes. |
||
| 1202 | * @return string the generated control group. |
||
| 1203 | * @see self::controlGroup |
||
| 1204 | */ |
||
| 1205 | public static function checkBoxControlGroup($name, $checked = false, $htmlOptions = array()) |
||
| 1209 | |||
| 1210 | /** |
||
| 1211 | * Generates a control group with a drop down list. |
||
| 1212 | * @param string $name the input name. |
||
| 1213 | * @param string $select the selected value. |
||
| 1214 | * @param array $data data for generating the list options (value=>display). |
||
| 1215 | * @param array $htmlOptions additional HTML attributes. |
||
| 1216 | * @return string the generated control group. |
||
| 1217 | * @see self::controlGroup |
||
| 1218 | */ |
||
| 1219 | public static function dropDownListControlGroup($name, $select = '', $data = array(), $htmlOptions = array()) |
||
| 1223 | |||
| 1224 | /** |
||
| 1225 | * Generates a control group with a list box. |
||
| 1226 | * @param string $name the input name. |
||
| 1227 | * @param string $select the selected value. |
||
| 1228 | * @param array $data data for generating the list options (value=>display). |
||
| 1229 | * @param array $htmlOptions additional HTML attributes. |
||
| 1230 | * @return string the generated control group. |
||
| 1231 | * @see self::controlGroup |
||
| 1232 | */ |
||
| 1233 | public static function listBoxControlGroup($name, $select = '', $data = array(), $htmlOptions = array()) |
||
| 1237 | |||
| 1238 | /** |
||
| 1239 | * Generates a control group with a radio button list. |
||
| 1240 | * @param string $name the input name. |
||
| 1241 | * @param string $select the selected value. |
||
| 1242 | * @param array $data data for generating the list options (value=>display). |
||
| 1243 | * @param array $htmlOptions additional HTML attributes. |
||
| 1244 | * @return string the generated control group. |
||
| 1245 | * @see self::controlGroup |
||
| 1246 | */ |
||
| 1247 | public static function radioButtonListControlGroup($name, $select = '', $data = array(), $htmlOptions = array()) |
||
| 1251 | |||
| 1252 | /** |
||
| 1253 | * Generates a control group with an inline radio button list. |
||
| 1254 | * @param string $name the input name. |
||
| 1255 | * @param string $select the selected value. |
||
| 1256 | * @param array $data data for generating the list options (value=>display). |
||
| 1257 | * @param array $htmlOptions additional HTML attributes. |
||
| 1258 | * @return string the generated control group. |
||
| 1259 | * @see self::controlGroup |
||
| 1260 | */ |
||
| 1261 | public static function inlineRadioButtonListControlGroup( |
||
| 1269 | |||
| 1270 | /** |
||
| 1271 | * Generates a control group with a check box list. |
||
| 1272 | * @param string $name the input name. |
||
| 1273 | * @param string $select the selected value. |
||
| 1274 | * @param array $data data for generating the list options (value=>display). |
||
| 1275 | * @param array $htmlOptions additional HTML attributes. |
||
| 1276 | * @return string the generated control group. |
||
| 1277 | * @see self::controlGroup |
||
| 1278 | */ |
||
| 1279 | public static function checkBoxListControlGroup($name, $select = '', $data = array(), $htmlOptions = array()) |
||
| 1283 | |||
| 1284 | /** |
||
| 1285 | * Generates a control group with an inline check box list. |
||
| 1286 | * @param string $name the input name. |
||
| 1287 | * @param string $select the selected value. |
||
| 1288 | * @param array $data data for generating the list options (value=>display). |
||
| 1289 | * @param array $htmlOptions additional HTML attributes. |
||
| 1290 | * @return string the generated control group. |
||
| 1291 | * @see self::controlGroup |
||
| 1292 | */ |
||
| 1293 | public static function inlineCheckBoxListControlGroup($name, $select = '', $data = array(), $htmlOptions = array()) |
||
| 1297 | |||
| 1298 | /** |
||
| 1299 | * Generates a control group with an uneditable field. |
||
| 1300 | * @param array $htmlOptions additional HTML attributes. |
||
| 1301 | * @return string the generated control group. |
||
| 1302 | * @see self::controlGroup |
||
| 1303 | */ |
||
| 1304 | public static function uneditableFieldControlGroup($value = '', $htmlOptions = array()) |
||
| 1308 | |||
| 1309 | /** |
||
| 1310 | * Generates a control group with a search field. |
||
| 1311 | * @param string $name the input name. |
||
| 1312 | * @param array $htmlOptions additional HTML attributes. |
||
| 1313 | * @return string the generated control group. |
||
| 1314 | * @see self::controlGroup |
||
| 1315 | */ |
||
| 1316 | public static function searchQueryControlGroup($name, $value = '', $htmlOptions = array()) |
||
| 1320 | |||
| 1321 | /** |
||
| 1322 | * Generates a form control group. |
||
| 1323 | * @param string $type the input type. |
||
| 1324 | * @param string $name the input name. |
||
| 1325 | * @param string $value the input value. |
||
| 1326 | * @param array $htmlOptions additional HTML attributes. |
||
| 1327 | * @param array $data data for multiple select inputs. |
||
| 1328 | * @return string the generated control group. |
||
| 1329 | */ |
||
| 1330 | public static function controlGroup($type, $name, $value = '', $htmlOptions = array(), $data = array()) |
||
| 1367 | |||
| 1368 | /** |
||
| 1369 | * Generates a custom (pre-rendered) form control group. |
||
| 1370 | * @param string $input the rendered input. |
||
| 1371 | * @param string $name the input name. |
||
| 1372 | * @param array $htmlOptions additional HTML attributes. |
||
| 1373 | * @return string the generated control group. |
||
| 1374 | */ |
||
| 1375 | public static function customControlGroup($input, $name, $htmlOptions = array()) |
||
| 1380 | |||
| 1381 | /** |
||
| 1382 | * Creates a form input of the given type. |
||
| 1383 | * @param string $type the input type. |
||
| 1384 | * @param string $name the input name. |
||
| 1385 | * @param string $value the input value. |
||
| 1386 | * @param array $htmlOptions additional HTML attributes. |
||
| 1387 | * @param array $data data for multiple select inputs. |
||
| 1388 | * @return string the input. |
||
| 1389 | * @throws CException if the input type is invalid. |
||
| 1390 | */ |
||
| 1391 | public static function createInput($type, $name, $value, $htmlOptions = array(), $data = array()) |
||
| 1436 | |||
| 1437 | /** |
||
| 1438 | * Generates an input HTML tag. |
||
| 1439 | * This method generates an input HTML tag based on the given input name and value. |
||
| 1440 | * @param string $type the input type. |
||
| 1441 | * @param string $name the input name. |
||
| 1442 | * @param string $value the input value. |
||
| 1443 | * @param array $htmlOptions additional HTML attributes. |
||
| 1444 | * @return string the generated input tag. |
||
| 1445 | */ |
||
| 1446 | protected static function textInputField($type, $name, $value, $htmlOptions) |
||
| 1478 | |||
| 1479 | /** |
||
| 1480 | * Generates a text field input for a model attribute. |
||
| 1481 | * @param CModel $model the data model. |
||
| 1482 | * @param string $attribute the attribute. |
||
| 1483 | * @param array $htmlOptions additional HTML attributes. |
||
| 1484 | * @return string the generated input field. |
||
| 1485 | * @see self::activeTextInputField |
||
| 1486 | */ |
||
| 1487 | public static function activeTextField($model, $attribute, $htmlOptions = array()) |
||
| 1491 | |||
| 1492 | /** |
||
| 1493 | * Generates a password field input for a model attribute. |
||
| 1494 | * @param CModel $model the data model. |
||
| 1495 | * @param string $attribute the attribute. |
||
| 1496 | * @param array $htmlOptions additional HTML attributes. |
||
| 1497 | * @return string the generated input field. |
||
| 1498 | * @see self::activeTextInputField |
||
| 1499 | */ |
||
| 1500 | public static function activePasswordField($model, $attribute, $htmlOptions = array()) |
||
| 1504 | |||
| 1505 | /** |
||
| 1506 | * Generates an url field input for a model attribute. |
||
| 1507 | * @param CModel $model the data model. |
||
| 1508 | * @param string $attribute the attribute. |
||
| 1509 | * @param array $htmlOptions additional HTML attributes. |
||
| 1510 | * @return string the generated input field. |
||
| 1511 | * @see self::activeTextInputField |
||
| 1512 | */ |
||
| 1513 | public static function activeUrlField($model, $attribute, $htmlOptions = array()) |
||
| 1517 | |||
| 1518 | /** |
||
| 1519 | * Generates an email field input for a model attribute. |
||
| 1520 | * @param CModel $model the data model. |
||
| 1521 | * @param string $attribute the attribute. |
||
| 1522 | * @param array $htmlOptions additional HTML attributes. |
||
| 1523 | * @return string the generated input field. |
||
| 1524 | * @see self::activeTextInputField |
||
| 1525 | */ |
||
| 1526 | public static function activeEmailField($model, $attribute, $htmlOptions = array()) |
||
| 1530 | |||
| 1531 | /** |
||
| 1532 | * Generates a number field input for a model attribute. |
||
| 1533 | * @param CModel $model the data model. |
||
| 1534 | * @param string $attribute the attribute. |
||
| 1535 | * @param array $htmlOptions additional HTML attributes. |
||
| 1536 | * @return string the generated input field. |
||
| 1537 | * @see self::activeTextInputField |
||
| 1538 | */ |
||
| 1539 | public static function activeNumberField($model, $attribute, $htmlOptions = array()) |
||
| 1543 | |||
| 1544 | /** |
||
| 1545 | * Generates a range field input for a model attribute. |
||
| 1546 | * @param CModel $model the data model. |
||
| 1547 | * @param string $attribute the attribute. |
||
| 1548 | * @param array $htmlOptions additional HTML attributes. |
||
| 1549 | * @return string the generated input field. |
||
| 1550 | * @see self::activeTextInputField |
||
| 1551 | */ |
||
| 1552 | public static function activeRangeField($model, $attribute, $htmlOptions = array()) |
||
| 1556 | |||
| 1557 | /** |
||
| 1558 | * Generates a date field input for a model attribute. |
||
| 1559 | * @param CModel $model the data model. |
||
| 1560 | * @param string $attribute the attribute. |
||
| 1561 | * @param array $htmlOptions additional HTML attributes. |
||
| 1562 | * @return string the generated input field. |
||
| 1563 | * @see self::activeTextInputField |
||
| 1564 | */ |
||
| 1565 | public static function activeDateField($model, $attribute, $htmlOptions = array()) |
||
| 1569 | |||
| 1570 | /** |
||
| 1571 | * Generates a file field input for a model attribute. |
||
| 1572 | * @param CModel $model the data model. |
||
| 1573 | * @param string $attribute the attribute. |
||
| 1574 | * @param array $htmlOptions additional HTML attributes. |
||
| 1575 | * @return string the generated input field. |
||
| 1576 | * @see CHtml::activeFileField |
||
| 1577 | */ |
||
| 1578 | public static function activeFileField($model, $attribute, $htmlOptions = array()) |
||
| 1582 | |||
| 1583 | /** |
||
| 1584 | * Generates a text area input for a model attribute. |
||
| 1585 | * @param CModel $model the data model. |
||
| 1586 | * @param string $attribute the attribute. |
||
| 1587 | * @param array $htmlOptions additional HTML attributes. |
||
| 1588 | * @return string the generated text area. |
||
| 1589 | */ |
||
| 1590 | public static function activeTextArea($model, $attribute, $htmlOptions = array()) |
||
| 1595 | |||
| 1596 | /** |
||
| 1597 | * Generates a radio button for a model attribute. |
||
| 1598 | * @param CModel $model the data model. |
||
| 1599 | * @param string $attribute the attribute. |
||
| 1600 | * @param array $htmlOptions additional HTML attributes. |
||
| 1601 | * @return string the generated radio button. |
||
| 1602 | */ |
||
| 1603 | public static function activeRadioButton($model, $attribute, $htmlOptions = array()) |
||
| 1611 | |||
| 1612 | /** |
||
| 1613 | * Generates a check box for a model attribute. |
||
| 1614 | * @param CModel $model the data model. |
||
| 1615 | * @param string $attribute the attribute. |
||
| 1616 | * @param array $htmlOptions additional HTML attributes. |
||
| 1617 | * @return string the generated check box. |
||
| 1618 | */ |
||
| 1619 | public static function activeCheckBox($model, $attribute, $htmlOptions = array()) |
||
| 1627 | |||
| 1628 | /** |
||
| 1629 | * Generates a label for a checkbox or radio input by wrapping the input. |
||
| 1630 | * @param string $label the label text. |
||
| 1631 | * @param string $input the input. |
||
| 1632 | * @param array $htmlOptions additional HTML attributes. |
||
| 1633 | * @return string the generated label. |
||
| 1634 | */ |
||
| 1635 | protected static function createCheckBoxAndRadioButtonLabel($label, $input, $htmlOptions) |
||
| 1642 | |||
| 1643 | /** |
||
| 1644 | * Normalizes the inputs in the given string by splitting them up into an array. |
||
| 1645 | * @param string $input the inputs. |
||
| 1646 | * @return array an array with the following structure: array($hidden, $input) |
||
| 1647 | */ |
||
| 1648 | protected static function normalizeCheckBoxAndRadio($input) |
||
| 1657 | |||
| 1658 | /** |
||
| 1659 | * Generates a drop down list for a model attribute. |
||
| 1660 | * @param CModel $model the data model. |
||
| 1661 | * @param string $attribute the attribute. |
||
| 1662 | * @param array $data data for generating the list options (value=>display). |
||
| 1663 | * @return string the generated drop down list. |
||
| 1664 | */ |
||
| 1665 | public static function activeDropDownList($model, $attribute, $data, $htmlOptions = array()) |
||
| 1674 | |||
| 1675 | /** |
||
| 1676 | * Generates a list box for a model attribute. |
||
| 1677 | * @param CModel $model the data model. |
||
| 1678 | * @param string $attribute the attribute. |
||
| 1679 | * @param array $data data for generating the list options (value=>display). |
||
| 1680 | * @param array $htmlOptions additional HTML attributes. |
||
| 1681 | * @return string the generated list box |
||
| 1682 | */ |
||
| 1683 | public static function activeListBox($model, $attribute, $data, $htmlOptions = array()) |
||
| 1688 | |||
| 1689 | /** |
||
| 1690 | * Generates a radio button list for a model attribute. |
||
| 1691 | * @param CModel $model the data model. |
||
| 1692 | * @param string $attribute the attribute. |
||
| 1693 | * @param array $data $data value-label pairs used to generate the radio button list. |
||
| 1694 | * @param array $htmlOptions additional HTML attributes. |
||
| 1695 | * @return string the generated list. |
||
| 1696 | */ |
||
| 1697 | public static function activeRadioButtonList($model, $attribute, $data, $htmlOptions = array()) |
||
| 1707 | |||
| 1708 | /** |
||
| 1709 | * Generates an inline radio button list for a model attribute. |
||
| 1710 | * @param CModel $model the data model. |
||
| 1711 | * @param string $attribute the attribute. |
||
| 1712 | * @param array $data $data value-label pairs used to generate the radio button list. |
||
| 1713 | * @param array $htmlOptions additional HTML attributes. |
||
| 1714 | * @return string the generated list. |
||
| 1715 | */ |
||
| 1716 | public static function activeInlineRadioButtonList($model, $attribute, $data, $htmlOptions = array()) |
||
| 1721 | |||
| 1722 | /** |
||
| 1723 | * Generates a check box list for a model attribute. |
||
| 1724 | * @param CModel $model the data model. |
||
| 1725 | * @param string $attribute the attribute. |
||
| 1726 | * @param array $data $data value-label pairs used to generate the check box list. |
||
| 1727 | * @param array $htmlOptions additional HTML attributes. |
||
| 1728 | * @return string the generated list. |
||
| 1729 | */ |
||
| 1730 | public static function activeCheckBoxList($model, $attribute, $data, $htmlOptions = array()) |
||
| 1743 | |||
| 1744 | /** |
||
| 1745 | * Generates an inline check box list for a model attribute. |
||
| 1746 | * @param CModel $model the data model. |
||
| 1747 | * @param string $attribute the attribute. |
||
| 1748 | * @param array $data $data value-label pairs used to generate the check box list. |
||
| 1749 | * @param array $htmlOptions additional HTML attributes. |
||
| 1750 | * @return string the generated list. |
||
| 1751 | */ |
||
| 1752 | public static function activeInlineCheckBoxList($model, $attribute, $data, $htmlOptions = array()) |
||
| 1757 | |||
| 1758 | /** |
||
| 1759 | * Generates an uneditable input for a model attribute. |
||
| 1760 | * @param CModel $model the data model. |
||
| 1761 | * @param string $attribute the attribute. |
||
| 1762 | * @param array $htmlOptions additional HTML attributes. |
||
| 1763 | * @return string the generated input. |
||
| 1764 | */ |
||
| 1765 | public static function activeUneditableField($model, $attribute, $htmlOptions = array()) |
||
| 1772 | |||
| 1773 | /** |
||
| 1774 | * Generates a search query input for a model attribute. |
||
| 1775 | * @param CModel $model the data model. |
||
| 1776 | * @param string $attribute the attribute. |
||
| 1777 | * @param array $htmlOptions additional HTML attributes. |
||
| 1778 | * @return string the generated input. |
||
| 1779 | */ |
||
| 1780 | public static function activeSearchQueryField($model, $attribute, $htmlOptions = array()) |
||
| 1785 | |||
| 1786 | /** |
||
| 1787 | * Generates a control group with a text field for a model attribute. |
||
| 1788 | * @param CModel $model the data model. |
||
| 1789 | * @param string $attribute the attribute. |
||
| 1790 | * @param array $htmlOptions additional HTML attributes. |
||
| 1791 | * @return string the generated control group. |
||
| 1792 | * @see self::activeControlGroup |
||
| 1793 | */ |
||
| 1794 | public static function activeTextFieldControlGroup($model, $attribute, $htmlOptions = array()) |
||
| 1798 | |||
| 1799 | /** |
||
| 1800 | * Generates a control group with a password field for a model attribute. |
||
| 1801 | * @param CModel $model the data model. |
||
| 1802 | * @param string $attribute the attribute. |
||
| 1803 | * @param array $htmlOptions additional HTML attributes. |
||
| 1804 | * @return string the generated control group. |
||
| 1805 | * @see self::activeControlGroup |
||
| 1806 | */ |
||
| 1807 | public static function activePasswordFieldControlGroup($model, $attribute, $htmlOptions = array()) |
||
| 1811 | |||
| 1812 | /** |
||
| 1813 | * Generates a control group with a url field for a model attribute. |
||
| 1814 | * @param CModel $model the data model. |
||
| 1815 | * @param string $attribute the attribute. |
||
| 1816 | * @param array $htmlOptions additional HTML attributes. |
||
| 1817 | * @return string the generated control group. |
||
| 1818 | * @see self::activeControlGroup |
||
| 1819 | */ |
||
| 1820 | public static function activeUrlFieldControlGroup($model, $attribute, $htmlOptions = array()) |
||
| 1824 | |||
| 1825 | /** |
||
| 1826 | * Generates a control group with a email field for a model attribute. |
||
| 1827 | * @param CModel $model the data model. |
||
| 1828 | * @param string $attribute the attribute. |
||
| 1829 | * @param array $htmlOptions additional HTML attributes. |
||
| 1830 | * @return string the generated control group. |
||
| 1831 | * @see self::activeControlGroup |
||
| 1832 | */ |
||
| 1833 | public static function activeEmailFieldControlGroup($model, $attribute, $htmlOptions = array()) |
||
| 1837 | |||
| 1838 | /** |
||
| 1839 | * Generates a control group with a number field for a model attribute. |
||
| 1840 | * @param CModel $model the data model. |
||
| 1841 | * @param string $attribute the attribute. |
||
| 1842 | * @param array $htmlOptions additional HTML attributes. |
||
| 1843 | * @return string the generated control group. |
||
| 1844 | * @see self::activeControlGroup |
||
| 1845 | */ |
||
| 1846 | public static function activeNumberFieldControlGroup($model, $attribute, $htmlOptions = array()) |
||
| 1850 | |||
| 1851 | /** |
||
| 1852 | * Generates a control group with a range field for a model attribute. |
||
| 1853 | * @param CModel $model the data model. |
||
| 1854 | * @param string $attribute the attribute. |
||
| 1855 | * @param array $htmlOptions additional HTML attributes. |
||
| 1856 | * @return string the generated control group. |
||
| 1857 | * @see self::activeControlGroup |
||
| 1858 | */ |
||
| 1859 | public static function activeRangeFieldControlGroup($model, $attribute, $htmlOptions = array()) |
||
| 1863 | |||
| 1864 | /** |
||
| 1865 | * Generates a control group with a date field for a model attribute. |
||
| 1866 | * @param CModel $model the data model. |
||
| 1867 | * @param string $attribute the attribute. |
||
| 1868 | * @param array $htmlOptions additional HTML attributes. |
||
| 1869 | * @return string the generated control group. |
||
| 1870 | * @see self::activeControlGroup |
||
| 1871 | */ |
||
| 1872 | public static function activeDateFieldControlGroup($model, $attribute, $htmlOptions = array()) |
||
| 1876 | |||
| 1877 | /** |
||
| 1878 | * Generates a control group with a text area for a model attribute. |
||
| 1879 | * @param CModel $model the data model. |
||
| 1880 | * @param string $attribute the attribute. |
||
| 1881 | * @param array $htmlOptions additional HTML attributes. |
||
| 1882 | * @return string the generated control group. |
||
| 1883 | * @see self::activeControlGroup |
||
| 1884 | */ |
||
| 1885 | public static function activeTextAreaControlGroup($model, $attribute, $htmlOptions = array()) |
||
| 1889 | |||
| 1890 | /** |
||
| 1891 | * Generates a control group with a file field for a model attribute. |
||
| 1892 | * @param CModel $model the data model. |
||
| 1893 | * @param string $attribute the attribute. |
||
| 1894 | * @param array $htmlOptions additional HTML attributes. |
||
| 1895 | * @return string the generated control group. |
||
| 1896 | * @see self::activeControlGroup |
||
| 1897 | */ |
||
| 1898 | public static function activeFileFieldControlGroup($model, $attribute, $htmlOptions = array()) |
||
| 1902 | |||
| 1903 | /** |
||
| 1904 | * Generates a control group with a radio button for a model attribute. |
||
| 1905 | * @param CModel $model the data model. |
||
| 1906 | * @param string $attribute the attribute. |
||
| 1907 | * @param array $htmlOptions additional HTML attributes. |
||
| 1908 | * @return string the generated control group. |
||
| 1909 | * @see self::activeControlGroup |
||
| 1910 | */ |
||
| 1911 | public static function activeRadioButtonControlGroup($model, $attribute, $htmlOptions = array()) |
||
| 1915 | |||
| 1916 | /** |
||
| 1917 | * Generates a control group with a check box for a model attribute. |
||
| 1918 | * @param array $htmlOptions additional HTML attributes. |
||
| 1919 | * @return string the generated control group. |
||
| 1920 | * @see self::activeControlGroup |
||
| 1921 | */ |
||
| 1922 | public static function activeCheckBoxControlGroup($model, $attribute, $htmlOptions = array()) |
||
| 1926 | |||
| 1927 | /** |
||
| 1928 | * Generates a control group with a drop down list for a model attribute. |
||
| 1929 | * @param CModel $model the data model. |
||
| 1930 | * @param string $attribute the attribute. |
||
| 1931 | * @param array $data data for generating the list options (value=>display). |
||
| 1932 | * @param array $htmlOptions additional HTML attributes. |
||
| 1933 | * @return string the generated control group. |
||
| 1934 | * @see self::activeControlGroup |
||
| 1935 | */ |
||
| 1936 | public static function activeDropDownListControlGroup($model, $attribute, $data = array(), $htmlOptions = array()) |
||
| 1940 | |||
| 1941 | /** |
||
| 1942 | * Generates a control group with a list box for a model attribute. |
||
| 1943 | * @param array $data data for generating the list options (value=>display). |
||
| 1944 | * @param array $htmlOptions additional HTML attributes. |
||
| 1945 | * @return string the generated control group. |
||
| 1946 | * @see self::activeControlGroup |
||
| 1947 | */ |
||
| 1948 | public static function activeListBoxControlGroup($model, $attribute, $data = array(), $htmlOptions = array()) |
||
| 1952 | |||
| 1953 | /** |
||
| 1954 | * Generates a control group with a radio button list for a model attribute. |
||
| 1955 | * @param CModel $model the data model. |
||
| 1956 | * @param string $attribute the attribute. |
||
| 1957 | * @param array $data data for generating the list options (value=>display). |
||
| 1958 | * @param array $htmlOptions additional HTML attributes. |
||
| 1959 | * @return string the generated control group. |
||
| 1960 | * @see self::activeControlGroup |
||
| 1961 | */ |
||
| 1962 | public static function activeRadioButtonListControlGroup( |
||
| 1970 | |||
| 1971 | /** |
||
| 1972 | * Generates a control group with an inline radio button list for a model attribute. |
||
| 1973 | * @param array $data data for generating the list options (value=>display). |
||
| 1974 | * @param array $htmlOptions additional HTML attributes. |
||
| 1975 | * @return string the generated control group. |
||
| 1976 | * @see self::activeControlGroup |
||
| 1977 | */ |
||
| 1978 | public static function activeInlineRadioButtonListControlGroup( |
||
| 1992 | |||
| 1993 | /** |
||
| 1994 | * Generates a control group with a check box list for a model attribute. |
||
| 1995 | * @param CModel $model the data model. |
||
| 1996 | * @param string $attribute the attribute. |
||
| 1997 | * @param array $data data for generating the list options (value=>display). |
||
| 1998 | * @param array $htmlOptions additional HTML attributes. |
||
| 1999 | * @return string the generated control group. |
||
| 2000 | * @see self::activeControlGroup |
||
| 2001 | */ |
||
| 2002 | public static function activeCheckBoxListControlGroup($model, $attribute, $data = array(), $htmlOptions = array()) |
||
| 2006 | |||
| 2007 | /** |
||
| 2008 | * Generates a control group with an inline check box list for a model attribute. |
||
| 2009 | * @param CModel $model the data model. |
||
| 2010 | * @param string $attribute the attribute. |
||
| 2011 | * @param array $data data for generating the list options (value=>display). |
||
| 2012 | * @param array $htmlOptions additional HTML attributes. |
||
| 2013 | * @return string the generated control group. |
||
| 2014 | * @see self::activeControlGroup |
||
| 2015 | */ |
||
| 2016 | public static function activeInlineCheckBoxListControlGroup( |
||
| 2024 | |||
| 2025 | /** |
||
| 2026 | * Generates a control group with a uneditable field for a model attribute. |
||
| 2027 | * @param CModel $model the data model. |
||
| 2028 | * @param string $attribute the attribute. |
||
| 2029 | * @param array $htmlOptions additional HTML attributes. |
||
| 2030 | * @return string the generated control group. |
||
| 2031 | * @see self::activeControlGroup |
||
| 2032 | */ |
||
| 2033 | public static function activeUneditableFieldControlGroup($model, $attribute, $htmlOptions = array()) |
||
| 2037 | |||
| 2038 | /** |
||
| 2039 | * Generates a control group with a search field for a model attribute. |
||
| 2040 | * @param CModel $model the data model. |
||
| 2041 | * @param string $attribute the attribute. |
||
| 2042 | * @param array $htmlOptions additional HTML attributes. |
||
| 2043 | * @return string the generated control group. |
||
| 2044 | * @see self::activeControlGroup |
||
| 2045 | */ |
||
| 2046 | public static function activeSearchQueryControlGroup($model, $attribute, $htmlOptions = array()) |
||
| 2050 | |||
| 2051 | /** |
||
| 2052 | * Generates an active form row. |
||
| 2053 | * @param string $type the input type. |
||
| 2054 | * @param CModel $model the data model. |
||
| 2055 | * @param string $attribute the attribute. |
||
| 2056 | * @param array $htmlOptions additional HTML attributes. |
||
| 2057 | * @param array $data data for multiple select inputs. |
||
| 2058 | * @return string the generated control group. |
||
| 2059 | */ |
||
| 2060 | public static function activeControlGroup($type, $model, $attribute, $htmlOptions = array(), $data = array()) |
||
| 2101 | |||
| 2102 | /** |
||
| 2103 | * Generates a custom (pre-rendered) active form control group. |
||
| 2104 | * @param string $input the rendered input. |
||
| 2105 | * @param CModel $model the data model. |
||
| 2106 | * @param string $attribute the attribute. |
||
| 2107 | * @param array $htmlOptions additional HTML attributes. |
||
| 2108 | * @return string the generated control group. |
||
| 2109 | */ |
||
| 2110 | public static function customActiveControlGroup($input, $model, $attribute, $htmlOptions = array()) |
||
| 2115 | |||
| 2116 | /** |
||
| 2117 | * Creates an active form input of the given type. |
||
| 2118 | * @param string $type the input type. |
||
| 2119 | * @param CModel $model the model instance. |
||
| 2120 | * @param string $attribute the attribute name. |
||
| 2121 | * @param array $htmlOptions additional HTML attributes. |
||
| 2122 | * @param array $data data for multiple select inputs. |
||
| 2123 | * @return string the input. |
||
| 2124 | * @throws CException if the input type is invalid. |
||
| 2125 | */ |
||
| 2126 | public static function createActiveInput($type, $model, $attribute, $htmlOptions = array(), $data = array()) |
||
| 2171 | |||
| 2172 | /** |
||
| 2173 | * Displays a summary of validation errors for one or several models. |
||
| 2174 | * @param mixed $model the models whose input errors are to be displayed. |
||
| 2175 | * @param string $header a piece of HTML code that appears in front of the errors. |
||
| 2176 | * @param string $footer a piece of HTML code that appears at the end of the errors. |
||
| 2177 | * @param array $htmlOptions additional HTML attributes to be rendered in the container div tag. |
||
| 2178 | * @return string the error summary. Empty if no errors are found. |
||
| 2179 | */ |
||
| 2180 | public static function errorSummary($model, $header = null, $footer = null, $htmlOptions = array()) |
||
| 2186 | |||
| 2187 | /** |
||
| 2188 | * Displays the first validation error for a model attribute. |
||
| 2189 | * @param CModel $model the data model. |
||
| 2190 | * @param string $attribute the attribute name. |
||
| 2191 | * @param array $htmlOptions additional HTML attributes. |
||
| 2192 | * @return string the rendered error. Empty if no errors are found. |
||
| 2193 | */ |
||
| 2194 | public static function error($model, $attribute, $htmlOptions = array()) |
||
| 2200 | |||
| 2201 | /** |
||
| 2202 | * Generates an input HTML tag for a model attribute. |
||
| 2203 | * This method generates an input HTML tag based on the given input name and value. |
||
| 2204 | * @param string $type the input type. |
||
| 2205 | * @param CModel $model the data model. |
||
| 2206 | * @param string $attribute the attribute. |
||
| 2207 | * @param array $htmlOptions additional HTML attributes. |
||
| 2208 | * @return string the generated input tag. |
||
| 2209 | */ |
||
| 2210 | protected static function activeTextInputField($type, $model, $attribute, $htmlOptions) |
||
| 2243 | |||
| 2244 | /** |
||
| 2245 | * Returns the add-on classes based on the given options. |
||
| 2246 | * @param array $htmlOptions the options. |
||
| 2247 | * @return string the classes. |
||
| 2248 | */ |
||
| 2249 | protected static function getAddOnClasses($htmlOptions) |
||
| 2260 | |||
| 2261 | /** |
||
| 2262 | * Generates an add-on for an input field. |
||
| 2263 | * @param string $addOn the add-on. |
||
| 2264 | * @param array $htmlOptions additional HTML attributes. |
||
| 2265 | * @return string the generated add-on. |
||
| 2266 | */ |
||
| 2267 | protected static function inputAddOn($addOn, $htmlOptions) |
||
| 2275 | |||
| 2276 | /** |
||
| 2277 | * Generates a help text for an input field. |
||
| 2278 | * @param string $help the help text. |
||
| 2279 | * @param array $htmlOptions additional HTML attributes. |
||
| 2280 | * @return string the generated help text. |
||
| 2281 | */ |
||
| 2282 | protected static function inputHelp($help, $htmlOptions) |
||
| 2289 | |||
| 2290 | /** |
||
| 2291 | * Normalizes input options. |
||
| 2292 | * @param array $options the options. |
||
| 2293 | * @return array the normalized options. |
||
| 2294 | */ |
||
| 2295 | protected static function normalizeInputOptions($options) |
||
| 2309 | |||
| 2310 | /** |
||
| 2311 | * Generates form controls. |
||
| 2312 | * @param mixed $controls the controls. |
||
| 2313 | * @param array $htmlOptions additional HTML attributes. |
||
| 2314 | * @return string the generated controls. |
||
| 2315 | */ |
||
| 2316 | public static function controls($controls, $htmlOptions = array()) |
||
| 2330 | |||
| 2331 | /** |
||
| 2332 | * Generates form controls row. |
||
| 2333 | * @param mixed $controls the controls. |
||
| 2334 | * @param array $htmlOptions additional HTML attributes. |
||
| 2335 | * @return string the generated controls. |
||
| 2336 | */ |
||
| 2337 | public static function controlsRow($controls, $htmlOptions = array()) |
||
| 2342 | |||
| 2343 | /** |
||
| 2344 | * Generates form actions. |
||
| 2345 | * @param mixed $actions the actions. |
||
| 2346 | * @param array $htmlOptions additional HTML attributes. |
||
| 2347 | * @return string the generated actions. |
||
| 2348 | */ |
||
| 2349 | public static function formActions($actions, $htmlOptions = array()) |
||
| 2357 | |||
| 2358 | /** |
||
| 2359 | * Generates a search form. |
||
| 2360 | * @param mixed $action the form action URL. |
||
| 2361 | * @param string $method form method (e.g. post, get). |
||
| 2362 | * @param array $htmlOptions additional HTML options. |
||
| 2363 | * @return string the generated form. |
||
| 2364 | */ |
||
| 2365 | public static function searchForm($action, $method = 'post', $htmlOptions = array()) |
||
| 2377 | |||
| 2378 | // Buttons |
||
| 2379 | // http://twitter.github.io/bootstrap/2.3.2/base-css.html#buttons |
||
| 2380 | // -------------------------------------------------- |
||
| 2381 | |||
| 2382 | /** |
||
| 2383 | * Generates a hyperlink tag. |
||
| 2384 | * @param string $text link body. It will NOT be HTML-encoded. |
||
| 2385 | * @param mixed $url a URL or an action route that can be used to create a URL. |
||
| 2386 | * @param array $htmlOptions additional HTML attributes. |
||
| 2387 | * @return string the generated hyperlink |
||
| 2388 | */ |
||
| 2389 | public static function link($text, $url = '#', $htmlOptions = array()) |
||
| 2395 | |||
| 2396 | /** |
||
| 2397 | * Generates an button. |
||
| 2398 | * @param string $label the button label text. |
||
| 2399 | * @param array $htmlOptions additional HTML attributes. |
||
| 2400 | * @return string the generated button. |
||
| 2401 | */ |
||
| 2402 | public static function button($label = 'Button', $htmlOptions = array()) |
||
| 2406 | |||
| 2407 | /** |
||
| 2408 | * Generates an image submit button. |
||
| 2409 | * @param array $htmlOptions additional HTML attributes. |
||
| 2410 | * @return string the generated button. |
||
| 2411 | */ |
||
| 2412 | public static function htmlButton($label = 'Button', $htmlOptions = array()) |
||
| 2416 | |||
| 2417 | /** |
||
| 2418 | * Generates a submit button. |
||
| 2419 | * @param string $label the button label |
||
| 2420 | * @param array $htmlOptions additional HTML attributes. |
||
| 2421 | * @return string the generated button. |
||
| 2422 | */ |
||
| 2423 | public static function submitButton($label = 'Submit', $htmlOptions = array()) |
||
| 2427 | |||
| 2428 | /** |
||
| 2429 | * Generates a reset button. |
||
| 2430 | * @param string $label the button label |
||
| 2431 | * @param array $htmlOptions additional HTML attributes. |
||
| 2432 | * @return string the generated button. |
||
| 2433 | */ |
||
| 2434 | public static function resetButton($label = 'Reset', $htmlOptions = array()) |
||
| 2438 | |||
| 2439 | /** |
||
| 2440 | * Generates an image submit button. |
||
| 2441 | * @param string $src the image URL |
||
| 2442 | * @param array $htmlOptions additional HTML attributes. |
||
| 2443 | * @return string the generated button. |
||
| 2444 | */ |
||
| 2445 | public static function imageButton($src, $htmlOptions = array()) |
||
| 2449 | |||
| 2450 | /** |
||
| 2451 | * Generates a link submit button. |
||
| 2452 | * @param string $label the button label. |
||
| 2453 | * @param array $htmlOptions additional HTML attributes. |
||
| 2454 | * @return string the generated button tag. |
||
| 2455 | */ |
||
| 2456 | public static function linkButton($label = 'Submit', $htmlOptions = array()) |
||
| 2460 | |||
| 2461 | /** |
||
| 2462 | * Generates a link that can initiate AJAX requests. |
||
| 2463 | * @param string $text the link body (it will NOT be HTML-encoded.) |
||
| 2464 | * @param mixed $url the URL for the AJAX request. |
||
| 2465 | * @param array $ajaxOptions AJAX options. |
||
| 2466 | * @param array $htmlOptions additional HTML attributes. |
||
| 2467 | * @return string the generated link. |
||
| 2468 | */ |
||
| 2469 | public static function ajaxLink($text, $url, $ajaxOptions = array(), $htmlOptions = array()) |
||
| 2479 | |||
| 2480 | /** |
||
| 2481 | * Generates a push button that can initiate AJAX requests. |
||
| 2482 | * @param string $label the button label. |
||
| 2483 | * @param mixed $url the URL for the AJAX request. |
||
| 2484 | * @param array $ajaxOptions AJAX options. |
||
| 2485 | * @param array $htmlOptions additional HTML attributes. |
||
| 2486 | * @return string the generated button. |
||
| 2487 | */ |
||
| 2488 | public static function ajaxButton($label, $url, $ajaxOptions = array(), $htmlOptions = array()) |
||
| 2494 | |||
| 2495 | /** |
||
| 2496 | * Generates a push button that can submit the current form in POST method. |
||
| 2497 | * @param string $label the button label |
||
| 2498 | * @param mixed $url the URL for the AJAX request. |
||
| 2499 | * @param array $ajaxOptions AJAX options. |
||
| 2500 | * @param array $htmlOptions additional HTML attributes. |
||
| 2501 | * @return string the generated button. |
||
| 2502 | */ |
||
| 2503 | public static function ajaxSubmitButton($label, $url, $ajaxOptions = array(), $htmlOptions = array()) |
||
| 2509 | |||
| 2510 | // todo: add methods for input button and input submit. |
||
| 2511 | |||
| 2512 | /** |
||
| 2513 | * Generates a button. |
||
| 2514 | * @param string $type the button type. |
||
| 2515 | * @param string $label the button label text. |
||
| 2516 | * @param array $htmlOptions additional HTML attributes. |
||
| 2517 | * @return string the generated button. |
||
| 2518 | */ |
||
| 2519 | public static function btn($type, $label, $htmlOptions = array()) |
||
| 2560 | |||
| 2561 | /** |
||
| 2562 | * Generates a button dropdown. |
||
| 2563 | * @param string $type the button type. |
||
| 2564 | * @param string $label the button label text. |
||
| 2565 | * @param array $items the menu items. |
||
| 2566 | * @param array $htmlOptions additional HTML attributes. |
||
| 2567 | * @return string the generated button. |
||
| 2568 | */ |
||
| 2569 | protected static function btnDropdown($type, $label, $items, $htmlOptions) |
||
| 2588 | |||
| 2589 | /** |
||
| 2590 | * Creates a button the of given type. |
||
| 2591 | * @param string $type the button type. |
||
| 2592 | * @param string $label the button label. |
||
| 2593 | * @param array $htmlOptions additional HTML attributes. |
||
| 2594 | * @return string the button. |
||
| 2595 | * @throws CException if the button type is valid. |
||
| 2596 | */ |
||
| 2597 | protected static function createButton($type, $label, $htmlOptions) |
||
| 2640 | |||
| 2641 | // Images |
||
| 2642 | // http://twitter.github.io/bootstrap/2.3.2/base-css.html#images |
||
| 2643 | // -------------------------------------------------- |
||
| 2644 | |||
| 2645 | /** |
||
| 2646 | * Generates an image tag with rounded corners. |
||
| 2647 | * @param string $src the image URL. |
||
| 2648 | * @param string $alt the alternative text display. |
||
| 2649 | * @param array $htmlOptions additional HTML attributes. |
||
| 2650 | * @return string the generated image tag. |
||
| 2651 | */ |
||
| 2652 | public static function imageRounded($src, $alt = '', $htmlOptions = array()) |
||
| 2657 | |||
| 2658 | /** |
||
| 2659 | * Generates an image tag with circle. |
||
| 2660 | * @param string $src the image URL. |
||
| 2661 | * @param string $alt the alternative text display. |
||
| 2662 | * @param array $htmlOptions additional HTML attributes. |
||
| 2663 | * @return string the generated image tag. |
||
| 2664 | */ |
||
| 2665 | public static function imageCircle($src, $alt = '', $htmlOptions = array()) |
||
| 2670 | |||
| 2671 | /** |
||
| 2672 | * Generates an image tag within polaroid frame. |
||
| 2673 | * @param string $src the image URL. |
||
| 2674 | * @param string $alt the alternative text display. |
||
| 2675 | * @param array $htmlOptions additional HTML attributes. |
||
| 2676 | * @return string the generated image tag. |
||
| 2677 | */ |
||
| 2678 | public static function imagePolaroid($src, $alt = '', $htmlOptions = array()) |
||
| 2683 | |||
| 2684 | /** |
||
| 2685 | * Generates an image tag. |
||
| 2686 | * @param string $src the image URL. |
||
| 2687 | * @param string $alt the alternative text display. |
||
| 2688 | * @param array $htmlOptions additional HTML attributes. |
||
| 2689 | * @return string the generated image tag. |
||
| 2690 | */ |
||
| 2691 | public static function image($src, $alt = '', $htmlOptions = array()) |
||
| 2699 | |||
| 2700 | // Icons by Glyphicons |
||
| 2701 | // http://twitter.github.io/bootstrap/2.3.2/base-css.html#icons |
||
| 2702 | // -------------------------------------------------- |
||
| 2703 | |||
| 2704 | /** |
||
| 2705 | * Generates an icon. |
||
| 2706 | * @param string $icon the icon type. |
||
| 2707 | * @param array $htmlOptions additional HTML attributes. |
||
| 2708 | * @param string $tagName the icon HTML tag. |
||
| 2709 | * @return string the generated icon. |
||
| 2710 | */ |
||
| 2711 | public static function icon($icon, $htmlOptions = array(), $tagName = 'i') |
||
| 2726 | |||
| 2727 | // |
||
| 2728 | // COMPONENTS |
||
| 2729 | // -------------------------------------------------- |
||
| 2730 | |||
| 2731 | // Dropdowns |
||
| 2732 | // http://twitter.github.io/bootstrap/2.3.2/components.html#dropdowns |
||
| 2733 | // -------------------------------------------------- |
||
| 2734 | |||
| 2735 | /** |
||
| 2736 | * Generates a dropdown menu. |
||
| 2737 | * @param array $items the menu items. |
||
| 2738 | * @param array $htmlOptions additional HTML attributes. |
||
| 2739 | * @return string the generated menu. |
||
| 2740 | */ |
||
| 2741 | protected static function dropdown($items, $htmlOptions = array()) |
||
| 2747 | |||
| 2748 | /** |
||
| 2749 | * Generates a dropdown toggle link. |
||
| 2750 | * @param string $label the link label text. |
||
| 2751 | * @param array $htmlOptions additional HTML attributes. |
||
| 2752 | * @return string the generated link. |
||
| 2753 | */ |
||
| 2754 | public static function dropdownToggleLink($label, $htmlOptions = array()) |
||
| 2758 | |||
| 2759 | /** |
||
| 2760 | * Generates a dropdown toggle button. |
||
| 2761 | * @param string $label the button label text. |
||
| 2762 | * @param array $htmlOptions additional HTML attributes. |
||
| 2763 | * @return string the generated button. |
||
| 2764 | */ |
||
| 2765 | public static function dropdownToggleButton($label = '', $htmlOptions = array()) |
||
| 2769 | |||
| 2770 | /** |
||
| 2771 | * Generates a dropdown toggle element. |
||
| 2772 | * @param string $label the element text. |
||
| 2773 | * @param array $htmlOptions additional HTML attributes. |
||
| 2774 | * @param string $type |
||
| 2775 | * @return string the generated element. |
||
| 2776 | */ |
||
| 2777 | protected static function dropdownToggle($type, $label, $htmlOptions) |
||
| 2784 | |||
| 2785 | /** |
||
| 2786 | * Generates a dropdown toggle menu item. |
||
| 2787 | * @param string $label the menu item text. |
||
| 2788 | * @param string $url the menu item URL. |
||
| 2789 | * @param array $htmlOptions additional HTML attributes. |
||
| 2790 | * @param int $depth the menu depth at which this link is located |
||
| 2791 | * @return string the generated menu item. |
||
| 2792 | */ |
||
| 2793 | public static function dropdownToggleMenuLink($label, $url = '#', $htmlOptions = array(), $depth = 0) |
||
| 2802 | |||
| 2803 | // Button groups |
||
| 2804 | // http://twitter.github.io/bootstrap/2.3.2/components.html#buttonGroups |
||
| 2805 | // -------------------------------------------------- |
||
| 2806 | |||
| 2807 | /** |
||
| 2808 | * Generates a button group. |
||
| 2809 | * @param array $buttons the button configurations. |
||
| 2810 | * @param array $htmlOptions additional HTML options. |
||
| 2811 | * @return string the generated button group. |
||
| 2812 | */ |
||
| 2813 | public static function buttonGroup(array $buttons, $htmlOptions = array()) |
||
| 2854 | |||
| 2855 | /** |
||
| 2856 | * Generates a vertical button group. |
||
| 2857 | * @param array $buttons the button configurations. |
||
| 2858 | * @param array $htmlOptions additional HTML options. |
||
| 2859 | * @return string the generated button group. |
||
| 2860 | */ |
||
| 2861 | public static function verticalButtonGroup(array $buttons, $htmlOptions = array()) |
||
| 2866 | |||
| 2867 | /** |
||
| 2868 | * Generates a button toolbar. |
||
| 2869 | * @param array $groups the button group configurations. |
||
| 2870 | * @param array $htmlOptions additional HTML options. |
||
| 2871 | * @return string the generated button toolbar. |
||
| 2872 | */ |
||
| 2873 | public static function buttonToolbar(array $groups, $htmlOptions = array()) |
||
| 2904 | |||
| 2905 | // Button dropdowns |
||
| 2906 | // http://twitter.github.io/bootstrap/2.3.2/components.html#buttonDropdowns |
||
| 2907 | // -------------------------------------------------- |
||
| 2908 | |||
| 2909 | /** |
||
| 2910 | * Generates a button with a dropdown menu. |
||
| 2911 | * @param string $label the button label text. |
||
| 2912 | * @param array $items the menu items. |
||
| 2913 | * @param array $htmlOptions additional HTML attributes. |
||
| 2914 | * @return string the generated button. |
||
| 2915 | */ |
||
| 2916 | public static function buttonDropdown($label, $items, $htmlOptions = array()) |
||
| 2922 | |||
| 2923 | /** |
||
| 2924 | * Generates a button with a split dropdown menu. |
||
| 2925 | * @param string $label the button label text. |
||
| 2926 | * @param array $items the menu items. |
||
| 2927 | * @param array $htmlOptions additional HTML attributes. |
||
| 2928 | * @return string the generated button. |
||
| 2929 | */ |
||
| 2930 | public static function splitButtonDropdown($label, $items, $htmlOptions = array()) |
||
| 2935 | |||
| 2936 | // Navs |
||
| 2937 | // http://twitter.github.io/bootstrap/2.3.2/components.html#navs |
||
| 2938 | // -------------------------------------------------- |
||
| 2939 | |||
| 2940 | /** |
||
| 2941 | * Generates a tab navigation. |
||
| 2942 | * @param array $items the menu items. |
||
| 2943 | * @param array $htmlOptions additional HTML attributes. |
||
| 2944 | * @return string the generated menu. |
||
| 2945 | */ |
||
| 2946 | public static function tabs($items, $htmlOptions = array()) |
||
| 2950 | |||
| 2951 | /** |
||
| 2952 | * Generates a stacked tab navigation. |
||
| 2953 | * @param array $items the menu items. |
||
| 2954 | * @param array $htmlOptions additional HTML attributes. |
||
| 2955 | * @return string the generated menu. |
||
| 2956 | */ |
||
| 2957 | public static function stackedTabs($items, $htmlOptions = array()) |
||
| 2962 | |||
| 2963 | /** |
||
| 2964 | * Generates a pills navigation. |
||
| 2965 | * @param array $items the menu items. |
||
| 2966 | * @param array $htmlOptions additional HTML attributes. |
||
| 2967 | * @return string the generated menu. |
||
| 2968 | */ |
||
| 2969 | public static function pills($items, $htmlOptions = array()) |
||
| 2973 | |||
| 2974 | /** |
||
| 2975 | * Generates a stacked pills navigation. |
||
| 2976 | * @param array $items the menu items. |
||
| 2977 | * @param array $htmlOptions additional HTML attributes. |
||
| 2978 | * @return string the generated menu. |
||
| 2979 | */ |
||
| 2980 | public static function stackedPills($items, $htmlOptions = array()) |
||
| 2985 | |||
| 2986 | /** |
||
| 2987 | * Generates a list navigation. |
||
| 2988 | * @param array $items the menu items. |
||
| 2989 | * @param array $htmlOptions additional HTML attributes. |
||
| 2990 | * @return string the generated menu. |
||
| 2991 | */ |
||
| 2992 | public static function navList($items, $htmlOptions = array()) |
||
| 3005 | |||
| 3006 | /** |
||
| 3007 | * Generates a navigation menu. |
||
| 3008 | * @param string $type the menu type. |
||
| 3009 | * @param array $items the menu items. |
||
| 3010 | * @param array $htmlOptions additional HTML attributes. |
||
| 3011 | * @return string the generated menu. |
||
| 3012 | */ |
||
| 3013 | public static function nav($type, $items, $htmlOptions = array()) |
||
| 3025 | |||
| 3026 | /** |
||
| 3027 | * Generates a menu. |
||
| 3028 | * @param array $items the menu items. |
||
| 3029 | * @param array $htmlOptions additional HTML attributes. |
||
| 3030 | * @param integer $depth the current depth. |
||
| 3031 | * @return string the generated menu. |
||
| 3032 | */ |
||
| 3033 | public static function menu(array $items, $htmlOptions = array(), $depth = 0) |
||
| 3085 | |||
| 3086 | /** |
||
| 3087 | * Generates a menu link. |
||
| 3088 | * @param string $label the link label. |
||
| 3089 | * @param array $url the link url. |
||
| 3090 | * @param array $htmlOptions additional HTML attributes. |
||
| 3091 | * @return string the generated menu item. |
||
| 3092 | */ |
||
| 3093 | public static function menuLink($label, $url, $htmlOptions = array()) |
||
| 3100 | |||
| 3101 | /** |
||
| 3102 | * Generates a menu dropdown. |
||
| 3103 | * @param string $label the link label. |
||
| 3104 | * @param string $url the link URL. |
||
| 3105 | * @param array $items the menu configuration. |
||
| 3106 | * @param array $htmlOptions additional HTML attributes. |
||
| 3107 | * @param integer $depth the current depth. |
||
| 3108 | * @return string the generated dropdown. |
||
| 3109 | */ |
||
| 3110 | protected static function menuDropdown($label, $url, $items, $htmlOptions, $depth = 0) |
||
| 3129 | |||
| 3130 | /** |
||
| 3131 | * Generates a menu header. |
||
| 3132 | * @param string $label the header text. |
||
| 3133 | * @param array $htmlOptions additional HTML options. |
||
| 3134 | * @return string the generated header. |
||
| 3135 | */ |
||
| 3136 | public static function menuHeader($label, $htmlOptions = array()) |
||
| 3141 | |||
| 3142 | /** |
||
| 3143 | * Generates a menu divider. |
||
| 3144 | * @param array $htmlOptions additional HTML attributes. |
||
| 3145 | * @return string the generated menu item. |
||
| 3146 | */ |
||
| 3147 | public static function menuDivider($htmlOptions = array()) |
||
| 3152 | |||
| 3153 | /** |
||
| 3154 | * Generates a tabbable tabs menu. |
||
| 3155 | * @param array $tabs the tab configurations. |
||
| 3156 | * @param array $htmlOptions additional HTML attributes. |
||
| 3157 | * @return string the generated menu. |
||
| 3158 | */ |
||
| 3159 | public static function tabbableTabs($tabs, $htmlOptions = array()) |
||
| 3163 | |||
| 3164 | /** |
||
| 3165 | * Generates a tabbable pills menu. |
||
| 3166 | * @param array $htmlOptions additional HTML attributes. |
||
| 3167 | * @return string the generated menu. |
||
| 3168 | */ |
||
| 3169 | public static function tabbablePills($pills, $htmlOptions = array()) |
||
| 3173 | |||
| 3174 | /** |
||
| 3175 | * Generates a tabbable menu. |
||
| 3176 | * @param string $type the menu type. |
||
| 3177 | * @param array $tabs the tab configurations. |
||
| 3178 | * @param array $htmlOptions additional HTML attributes. |
||
| 3179 | * @return string the generated menu. |
||
| 3180 | */ |
||
| 3181 | public static function tabbable($type, $tabs, $htmlOptions = array()) |
||
| 3200 | |||
| 3201 | /** |
||
| 3202 | * Normalizes the tab configuration. |
||
| 3203 | * @param array $tabs the tab configuration. |
||
| 3204 | * @param array $panes a reference to the panes array. |
||
| 3205 | * @param integer $i the running index. |
||
| 3206 | * @return array the items. |
||
| 3207 | */ |
||
| 3208 | protected static function normalizeTabs($tabs, &$panes, $i = 0) |
||
| 3245 | |||
| 3246 | // Navbar |
||
| 3247 | // http://twitter.github.io/bootstrap/2.3.2/components.html#navbar |
||
| 3248 | // -------------------------------------------------- |
||
| 3249 | |||
| 3250 | /** |
||
| 3251 | * Generates a navbar. |
||
| 3252 | * @param string $content the navbar content. |
||
| 3253 | * @param array $htmlOptions additional HTML attributes. |
||
| 3254 | * @return string the generated navbar. |
||
| 3255 | */ |
||
| 3256 | public static function navbar($content, $htmlOptions = array()) |
||
| 3274 | |||
| 3275 | /** |
||
| 3276 | * Generates a brand link for the navbar. |
||
| 3277 | * @param string $label the link label text. |
||
| 3278 | * @param string $url the link url. |
||
| 3279 | * @param array $htmlOptions additional HTML attributes. |
||
| 3280 | * @return string the generated link. |
||
| 3281 | */ |
||
| 3282 | public static function navbarBrandLink($label, $url, $htmlOptions = array()) |
||
| 3287 | |||
| 3288 | /** |
||
| 3289 | * Generates a text for the navbar. |
||
| 3290 | * @param string $text the text. |
||
| 3291 | * @param array $htmlOptions additional HTML attributes. |
||
| 3292 | * @param string $tag the HTML tag. |
||
| 3293 | * @return string the generated text block. |
||
| 3294 | */ |
||
| 3295 | public static function navbarText($text, $htmlOptions = array(), $tag = 'p') |
||
| 3300 | |||
| 3301 | /** |
||
| 3302 | * Generates a menu divider for the navbar. |
||
| 3303 | * @param array $htmlOptions additional HTML attributes. |
||
| 3304 | * @return string the generated divider. |
||
| 3305 | */ |
||
| 3306 | public static function navbarMenuDivider($htmlOptions = array()) |
||
| 3311 | |||
| 3312 | /** |
||
| 3313 | * Generates a navbar form. |
||
| 3314 | * @param mixed $action the form action URL. |
||
| 3315 | * @param string $method form method (e.g. post, get). |
||
| 3316 | * @param array $htmlOptions additional HTML attributes |
||
| 3317 | * @return string the generated form. |
||
| 3318 | */ |
||
| 3319 | public static function navbarForm($action, $method = 'post', $htmlOptions = array()) |
||
| 3324 | |||
| 3325 | /** |
||
| 3326 | * Generates a navbar search form. |
||
| 3327 | * @param mixed $action the form action URL. |
||
| 3328 | * @param string $method form method (e.g. post, get). |
||
| 3329 | * @param array $htmlOptions additional HTML attributes |
||
| 3330 | * @return string the generated form. |
||
| 3331 | */ |
||
| 3332 | public static function navbarSearchForm($action, $method = 'post', $htmlOptions = array()) |
||
| 3337 | |||
| 3338 | /** |
||
| 3339 | * Generates a collapse element. |
||
| 3340 | * @param string $target the CSS selector for the target element. |
||
| 3341 | * @param array $htmlOptions additional HTML attributes. |
||
| 3342 | * @return string the generated icon. |
||
| 3343 | */ |
||
| 3344 | public static function navbarCollapseLink($target, $htmlOptions = array()) |
||
| 3352 | |||
| 3353 | // Breadcrumbs |
||
| 3354 | // http://twitter.github.io/bootstrap/2.3.2/components.html#breadcrumbs |
||
| 3355 | // -------------------------------------------------- |
||
| 3356 | |||
| 3357 | /** |
||
| 3358 | * Generates a breadcrumb menu. |
||
| 3359 | * @param array $links the breadcrumb links. |
||
| 3360 | * @param array $htmlOptions additional HTML attributes. |
||
| 3361 | * @return string the generated breadcrumb. |
||
| 3362 | */ |
||
| 3363 | public static function breadcrumbs($links, $htmlOptions = array()) |
||
| 3381 | |||
| 3382 | // Pagination |
||
| 3383 | // http://twitter.github.io/bootstrap/2.3.2/components.html#pagination |
||
| 3384 | // -------------------------------------------------- |
||
| 3385 | |||
| 3386 | /** |
||
| 3387 | * Generates a pagination. |
||
| 3388 | * @param array $items the pagination buttons. |
||
| 3389 | * @param array $htmlOptions additional HTML attributes. |
||
| 3390 | * @return string the generated pagination. |
||
| 3391 | */ |
||
| 3392 | public static function pagination(array $items, $htmlOptions = array()) |
||
| 3422 | |||
| 3423 | /** |
||
| 3424 | * Generates a pagination link. |
||
| 3425 | * @param string $label the link label text. |
||
| 3426 | * @param mixed $url the link url. |
||
| 3427 | * @param array $htmlOptions additional HTML attributes. |
||
| 3428 | * @return string the generated link. |
||
| 3429 | */ |
||
| 3430 | public static function paginationLink($label, $url, $htmlOptions = array()) |
||
| 3442 | |||
| 3443 | /** |
||
| 3444 | * Generates a pager. |
||
| 3445 | * @param array $links the pager buttons. |
||
| 3446 | * @param array $htmlOptions additional HTML attributes. |
||
| 3447 | * @return string the generated pager. |
||
| 3448 | */ |
||
| 3449 | public static function pager(array $links, $htmlOptions = array()) |
||
| 3469 | |||
| 3470 | /** |
||
| 3471 | * Generates a pager link. |
||
| 3472 | * @param string $label the link label text. |
||
| 3473 | * @param mixed $url the link url. |
||
| 3474 | * @param array $htmlOptions additional HTML attributes. |
||
| 3475 | * @return string the generated link. |
||
| 3476 | */ |
||
| 3477 | public static function pagerLink($label, $url, $htmlOptions = array()) |
||
| 3492 | |||
| 3493 | // Labels and badges |
||
| 3494 | // http://twitter.github.io/bootstrap/2.3.2/components.html#labels-badges |
||
| 3495 | // -------------------------------------------------- |
||
| 3496 | |||
| 3497 | /** |
||
| 3498 | * Generates a label span. |
||
| 3499 | * @param string $label the label text. |
||
| 3500 | * @param array $htmlOptions additional HTML attributes. |
||
| 3501 | * @return string the generated span. |
||
| 3502 | */ |
||
| 3503 | public static function labelTb($label, $htmlOptions = array()) |
||
| 3512 | |||
| 3513 | /** |
||
| 3514 | * Generates a badge span. |
||
| 3515 | * @param string $label the badge text. |
||
| 3516 | * @param array $htmlOptions additional HTML attributes. |
||
| 3517 | * @return string the generated span. |
||
| 3518 | */ |
||
| 3519 | public static function badge($label, $htmlOptions = array()) |
||
| 3528 | |||
| 3529 | // Typography |
||
| 3530 | // http://twitter.github.io/bootstrap/2.3.2/components.html#typography |
||
| 3531 | // -------------------------------------------------- |
||
| 3532 | |||
| 3533 | /** |
||
| 3534 | * Generates a hero unit. |
||
| 3535 | * @param string $heading the heading text. |
||
| 3536 | * @param string $content the content text. |
||
| 3537 | * @param array $htmlOptions additional HTML attributes. |
||
| 3538 | * @return string the generated hero unit. |
||
| 3539 | */ |
||
| 3540 | public static function heroUnit($heading, $content, $htmlOptions = array()) |
||
| 3550 | |||
| 3551 | /** |
||
| 3552 | * Generates a pager header. |
||
| 3553 | * @param string $heading the heading text. |
||
| 3554 | * @param string $subtext the subtext. |
||
| 3555 | * @param array $htmlOptions additional HTML attributes. |
||
| 3556 | * @return string the generated pager header. |
||
| 3557 | */ |
||
| 3558 | public static function pageHeader($heading, $subtext, $htmlOptions = array()) |
||
| 3570 | |||
| 3571 | // Thumbnails |
||
| 3572 | // http://twitter.github.io/bootstrap/2.3.2/components.html#thumbnails |
||
| 3573 | // -------------------------------------------------- |
||
| 3574 | |||
| 3575 | /** |
||
| 3576 | * Generates a list of thumbnails. |
||
| 3577 | * @param array $thumbnails the list configuration. |
||
| 3578 | * @param array $htmlOptions additional HTML attributes. |
||
| 3579 | * @return string the generated thumbnails. |
||
| 3580 | */ |
||
| 3581 | public static function thumbnails(array $thumbnails, $htmlOptions = array()) |
||
| 3623 | |||
| 3624 | /** |
||
| 3625 | * Generates a thumbnail. |
||
| 3626 | * @param string $content the thumbnail content. |
||
| 3627 | * @param array $htmlOptions additional HTML attributes. |
||
| 3628 | * @return string the generated thumbnail. |
||
| 3629 | */ |
||
| 3630 | public static function thumbnail($content, $htmlOptions = array()) |
||
| 3639 | |||
| 3640 | /** |
||
| 3641 | * Generates a link thumbnail. |
||
| 3642 | * @param string $content the thumbnail content. |
||
| 3643 | * @param mixed $url the url that the thumbnail links to. |
||
| 3644 | * @param array $htmlOptions additional HTML attributes. |
||
| 3645 | * @return string the generated thumbnail. |
||
| 3646 | */ |
||
| 3647 | public static function thumbnailLink($content, $url = '#', $htmlOptions = array()) |
||
| 3654 | |||
| 3655 | // Alerts |
||
| 3656 | // http://twitter.github.io/bootstrap/2.3.2/components.html#alerts |
||
| 3657 | // -------------------------------------------------- |
||
| 3658 | |||
| 3659 | /** |
||
| 3660 | * Generates an alert. |
||
| 3661 | * @param string $color the color of the alert. |
||
| 3662 | * @param string $message the message to display. |
||
| 3663 | * @param array $htmlOptions additional HTML options. |
||
| 3664 | * @return string the generated alert. |
||
| 3665 | */ |
||
| 3666 | public static function alert($color, $message, $htmlOptions = array()) |
||
| 3690 | |||
| 3691 | /** |
||
| 3692 | * Generates an alert block. |
||
| 3693 | * @param string $color the color of the alert. |
||
| 3694 | * @param string $message the message to display. |
||
| 3695 | * @param array $htmlOptions additional HTML options. |
||
| 3696 | * @return string the generated alert. |
||
| 3697 | */ |
||
| 3698 | public static function blockAlert($color, $message, $htmlOptions = array()) |
||
| 3703 | |||
| 3704 | // Progress bars |
||
| 3705 | // http://twitter.github.io/bootstrap/2.3.2/components.html#progress |
||
| 3706 | // -------------------------------------------------- |
||
| 3707 | |||
| 3708 | /** |
||
| 3709 | * Generates a progress bar. |
||
| 3710 | * @param integer $width the progress in percent. |
||
| 3711 | * @param array $htmlOptions additional HTML attributes. |
||
| 3712 | * @return string the generated progress bar. |
||
| 3713 | */ |
||
| 3714 | public static function progressBar($width = 0, $htmlOptions = array()) |
||
| 3735 | |||
| 3736 | /** |
||
| 3737 | * Generates a striped progress bar. |
||
| 3738 | * @param integer $width the progress in percent. |
||
| 3739 | * @param array $htmlOptions additional HTML attributes. |
||
| 3740 | * @return string the generated progress bar. |
||
| 3741 | */ |
||
| 3742 | public static function stripedProgressBar($width = 0, $htmlOptions = array()) |
||
| 3747 | |||
| 3748 | /** |
||
| 3749 | * Generates an animated progress bar. |
||
| 3750 | * @param integer $width the progress in percent. |
||
| 3751 | * @param array $htmlOptions additional HTML attributes. |
||
| 3752 | * @return string the generated progress bar. |
||
| 3753 | */ |
||
| 3754 | public static function animatedProgressBar($width = 0, $htmlOptions = array()) |
||
| 3759 | |||
| 3760 | /** |
||
| 3761 | * Generates a stacked progress bar. |
||
| 3762 | * @param array $bars the bar configurations. |
||
| 3763 | * @param array $htmlOptions additional HTML attributes. |
||
| 3764 | * @return string the generated progress bar. |
||
| 3765 | */ |
||
| 3766 | public static function stackedProgressBar(array $bars, $htmlOptions = array()) |
||
| 3789 | |||
| 3790 | /** |
||
| 3791 | * Generates a progress bar. |
||
| 3792 | * @param integer $width the progress in percent. |
||
| 3793 | * @param array $htmlOptions additional HTML attributes. |
||
| 3794 | * @return string the generated bar. |
||
| 3795 | */ |
||
| 3796 | protected static function bar($width = 0, $htmlOptions = array()) |
||
| 3816 | |||
| 3817 | // Media objects |
||
| 3818 | // http://twitter.github.io/bootstrap/2.3.2/components.html#media |
||
| 3819 | // -------------------------------------------------- |
||
| 3820 | |||
| 3821 | /** |
||
| 3822 | * Generates a list of media objects. |
||
| 3823 | * @param array $items item configurations. |
||
| 3824 | * @param array $htmlOptions additional HTML attributes. |
||
| 3825 | * @return string generated list. |
||
| 3826 | */ |
||
| 3827 | public static function mediaList(array $items, $htmlOptions = array()) |
||
| 3839 | |||
| 3840 | /** |
||
| 3841 | * Generates multiple media objects. |
||
| 3842 | * @param array $items item configurations. |
||
| 3843 | * @param string $tag the item tag name. |
||
| 3844 | * @return string generated objects. |
||
| 3845 | */ |
||
| 3846 | public static function medias(array $items, $tag = 'div') |
||
| 3869 | |||
| 3870 | /** |
||
| 3871 | * Generates a single media object. |
||
| 3872 | * @param string $image the image url. |
||
| 3873 | * @param string $heading the heading text. |
||
| 3874 | * @param string $content the content text. |
||
| 3875 | * @param array $htmlOptions additional HTML attributes. |
||
| 3876 | * @return string the media object. |
||
| 3877 | */ |
||
| 3878 | public static function media($image, $heading, $content, $htmlOptions = array()) |
||
| 3908 | |||
| 3909 | // Misc |
||
| 3910 | // http://twitter.github.io/bootstrap/2.3.2/components.html#misc |
||
| 3911 | // -------------------------------------------------- |
||
| 3912 | |||
| 3913 | /** |
||
| 3914 | * Generates a well element. |
||
| 3915 | * @param string $content the well content. |
||
| 3916 | * @param array $htmlOptions additional HTML attributes. |
||
| 3917 | * @return string the generated well. |
||
| 3918 | */ |
||
| 3919 | public static function well($content, $htmlOptions = array()) |
||
| 3928 | |||
| 3929 | /** |
||
| 3930 | * Generates a close link. |
||
| 3931 | * @param string $label the link label text. |
||
| 3932 | * @param string $url the link url. |
||
| 3933 | * @param array $htmlOptions additional HTML attributes. |
||
| 3934 | * @return string the generated link. |
||
| 3935 | */ |
||
| 3936 | public static function closeLink($label = self::CLOSE_TEXT, $url = '#', $htmlOptions = array()) |
||
| 3941 | |||
| 3942 | /** |
||
| 3943 | * Generates a close button. |
||
| 3944 | * @param string $label the button label text. |
||
| 3945 | * @param array $htmlOptions the HTML options for the button. |
||
| 3946 | * @return string the generated button. |
||
| 3947 | */ |
||
| 3948 | public static function closeButton($label = self::CLOSE_TEXT, $htmlOptions = array()) |
||
| 3952 | |||
| 3953 | /** |
||
| 3954 | * Generates a close element. |
||
| 3955 | * @param string $tag the tag name. |
||
| 3956 | * @param string $label the element label text. |
||
| 3957 | * @param array $htmlOptions additional HTML attributes. |
||
| 3958 | * @return string the generated element. |
||
| 3959 | */ |
||
| 3960 | protected static function close($tag, $label, $htmlOptions = array()) |
||
| 3970 | |||
| 3971 | /** |
||
| 3972 | * Generates a collapse link. |
||
| 3973 | * @param string $label the link label. |
||
| 3974 | * @param string $target the CSS selector. |
||
| 3975 | * @param array $htmlOptions additional HTML attributes. |
||
| 3976 | * @return string the generated link. |
||
| 3977 | */ |
||
| 3978 | public static function collapseLink($label, $target, $htmlOptions = array()) |
||
| 3983 | |||
| 3984 | // |
||
| 3985 | // JAVASCRIPT |
||
| 3986 | // -------------------------------------------------- |
||
| 3987 | |||
| 3988 | // Modals |
||
| 3989 | // http://twitter.github.io/bootstrap/2.3.2/javascript.html#modals |
||
| 3990 | // -------------------------------------------------- |
||
| 3991 | |||
| 3992 | /** |
||
| 3993 | * Generates a modal header. |
||
| 3994 | * @param string $content the header content. |
||
| 3995 | * @param array $htmlOptions additional HTML attributes. |
||
| 3996 | * @return string the generated header. |
||
| 3997 | */ |
||
| 3998 | public static function modalHeader($content, $htmlOptions = array()) |
||
| 4009 | |||
| 4010 | /** |
||
| 4011 | * Generates a modal body. |
||
| 4012 | * @param string $content the body content. |
||
| 4013 | * @param array $htmlOptions additional HTML attributes. |
||
| 4014 | * @return string the generated body. |
||
| 4015 | */ |
||
| 4016 | public static function modalBody($content, $htmlOptions = array()) |
||
| 4021 | |||
| 4022 | /** |
||
| 4023 | * Generates a modal footer. |
||
| 4024 | * @param string $content the footer content. |
||
| 4025 | * @param array $htmlOptions additional HTML attributes. |
||
| 4026 | * @return string the generated footer. |
||
| 4027 | */ |
||
| 4028 | public static function modalFooter($content, $htmlOptions = array()) |
||
| 4033 | |||
| 4034 | // Tooltips and Popovers |
||
| 4035 | // http://twitter.github.io/bootstrap/2.3.2/javascript.html#tooltips |
||
| 4036 | // http://twitter.github.io/bootstrap/2.3.2/javascript.html#popovers |
||
| 4037 | // -------------------------------------------------- |
||
| 4038 | |||
| 4039 | /** |
||
| 4040 | * Generates a tooltip. |
||
| 4041 | * @param string $label the tooltip link label text. |
||
| 4042 | * @param mixed $url the link url. |
||
| 4043 | * @param string $content the tooltip content text. |
||
| 4044 | * @param array $htmlOptions additional HTML attributes. |
||
| 4045 | * @return string the generated tooltip. |
||
| 4046 | */ |
||
| 4047 | public static function tooltip($label, $url, $content, $htmlOptions = array()) |
||
| 4052 | |||
| 4053 | /** |
||
| 4054 | * Generates a popover. |
||
| 4055 | * @param string $label the popover link label text. |
||
| 4056 | * @param string $title the popover title text. |
||
| 4057 | * @param string $content the popover content text. |
||
| 4058 | * @param array $htmlOptions additional HTML attributes. |
||
| 4059 | * @return string the generated popover. |
||
| 4060 | */ |
||
| 4061 | public static function popover($label, $title, $content, $htmlOptions = array()) |
||
| 4068 | |||
| 4069 | /** |
||
| 4070 | * Generates a base tooltip. |
||
| 4071 | * @param string $label the tooltip link label text. |
||
| 4072 | * @param mixed $url the link url. |
||
| 4073 | * @param string $title the tooltip title text. |
||
| 4074 | * @param array $htmlOptions additional HTML attributes. |
||
| 4075 | * @return string the generated tooltip. |
||
| 4076 | */ |
||
| 4077 | protected static function tooltipPopover($label, $url, $title, $htmlOptions) |
||
| 4103 | |||
| 4104 | // Carousel |
||
| 4105 | // http://twitter.github.io/bootstrap/2.3.2/javascript.html#carousel |
||
| 4106 | // -------------------------------------------------- |
||
| 4107 | |||
| 4108 | /** |
||
| 4109 | * Generates an image carousel. |
||
| 4110 | * @param array $items the item configurations. |
||
| 4111 | * @param array $htmlOptions additional HTML attributes. |
||
| 4112 | * @return string the generated carousel. |
||
| 4113 | */ |
||
| 4114 | public static function carousel(array $items, $htmlOptions = array()) |
||
| 4171 | |||
| 4172 | /** |
||
| 4173 | * Generates a carousel item. |
||
| 4174 | * @param string $content the content. |
||
| 4175 | * @param string $label the item label text. |
||
| 4176 | * @param string $caption the item caption text. |
||
| 4177 | * @param array $htmlOptions additional HTML attributes. |
||
| 4178 | * @return string the generated item. |
||
| 4179 | */ |
||
| 4180 | public static function carouselItem($content, $label, $caption, $htmlOptions = array()) |
||
| 4206 | |||
| 4207 | /** |
||
| 4208 | * Generates a previous link for the carousel. |
||
| 4209 | * @param string $label the link label text. |
||
| 4210 | * @param string $url the link url. |
||
| 4211 | * @param array $htmlOptions additional HTML attributes. |
||
| 4212 | * @return string the generated link. |
||
| 4213 | */ |
||
| 4214 | public static function carouselPrevLink($label, $url = '#', $htmlOptions = array()) |
||
| 4220 | |||
| 4221 | /** |
||
| 4222 | * Generates a next link for the carousel. |
||
| 4223 | * @param string $label the link label text. |
||
| 4224 | * @param string $url the link url. |
||
| 4225 | * @param array $htmlOptions additional HTML attributes. |
||
| 4226 | * @return string the generated link. |
||
| 4227 | */ |
||
| 4228 | public static function carouselNextLink($label, $url = '#', $htmlOptions = array()) |
||
| 4234 | |||
| 4235 | /** |
||
| 4236 | * Generates an indicator for the carousel. |
||
| 4237 | * @param string $target the CSS selector for the target element. |
||
| 4238 | * @param integer $numSlides the number of slides. |
||
| 4239 | * @param array $htmlOptions additional HTML attributes. |
||
| 4240 | * @return string the generated indicators. |
||
| 4241 | */ |
||
| 4242 | public static function carouselIndicators($target, $numSlides, $htmlOptions = array()) |
||
| 4256 | |||
| 4257 | // UTILITIES |
||
| 4258 | // -------------------------------------------------- |
||
| 4259 | |||
| 4260 | /** |
||
| 4261 | * Appends new class names to the given options.. |
||
| 4262 | * @param mixed $className the class(es) to append. |
||
| 4263 | * @param array $htmlOptions the options. |
||
| 4264 | * @return array the options. |
||
| 4265 | */ |
||
| 4266 | public static function addCssClass($className, &$htmlOptions) |
||
| 4285 | |||
| 4286 | /** |
||
| 4287 | * Appends a CSS style string to the given options. |
||
| 4288 | * @param string $style the CSS style string. |
||
| 4289 | * @param array $htmlOptions the options. |
||
| 4290 | * @return array the options. |
||
| 4291 | */ |
||
| 4292 | public static function addCssStyle($style, &$htmlOptions) |
||
| 4302 | |||
| 4303 | /** |
||
| 4304 | * Adds the grid span class to the given options is applicable. |
||
| 4305 | * @param array $htmlOptions the HTML attributes. |
||
| 4306 | */ |
||
| 4307 | protected static function addSpanClass(&$htmlOptions) |
||
| 4314 | |||
| 4315 | /** |
||
| 4316 | * Adds the pull class to the given options is applicable. |
||
| 4317 | * @param array $htmlOptions the HTML attributes. |
||
| 4318 | */ |
||
| 4319 | protected static function addPullClass(&$htmlOptions) |
||
| 4326 | |||
| 4327 | /** |
||
| 4328 | * Adds the text align class to the given options if applicable. |
||
| 4329 | * @param array $htmlOptions the HTML attributes. |
||
| 4330 | */ |
||
| 4331 | protected static function addTextAlignClass(&$htmlOptions) |
||
| 4338 | } |
||
| 4339 |
This check looks for a call to a parent method whose name is different than the method from which it is called.
Consider the following code:
The
getFirstName()method in theSoncalls the wrong method in the parent class.