| @@ -1,495 +1,569 @@ | ||
| 1 | -<?php | |
| 2 | - | |
| 3 | -/* * ********************************************************* | |
| 4 | - * Row | |
| 5 | - * ********************************************************* */ | |
| 6 | - | |
| 7 | -function osc_theme_row($params, $content = null) { | |
| 8 | - $result = '<div class="row">'; | |
| 9 | - //echo '<textarea>'.$content.'</textarea>'; | |
| 10 | - $content = str_replace("]<br />", ']', $content); | |
| 11 | - $content = str_replace("<br />\n[", '[', $content); | |
| 12 | - $result .= do_shortcode($content); | |
| 13 | - $result .= '</div>'; | |
| 14 | - | |
| 15 | - return force_balance_tags($result); | |
| 16 | -} | |
| 17 | - | |
| 18 | -add_shortcode('row', 'osc_theme_row'); | |
| 19 | -/* * ********************************************************* | |
| 20 | - * TWO | |
| 21 | - * ********************************************************* */ | |
| 22 | - | |
| 23 | -function osc_theme_one_half($params, $content = null) { | |
| 24 | - extract(shortcode_atts(array( | |
| 25 | - 'md' => '', | |
| 26 | - 'sm' => '', | |
| 27 | - 'xs' => '', | |
| 28 | - 'off' => '' | |
| 29 | - ), $params)); | |
| 30 | - if ($md == 12) { | |
| 31 | - $mds = ''; | |
| 32 | - } else { | |
| 33 | - $mds = 'col-md-' . $md; | |
| 34 | - } | |
| 35 | - if ($sm == 12) { | |
| 36 | - $sms = ''; | |
| 37 | - } else { | |
| 38 | - $sms = 'col-sm-' . $sm; | |
| 39 | - } | |
| 40 | - if ($xs == 12) { | |
| 41 | - $xss = ''; | |
| 42 | - } else { | |
| 43 | - $xss = 'col-xs-' . $xs; | |
| 44 | - } | |
| 45 | - $result = '<div class="col-lg-6 ' . $mds . ' ' . $sms . ' ' . $xss . ' col-lg-offset-' . $off . ' one-half">'; | |
| 46 | - $result .= do_shortcode($content); | |
| 47 | - $result .= '</div>'; | |
| 48 | - | |
| 49 | - return force_balance_tags($result); | |
| 50 | -} | |
| 51 | - | |
| 52 | -add_shortcode('one_half', 'osc_theme_one_half'); | |
| 53 | - | |
| 54 | -function osc_theme_one_half_last($params, $content = null) { | |
| 55 | - extract(shortcode_atts(array( | |
| 56 | - 'md' => '', | |
| 57 | - 'sm' => '', | |
| 58 | - 'xs' => '', | |
| 59 | - 'off' => '' | |
| 60 | - ), $params)); | |
| 61 | - if ($md == 12) { | |
| 62 | - $mds = ''; | |
| 63 | - } else { | |
| 64 | - $mds = 'col-md-' . $md; | |
| 65 | - } | |
| 66 | - if ($sm == 12) { | |
| 67 | - $sms = ''; | |
| 68 | - } else { | |
| 69 | - $sms = 'col-sm-' . $sm; | |
| 70 | - } | |
| 71 | - if ($xs == 12) { | |
| 72 | - $xss = ''; | |
| 73 | - } else { | |
| 74 | - $xss = 'col-xs-' . $xs; | |
| 75 | - } | |
| 76 | - $result = '<div class="col-lg-6 ' . $mds . ' ' . $sms . ' ' . $xss . ' col-lg-offset-' . $off . ' one-half-last">'; | |
| 77 | - $result .= do_shortcode($content); | |
| 78 | - $result .= '</div>'; | |
| 79 | - | |
| 80 | - return force_balance_tags($result); | |
| 81 | -} | |
| 82 | - | |
| 83 | -add_shortcode('one_half_last', 'osc_theme_one_half_last'); | |
| 84 | - | |
| 85 | -/* * ********************************************************* | |
| 86 | - * THIRD | |
| 87 | - * ********************************************************* */ | |
| 88 | - | |
| 89 | -function osc_theme_one_third($params, $content = null) { | |
| 90 | - extract(shortcode_atts(array( | |
| 91 | - 'md' => '', | |
| 92 | - 'sm' => '', | |
| 93 | - 'xs' => '', | |
| 94 | - 'off' => '' | |
| 95 | - ), $params)); | |
| 96 | - if ($md == 12) { | |
| 97 | - $mds = ''; | |
| 98 | - } else { | |
| 99 | - $mds = 'col-md-' . $md; | |
| 100 | - } | |
| 101 | - if ($sm == 12) { | |
| 102 | - $sms = ''; | |
| 103 | - } else { | |
| 104 | - $sms = 'col-sm-' . $sm; | |
| 105 | - } | |
| 106 | - if ($xs == 12) { | |
| 107 | - $xss = ''; | |
| 108 | - } else { | |
| 109 | - $xss = 'col-xs-' . $xs; | |
| 110 | - } | |
| 111 | - $result = '<div class="sc-column col-lg-4 ' . $mds . ' ' . $sms . ' ' . $xss . ' col-lg-offset-' . $off . ' ">'; //one-third | |
| 112 | - $result .= do_shortcode($content); | |
| 113 | - $result .= '</div>'; | |
| 114 | - | |
| 115 | - return force_balance_tags($result); | |
| 116 | -} | |
| 117 | - | |
| 118 | -add_shortcode('one_third', 'osc_theme_one_third'); | |
| 119 | - | |
| 120 | -function osc_theme_one_third_last($params, $content = null) { | |
| 121 | - extract(shortcode_atts(array( | |
| 122 | - 'md' => '', | |
| 123 | - 'sm' => '', | |
| 124 | - 'xs' => '', | |
| 125 | - 'off' => '' | |
| 126 | - ), $params)); | |
| 127 | - if ($md == 12) { | |
| 128 | - $mds = ''; | |
| 129 | - } else { | |
| 130 | - $mds = 'col-md-' . $md; | |
| 131 | - } | |
| 132 | - if ($sm == 12) { | |
| 133 | - $sms = ''; | |
| 134 | - } else { | |
| 135 | - $sms = 'col-sm-' . $sm; | |
| 136 | - } | |
| 137 | - if ($xs == 12) { | |
| 138 | - $xss = ''; | |
| 139 | - } else { | |
| 140 | - $xss = 'col-xs-' . $xs; | |
| 141 | - } | |
| 142 | - $result = '<div class="col-lg-4 ' . $mds . ' ' . $sms . ' ' . $xss . ' col-lg-offset-' . $off . ' column-last">'; // one-third-last | |
| 143 | - $result .= do_shortcode($content); | |
| 144 | - $result .= '</div>'; | |
| 145 | - | |
| 146 | - return force_balance_tags($result); | |
| 147 | -} | |
| 148 | - | |
| 149 | -add_shortcode('one_third_last', 'osc_theme_one_third_last'); | |
| 150 | - | |
| 151 | -function osc_theme_two_third($params, $content = null) { | |
| 152 | - extract(shortcode_atts(array( | |
| 153 | - 'md' => '', | |
| 154 | - 'sm' => '', | |
| 155 | - 'xs' => '', | |
| 156 | - 'off' => '' | |
| 157 | - ), $params)); | |
| 158 | - if ($md == 12) { | |
| 159 | - $mds = ''; | |
| 160 | - } else { | |
| 161 | - $mds = 'col-md-' . $md; | |
| 162 | - } | |
| 163 | - if ($sm == 12) { | |
| 164 | - $sms = ''; | |
| 165 | - } else { | |
| 166 | - $sms = 'col-sm-' . $sm; | |
| 167 | - } | |
| 168 | - if ($xs == 12) { | |
| 169 | - $xss = ''; | |
| 170 | - } else { | |
| 171 | - $xss = 'col-xs-' . $xs; | |
| 172 | - } | |
| 173 | - $result = '<div class=" col-lg-8 ' . $mds . ' ' . $sms . ' ' . $xss . ' col-lg-offset-' . $off . ' ">'; //two-third | |
| 174 | - $result .= do_shortcode($content); | |
| 175 | - $result .= '</div>'; | |
| 176 | - | |
| 177 | - return force_balance_tags($result); | |
| 178 | -} | |
| 179 | - | |
| 180 | -add_shortcode('two_third', 'osc_theme_two_third'); | |
| 181 | - | |
| 182 | -function osc_theme_two_third_last($params, $content = null) { | |
| 183 | - extract(shortcode_atts(array( | |
| 184 | - 'md' => '', | |
| 185 | - 'sm' => '', | |
| 186 | - 'xs' => '', | |
| 187 | - 'off' => '' | |
| 188 | - ), $params)); | |
| 189 | - if ($md == 12) { | |
| 190 | - $mds = ''; | |
| 191 | - } else { | |
| 192 | - $mds = 'col-md-' . $md; | |
| 193 | - } | |
| 194 | - if ($sm == 12) { | |
| 195 | - $sms = ''; | |
| 196 | - } else { | |
| 197 | - $sms = 'col-sm-' . $sm; | |
| 198 | - } | |
| 199 | - if ($xs == 12) { | |
| 200 | - $xss = ''; | |
| 201 | - } else { | |
| 202 | - $xss = 'col-xs-' . $xs; | |
| 203 | - } | |
| 204 | - $result = '<div class="col-lg-8 ' . $mds . ' ' . $sms . ' ' . $xss . ' col-lg-offset-' . $off . ' column-last ">'; //two-third-last | |
| 205 | - $result .= do_shortcode($content); | |
| 206 | - $result .= '</div>'; | |
| 207 | - | |
| 208 | - return force_balance_tags($result); | |
| 209 | -} | |
| 210 | - | |
| 211 | -add_shortcode('two_third_last', 'osc_theme_two_third_last'); | |
| 212 | - | |
| 213 | -/* * ********************************************************* | |
| 214 | - * FOURTH | |
| 215 | - * ********************************************************* */ | |
| 216 | - | |
| 217 | -function osc_theme_one_fourth($params, $content = null) { | |
| 218 | - extract(shortcode_atts(array( | |
| 219 | - 'md' => '', | |
| 220 | - 'sm' => '', | |
| 221 | - 'xs' => '', | |
| 222 | - 'off' => '' | |
| 223 | - ), $params)); | |
| 224 | - if ($md == 12) { | |
| 225 | - $mds = ''; | |
| 226 | - } else { | |
| 227 | - $mds = 'col-md-' . $md; | |
| 228 | - } | |
| 229 | - if ($sm == 12) { | |
| 230 | - $sms = ''; | |
| 231 | - } else { | |
| 232 | - $sms = 'col-sm-' . $sm; | |
| 233 | - } | |
| 234 | - if ($xs == 12) { | |
| 235 | - $xss = ''; | |
| 236 | - } else { | |
| 237 | - $xss = 'col-xs-' . $xs; | |
| 238 | - } | |
| 239 | - $result = '<div class="col-lg-3 ' . $mds . ' ' . $sms . ' ' . $xss . ' col-lg-offset-' . $off . ' one-fourth">'; | |
| 240 | - $result .= do_shortcode($content); | |
| 241 | - $result .= '</div>'; | |
| 242 | - | |
| 243 | - return force_balance_tags($result); | |
| 244 | -} | |
| 245 | - | |
| 246 | -add_shortcode('one_fourth', 'osc_theme_one_fourth'); | |
| 247 | - | |
| 248 | -function osc_theme_one_fourth_last($params, $content = null) { | |
| 249 | - extract(shortcode_atts(array( | |
| 250 | - 'md' => '', | |
| 251 | - 'sm' => '', | |
| 252 | - 'xs' => '', | |
| 253 | - 'off' => '' | |
| 254 | - ), $params)); | |
| 255 | - if ($md == 12) { | |
| 256 | - $mds = ''; | |
| 257 | - } else { | |
| 258 | - $mds = 'col-md-' . $md; | |
| 259 | - } | |
| 260 | - if ($sm == 12) { | |
| 261 | - $sms = ''; | |
| 262 | - } else { | |
| 263 | - $sms = 'col-sm-' . $sm; | |
| 264 | - } | |
| 265 | - if ($xs == 12) { | |
| 266 | - $xss = ''; | |
| 267 | - } else { | |
| 268 | - $xss = 'col-xs-' . $xs; | |
| 269 | - } | |
| 270 | - $result = '<div class="col-lg-3 ' . $mds . ' ' . $sms . ' ' . $xss . ' col-lg-offset-' . $off . ' column-last one-fourth-last">'; | |
| 271 | - $result .= do_shortcode($content); | |
| 272 | - $result .= '</div>'; | |
| 273 | - | |
| 274 | - return force_balance_tags($result); | |
| 275 | -} | |
| 276 | - | |
| 277 | -add_shortcode('one_fourth_last', 'osc_theme_one_fourth_last'); | |
| 278 | - | |
| 279 | -function osc_theme_three_fourth($params, $content = null) { | |
| 280 | - extract(shortcode_atts(array( | |
| 281 | - 'md' => '', | |
| 282 | - 'sm' => '', | |
| 283 | - 'xs' => '', | |
| 284 | - 'off' => '' | |
| 285 | - ), $params)); | |
| 286 | - if ($md == 12) { | |
| 287 | - $mds = ''; | |
| 288 | - } else { | |
| 289 | - $mds = 'col-md-' . $md; | |
| 290 | - } | |
| 291 | - if ($sm == 12) { | |
| 292 | - $sms = ''; | |
| 293 | - } else { | |
| 294 | - $sms = 'col-sm-' . $sm; | |
| 295 | - } | |
| 296 | - if ($xs == 12) { | |
| 297 | - $xss = ''; | |
| 298 | - } else { | |
| 299 | - $xss = 'col-xs-' . $xs; | |
| 300 | - } | |
| 301 | - $result = '<div class="col-lg-3 ' . $mds . ' ' . $sms . ' ' . $xss . ' col-lg-offset-' . $off . ' three-fourth">'; | |
| 302 | - $result .= do_shortcode($content); | |
| 303 | - $result .= '</div>'; | |
| 304 | - | |
| 305 | - return force_balance_tags($result); | |
| 306 | -} | |
| 307 | - | |
| 308 | -add_shortcode('three_fourth', 'osc_theme_three_fourth'); | |
| 309 | - | |
| 310 | -function osc_theme_three_fourth_last($params, $content = null) { | |
| 311 | - extract(shortcode_atts(array( | |
| 312 | - 'md' => '', | |
| 313 | - 'sm' => '', | |
| 314 | - 'xs' => '', | |
| 315 | - 'off' => '' | |
| 316 | - ), $params)); | |
| 317 | - if ($md == 12) { | |
| 318 | - $mds = ''; | |
| 319 | - } else { | |
| 320 | - $mds = 'col-md-' . $md; | |
| 321 | - } | |
| 322 | - if ($sm == 12) { | |
| 323 | - $sms = ''; | |
| 324 | - } else { | |
| 325 | - $sms = 'col-sm-' . $sm; | |
| 326 | - } | |
| 327 | - if ($xs == 12) { | |
| 328 | - $xss = ''; | |
| 329 | - } else { | |
| 330 | - $xss = 'col-xs-' . $xs; | |
| 331 | - } | |
| 332 | - $result = '<div class="col-lg-6 ' . $mds . ' ' . $sms . ' ' . $xss . ' col-lg-offset-' . $off . ' column-last three-fourth-last">'; | |
| 333 | - $result .= do_shortcode($content); | |
| 334 | - $result .= '</div>'; | |
| 335 | - | |
| 336 | - return force_balance_tags($result); | |
| 337 | -} | |
| 338 | - | |
| 339 | -add_shortcode('three_fourth_last', 'osc_theme_three_fourth_last'); | |
| 340 | - | |
| 341 | -function osc_theme_one_fourth_second($params, $content = null) { | |
| 342 | - extract(shortcode_atts(array( | |
| 343 | - 'md' => '', | |
| 344 | - 'sm' => '', | |
| 345 | - 'xs' => '', | |
| 346 | - 'off' => '' | |
| 347 | - ), $params)); | |
| 348 | - if ($md == 12) { | |
| 349 | - $mds = ''; | |
| 350 | - } else { | |
| 351 | - $mds = 'col-md-' . $md; | |
| 352 | - } | |
| 353 | - if ($sm == 12) { | |
| 354 | - $sms = ''; | |
| 355 | - } else { | |
| 356 | - $sms = 'col-sm-' . $sm; | |
| 357 | - } | |
| 358 | - if ($xs == 12) { | |
| 359 | - $xss = ''; | |
| 360 | - } else { | |
| 361 | - $xss = 'col-xs-' . $xs; | |
| 362 | - } | |
| 363 | - $result = '<div class="col-lg-3 ' . $mds . ' ' . $sms . ' ' . $xss . ' col-lg-offset-' . $off . ' one-fourth-second">'; | |
| 364 | - $result .= do_shortcode($content); | |
| 365 | - $result .= '</div>'; | |
| 366 | - | |
| 367 | - return force_balance_tags($result); | |
| 368 | -} | |
| 369 | - | |
| 370 | -add_shortcode('one_fourth_second', 'osc_theme_one_fourth_second'); | |
| 371 | - | |
| 372 | -function osc_theme_one_fourth_third($params, $content = null) { | |
| 373 | - extract(shortcode_atts(array( | |
| 374 | - 'md' => '', | |
| 375 | - 'sm' => '', | |
| 376 | - 'xs' => '', | |
| 377 | - 'off' => '' | |
| 378 | - ), $params)); | |
| 379 | - if ($md == 12) { | |
| 380 | - $mds = ''; | |
| 381 | - } else { | |
| 382 | - $mds = 'col-md-' . $md; | |
| 383 | - } | |
| 384 | - if ($sm == 12) { | |
| 385 | - $sms = ''; | |
| 386 | - } else { | |
| 387 | - $sms = 'col-sm-' . $sm; | |
| 388 | - } | |
| 389 | - if ($xs == 12) { | |
| 390 | - $xss = ''; | |
| 391 | - } else { | |
| 392 | - $xss = 'col-xs-' . $xs; | |
| 393 | - } | |
| 394 | - | |
| 395 | - $result = '<div class="col-lg-3 ' . $mds . ' ' . $sms . ' ' . $xss . ' col-lg-offset-' . $off . ' one-fourth-third">'; | |
| 396 | - $result .= do_shortcode($content); | |
| 397 | - $result .= '</div>'; | |
| 398 | - | |
| 399 | - return force_balance_tags($result); | |
| 400 | -} | |
| 401 | - | |
| 402 | -add_shortcode('one_fourth_third', 'osc_theme_one_fourth_third'); | |
| 403 | - | |
| 404 | -function osc_theme_one_half_second($params, $content = null) { | |
| 405 | - extract(shortcode_atts(array( | |
| 406 | - 'md' => '', | |
| 407 | - 'sm' => '', | |
| 408 | - 'xs' => '', | |
| 409 | - 'off' => '' | |
| 410 | - ), $params)); | |
| 411 | - if ($md == 12) { | |
| 412 | - $mds = ''; | |
| 413 | - } else { | |
| 414 | - $mds = 'col-md-' . $md; | |
| 415 | - } | |
| 416 | - if ($sm == 12) { | |
| 417 | - $sms = ''; | |
| 418 | - } else { | |
| 419 | - $sms = 'col-sm-' . $sm; | |
| 420 | - } | |
| 421 | - if ($xs == 12) { | |
| 422 | - $xss = ''; | |
| 423 | - } else { | |
| 424 | - $xss = 'col-xs-' . $xs; | |
| 425 | - } | |
| 426 | - $result = '<div class="col-lg-6 ' . $mds . ' ' . $sms . ' ' . $xss . ' col-lg-offset-' . $off . ' one-half-second">'; | |
| 427 | - $result .= do_shortcode($content); | |
| 428 | - $result .= '</div>'; | |
| 429 | - | |
| 430 | - return force_balance_tags($result); | |
| 431 | -} | |
| 432 | - | |
| 433 | -add_shortcode('one_half_second', 'osc_theme_one_half_second'); | |
| 434 | - | |
| 435 | -function osc_theme_one_third_second($params, $content = null) { | |
| 436 | - extract(shortcode_atts(array( | |
| 437 | - 'md' => '', | |
| 438 | - 'sm' => '', | |
| 439 | - 'xs' => '', | |
| 440 | - 'off' => '' | |
| 441 | - ), $params)); | |
| 442 | - if ($md == 12) { | |
| 443 | - $mds = ''; | |
| 444 | - } else { | |
| 445 | - $mds = 'col-md-' . $md; | |
| 446 | - } | |
| 447 | - if ($sm == 12) { | |
| 448 | - $sms = ''; | |
| 449 | - } else { | |
| 450 | - $sms = 'col-sm-' . $sm; | |
| 451 | - } | |
| 452 | - if ($xs == 12) { | |
| 453 | - $xss = ''; | |
| 454 | - } else { | |
| 455 | - $xss = 'col-xs-' . $xs; | |
| 456 | - } | |
| 457 | - $result = '<div class="col-lg-4 ' . $mds . ' ' . $sms . ' ' . $xss . ' col-lg-offset-' . $off . ' one-third-second">'; | |
| 458 | - $result .= do_shortcode($content); | |
| 459 | - $result .= '</div>'; | |
| 460 | - | |
| 461 | - return force_balance_tags($result); | |
| 462 | -} | |
| 463 | - | |
| 464 | -add_shortcode('one_third_second', 'osc_theme_one_third_second'); | |
| 465 | - | |
| 466 | -function osc_theme_one_column($params, $content = null) { | |
| 467 | - extract(shortcode_atts(array( | |
| 468 | - 'md' => '', | |
| 469 | - 'sm' => '', | |
| 470 | - 'xs' => '', | |
| 471 | - 'off' => '' | |
| 472 | - ), $params)); | |
| 473 | - if ($md == 12) { | |
| 474 | - $mds = ''; | |
| 475 | - } else { | |
| 476 | - $mds = 'col-md-' . $md; | |
| 477 | - } | |
| 478 | - if ($sm == 12) { | |
| 479 | - $sms = ''; | |
| 480 | - } else { | |
| 481 | - $sms = 'col-sm-' . $sm; | |
| 482 | - } | |
| 483 | - if ($xs == 12) { | |
| 484 | - $xss = ''; | |
| 485 | - } else { | |
| 486 | - $xss = 'col-xs-' . $xs; | |
| 487 | - } | |
| 488 | - $result = '<div class="col-lg-12 ' . $mds . ' ' . $sms . ' ' . $xss . ' col-lg-offset-' . $off . ' one-column">'; | |
| 489 | - $result .= do_shortcode($content); | |
| 490 | - $result .= '</div>'; | |
| 491 | - | |
| 492 | - return force_balance_tags($result); | |
| 493 | -} | |
| 494 | - | |
| 495 | -add_shortcode('one_column', 'osc_theme_one_column'); | |
| 1 | +<?php | |
| 2 | + | |
| 3 | +/* * ********************************************************* | |
| 4 | + * Row | |
| 5 | + * ********************************************************* */ | |
| 6 | + | |
| 7 | +function osc_theme_row($params, $content = null) { | |
| 8 | + extract(shortcode_atts(array( | |
| 9 | + 'class' => '' | |
| 10 | + ), $params)); | |
| 11 | + $result = '<div class="row ' . $class . '">'; | |
| 12 | + //echo '<textarea>'.$content.'</textarea>'; | |
| 13 | + $content = str_replace("]<br />", ']', $content); | |
| 14 | + $content = str_replace("<br />\n[", '[', $content); | |
| 15 | + $result .= do_shortcode($content); | |
| 16 | + $result .= '</div>'; | |
| 17 | + | |
| 18 | + return $result; | |
| 19 | +} | |
| 20 | + | |
| 21 | +add_shortcode('row', 'osc_theme_row'); | |
| 22 | +/* * ********************************************************* | |
| 23 | + * TWO | |
| 24 | + * ********************************************************* */ | |
| 25 | + | |
| 26 | +function osc_theme_column($params, $content = null) { | |
| 27 | + extract(shortcode_atts(array( | |
| 28 | + 'md' => '', | |
| 29 | + 'sm' => '', | |
| 30 | + 'xs' => '', | |
| 31 | + 'lg' => '', | |
| 32 | + 'mdoff' => '', | |
| 33 | + 'smoff' => '', | |
| 34 | + 'xsoff' => '', | |
| 35 | + 'lgoff' => '', | |
| 36 | + 'mdhide' => '', | |
| 37 | + 'smhide' => '', | |
| 38 | + 'xshide' => '', | |
| 39 | + 'lghide' => '', | |
| 40 | + 'mdclear' => '', | |
| 41 | + 'smclear' => '', | |
| 42 | + 'xsclear' => '', | |
| 43 | + 'lgclear' => '', | |
| 44 | + 'off'=>'' | |
| 45 | + ), $params)); | |
| 46 | + | |
| 47 | + | |
| 48 | + $arr = array('md', 'xs', 'sm'); | |
| 49 | + $classes = array(); | |
| 50 | + foreach ($arr as $k => $aa) { | |
| 51 | + if (${$aa} == 12 || ${$aa} == '') { | |
| 52 | + $classes[] = 'col-' . $aa . '-12'; | |
| 53 | + } else { | |
| 54 | + $classes[] = 'col-' . $aa . '-' . ${$aa}; | |
| 55 | + } | |
| 56 | + } | |
| 57 | + $arr2 = array('mdoff', 'smoff', 'xsoff', 'lgoff'); | |
| 58 | + foreach ($arr2 as $k => $aa) { | |
| 59 | + $nn = str_replace('off', '', $aa); | |
| 60 | + if (${$aa} == 0 || ${$aa} == '') { | |
| 61 | + //$classes[] = ''; | |
| 62 | + } else { | |
| 63 | + $classes[] = 'col-' . $nn . '-offset-' . ${$aa}; | |
| 64 | + } | |
| 65 | + } | |
| 66 | + $arr2 = array('mdhide', 'smhide', 'xshide', 'lghide'); | |
| 67 | + foreach ($arr2 as $k => $aa) { | |
| 68 | + $nn = str_replace('hide', '', $aa); | |
| 69 | + if (${$aa} == 'yes') { | |
| 70 | + $classes[] = 'hidden-' . $nn; | |
| 71 | + } | |
| 72 | + } | |
| 73 | + $arr2 = array('mdclear', 'smclear', 'xsclear', 'lgclear'); | |
| 74 | + foreach ($arr2 as $k => $aa) { | |
| 75 | + $nn = str_replace('clear', '', $aa); | |
| 76 | + if (${$aa} == 'yes') { | |
| 77 | + $classes[] = 'clear-' . $nn; | |
| 78 | + } | |
| 79 | + } | |
| 80 | + if ($off != '') { | |
| 81 | + $classes[] = 'col-lg-offset-'.$off; | |
| 82 | + } | |
| 83 | + | |
| 84 | + if ($off != '') { | |
| 85 | + $classes[] = 'col-lg-offset-'.$off; | |
| 86 | + } | |
| 87 | + $result = '<div class="col-lg-' . $lg . ' ' . implode(' ', $classes) . '">'; | |
| 88 | + $result .= do_shortcode($content); | |
| 89 | + $result .= '</div>'; | |
| 90 | + | |
| 91 | + return $result; | |
| 92 | +} | |
| 93 | + | |
| 94 | +add_shortcode('column', 'osc_theme_column'); | |
| 95 | + | |
| 96 | + | |
| 97 | +function osc_theme_one_half($params, $content = null) { | |
| 98 | + extract(shortcode_atts(array( | |
| 99 | + 'md' => '', | |
| 100 | + 'sm' => '', | |
| 101 | + 'xs' => '', | |
| 102 | + 'off' => '' | |
| 103 | + ), $params)); | |
| 104 | + if ($md == 12) { | |
| 105 | + $mds = ''; | |
| 106 | + } else { | |
| 107 | + $mds = 'col-md-' . $md; | |
| 108 | + } | |
| 109 | + if ($sm == 12) { | |
| 110 | + $sms = ''; | |
| 111 | + } else { | |
| 112 | + $sms = 'col-sm-' . $sm; | |
| 113 | + } | |
| 114 | + if ($xs == 12) { | |
| 115 | + $xss = ''; | |
| 116 | + } else { | |
| 117 | + $xss = 'col-xs-' . $xs; | |
| 118 | + } | |
| 119 | + $result = '<div class="col-lg-6 ' . $mds . ' ' . $sms . ' ' . $xss . ' col-lg-offset-' . $off . ' one-half">'; | |
| 120 | + $result .= do_shortcode($content); | |
| 121 | + $result .= '</div>'; | |
| 122 | + | |
| 123 | + return $result; | |
| 124 | +} | |
| 125 | + | |
| 126 | +add_shortcode('one_half', 'osc_theme_one_half'); | |
| 127 | + | |
| 128 | +function osc_theme_one_half_last($params, $content = null) { | |
| 129 | + extract(shortcode_atts(array( | |
| 130 | + 'md' => '', | |
| 131 | + 'sm' => '', | |
| 132 | + 'xs' => '', | |
| 133 | + 'off' => '' | |
| 134 | + ), $params)); | |
| 135 | + if ($md == 12) { | |
| 136 | + $mds = ''; | |
| 137 | + } else { | |
| 138 | + $mds = 'col-md-' . $md; | |
| 139 | + } | |
| 140 | + if ($sm == 12) { | |
| 141 | + $sms = ''; | |
| 142 | + } else { | |
| 143 | + $sms = 'col-sm-' . $sm; | |
| 144 | + } | |
| 145 | + if ($xs == 12) { | |
| 146 | + $xss = ''; | |
| 147 | + } else { | |
| 148 | + $xss = 'col-xs-' . $xs; | |
| 149 | + } | |
| 150 | + $result = '<div class="col-lg-6 ' . $mds . ' ' . $sms . ' ' . $xss . ' col-lg-offset-' . $off . ' one-half-last">'; | |
| 151 | + $result .= do_shortcode($content); | |
| 152 | + $result .= '</div>'; | |
| 153 | + | |
| 154 | + return $result; | |
| 155 | +} | |
| 156 | + | |
| 157 | +add_shortcode('one_half_last', 'osc_theme_one_half_last'); | |
| 158 | + | |
| 159 | +/* * ********************************************************* | |
| 160 | + * THIRD | |
| 161 | + * ********************************************************* */ | |
| 162 | + | |
| 163 | +function osc_theme_one_third($params, $content = null) { | |
| 164 | + extract(shortcode_atts(array( | |
| 165 | + 'md' => '', | |
| 166 | + 'sm' => '', | |
| 167 | + 'xs' => '', | |
| 168 | + 'off' => '' | |
| 169 | + ), $params)); | |
| 170 | + if ($md == 12) { | |
| 171 | + $mds = ''; | |
| 172 | + } else { | |
| 173 | + $mds = 'col-md-' . $md; | |
| 174 | + } | |
| 175 | + if ($sm == 12) { | |
| 176 | + $sms = ''; | |
| 177 | + } else { | |
| 178 | + $sms = 'col-sm-' . $sm; | |
| 179 | + } | |
| 180 | + if ($xs == 12) { | |
| 181 | + $xss = ''; | |
| 182 | + } else { | |
| 183 | + $xss = 'col-xs-' . $xs; | |
| 184 | + } | |
| 185 | + $result = '<div class="sc-column col-lg-4 ' . $mds . ' ' . $sms . ' ' . $xss . ' col-lg-offset-' . $off . ' ">'; //one-third | |
| 186 | + $result .= do_shortcode($content); | |
| 187 | + $result .= '</div>'; | |
| 188 | + | |
| 189 | + return $result; | |
| 190 | +} | |
| 191 | + | |
| 192 | +add_shortcode('one_third', 'osc_theme_one_third'); | |
| 193 | + | |
| 194 | +function osc_theme_one_third_last($params, $content = null) { | |
| 195 | + extract(shortcode_atts(array( | |
| 196 | + 'md' => '', | |
| 197 | + 'sm' => '', | |
| 198 | + 'xs' => '', | |
| 199 | + 'off' => '' | |
| 200 | + ), $params)); | |
| 201 | + if ($md == 12) { | |
| 202 | + $mds = ''; | |
| 203 | + } else { | |
| 204 | + $mds = 'col-md-' . $md; | |
| 205 | + } | |
| 206 | + if ($sm == 12) { | |
| 207 | + $sms = ''; | |
| 208 | + } else { | |
| 209 | + $sms = 'col-sm-' . $sm; | |
| 210 | + } | |
| 211 | + if ($xs == 12) { | |
| 212 | + $xss = ''; | |
| 213 | + } else { | |
| 214 | + $xss = 'col-xs-' . $xs; | |
| 215 | + } | |
| 216 | + $result = '<div class="col-lg-4 ' . $mds . ' ' . $sms . ' ' . $xss . ' col-lg-offset-' . $off . ' column-last">'; // one-third-last | |
| 217 | + $result .= do_shortcode($content); | |
| 218 | + $result .= '</div>'; | |
| 219 | + | |
| 220 | + return $result; | |
| 221 | +} | |
| 222 | + | |
| 223 | +add_shortcode('one_third_last', 'osc_theme_one_third_last'); | |
| 224 | + | |
| 225 | +function osc_theme_two_third($params, $content = null) { | |
| 226 | + extract(shortcode_atts(array( | |
| 227 | + 'md' => '', | |
| 228 | + 'sm' => '', | |
| 229 | + 'xs' => '', | |
| 230 | + 'off' => '' | |
| 231 | + ), $params)); | |
| 232 | + if ($md == 12) { | |
| 233 | + $mds = ''; | |
| 234 | + } else { | |
| 235 | + $mds = 'col-md-' . $md; | |
| 236 | + } | |
| 237 | + if ($sm == 12) { | |
| 238 | + $sms = ''; | |
| 239 | + } else { | |
| 240 | + $sms = 'col-sm-' . $sm; | |
| 241 | + } | |
| 242 | + if ($xs == 12) { | |
| 243 | + $xss = ''; | |
| 244 | + } else { | |
| 245 | + $xss = 'col-xs-' . $xs; | |
| 246 | + } | |
| 247 | + $result = '<div class=" col-lg-8 ' . $mds . ' ' . $sms . ' ' . $xss . ' col-lg-offset-' . $off . ' ">'; //two-third | |
| 248 | + $result .= do_shortcode($content); | |
| 249 | + $result .= '</div>'; | |
| 250 | + | |
| 251 | + return $result; | |
| 252 | +} | |
| 253 | + | |
| 254 | +add_shortcode('two_third', 'osc_theme_two_third'); | |
| 255 | + | |
| 256 | +function osc_theme_two_third_last($params, $content = null) { | |
| 257 | + extract(shortcode_atts(array( | |
| 258 | + 'md' => '', | |
| 259 | + 'sm' => '', | |
| 260 | + 'xs' => '', | |
| 261 | + 'off' => '' | |
| 262 | + ), $params)); | |
| 263 | + if ($md == 12) { | |
| 264 | + $mds = ''; | |
| 265 | + } else { | |
| 266 | + $mds = 'col-md-' . $md; | |
| 267 | + } | |
| 268 | + if ($sm == 12) { | |
| 269 | + $sms = ''; | |
| 270 | + } else { | |
| 271 | + $sms = 'col-sm-' . $sm; | |
| 272 | + } | |
| 273 | + if ($xs == 12) { | |
| 274 | + $xss = ''; | |
| 275 | + } else { | |
| 276 | + $xss = 'col-xs-' . $xs; | |
| 277 | + } | |
| 278 | + $result = '<div class="col-lg-8 ' . $mds . ' ' . $sms . ' ' . $xss . ' col-lg-offset-' . $off . ' column-last ">'; //two-third-last | |
| 279 | + $result .= do_shortcode($content); | |
| 280 | + $result .= '</div>'; | |
| 281 | + | |
| 282 | + return $result; | |
| 283 | +} | |
| 284 | + | |
| 285 | +add_shortcode('two_third_last', 'osc_theme_two_third_last'); | |
| 286 | + | |
| 287 | +/* * ********************************************************* | |
| 288 | + * FOURTH | |
| 289 | + * ********************************************************* */ | |
| 290 | + | |
| 291 | +function osc_theme_one_fourth($params, $content = null) { | |
| 292 | + extract(shortcode_atts(array( | |
| 293 | + 'md' => '', | |
| 294 | + 'sm' => '', | |
| 295 | + 'xs' => '', | |
| 296 | + 'off' => '' | |
| 297 | + ), $params)); | |
| 298 | + if ($md == 12) { | |
| 299 | + $mds = ''; | |
| 300 | + } else { | |
| 301 | + $mds = 'col-md-' . $md; | |
| 302 | + } | |
| 303 | + if ($sm == 12) { | |
| 304 | + $sms = ''; | |
| 305 | + } else { | |
| 306 | + $sms = 'col-sm-' . $sm; | |
| 307 | + } | |
| 308 | + if ($xs == 12) { | |
| 309 | + $xss = ''; | |
| 310 | + } else { | |
| 311 | + $xss = 'col-xs-' . $xs; | |
| 312 | + } | |
| 313 | + $result = '<div class="col-lg-3 ' . $mds . ' ' . $sms . ' ' . $xss . ' col-lg-offset-' . $off . ' one-fourth">'; | |
| 314 | + $result .= do_shortcode($content); | |
| 315 | + $result .= '</div>'; | |
| 316 | + | |
| 317 | + return $result; | |
| 318 | +} | |
| 319 | + | |
| 320 | +add_shortcode('one_fourth', 'osc_theme_one_fourth'); | |
| 321 | + | |
| 322 | +function osc_theme_one_fourth_last($params, $content = null) { | |
| 323 | + extract(shortcode_atts(array( | |
| 324 | + 'md' => '', | |
| 325 | + 'sm' => '', | |
| 326 | + 'xs' => '', | |
| 327 | + 'off' => '' | |
| 328 | + ), $params)); | |
| 329 | + if ($md == 12) { | |
| 330 | + $mds = ''; | |
| 331 | + } else { | |
| 332 | + $mds = 'col-md-' . $md; | |
| 333 | + } | |
| 334 | + if ($sm == 12) { | |
| 335 | + $sms = ''; | |
| 336 | + } else { | |
| 337 | + $sms = 'col-sm-' . $sm; | |
| 338 | + } | |
| 339 | + if ($xs == 12) { | |
| 340 | + $xss = ''; | |
| 341 | + } else { | |
| 342 | + $xss = 'col-xs-' . $xs; | |
| 343 | + } | |
| 344 | + $result = '<div class="col-lg-3 ' . $mds . ' ' . $sms . ' ' . $xss . ' col-lg-offset-' . $off . ' column-last one-fourth-last">'; | |
| 345 | + $result .= do_shortcode($content); | |
| 346 | + $result .= '</div>'; | |
| 347 | + | |
| 348 | + return $result; | |
| 349 | +} | |
| 350 | + | |
| 351 | +add_shortcode('one_fourth_last', 'osc_theme_one_fourth_last'); | |
| 352 | + | |
| 353 | +function osc_theme_three_fourth($params, $content = null) { | |
| 354 | + extract(shortcode_atts(array( | |
| 355 | + 'md' => '', | |
| 356 | + 'sm' => '', | |
| 357 | + 'xs' => '', | |
| 358 | + 'off' => '' | |
| 359 | + ), $params)); | |
| 360 | + if ($md == 12) { | |
| 361 | + $mds = ''; | |
| 362 | + } else { | |
| 363 | + $mds = 'col-md-' . $md; | |
| 364 | + } | |
| 365 | + if ($sm == 12) { | |
| 366 | + $sms = ''; | |
| 367 | + } else { | |
| 368 | + $sms = 'col-sm-' . $sm; | |
| 369 | + } | |
| 370 | + if ($xs == 12) { | |
| 371 | + $xss = ''; | |
| 372 | + } else { | |
| 373 | + $xss = 'col-xs-' . $xs; | |
| 374 | + } | |
| 375 | + $result = '<div class="col-lg-3 ' . $mds . ' ' . $sms . ' ' . $xss . ' col-lg-offset-' . $off . ' three-fourth">'; | |
| 376 | + $result .= do_shortcode($content); | |
| 377 | + $result .= '</div>'; | |
| 378 | + | |
| 379 | + return $result; | |
| 380 | +} | |
| 381 | + | |
| 382 | +add_shortcode('three_fourth', 'osc_theme_three_fourth'); | |
| 383 | + | |
| 384 | +function osc_theme_three_fourth_last($params, $content = null) { | |
| 385 | + extract(shortcode_atts(array( | |
| 386 | + 'md' => '', | |
| 387 | + 'sm' => '', | |
| 388 | + 'xs' => '', | |
| 389 | + 'off' => '' | |
| 390 | + ), $params)); | |
| 391 | + if ($md == 12) { | |
| 392 | + $mds = ''; | |
| 393 | + } else { | |
| 394 | + $mds = 'col-md-' . $md; | |
| 395 | + } | |
| 396 | + if ($sm == 12) { | |
| 397 | + $sms = ''; | |
| 398 | + } else { | |
| 399 | + $sms = 'col-sm-' . $sm; | |
| 400 | + } | |
| 401 | + if ($xs == 12) { | |
| 402 | + $xss = ''; | |
| 403 | + } else { | |
| 404 | + $xss = 'col-xs-' . $xs; | |
| 405 | + } | |
| 406 | + $result = '<div class="col-lg-6 ' . $mds . ' ' . $sms . ' ' . $xss . ' col-lg-offset-' . $off . ' column-last three-fourth-last">'; | |
| 407 | + $result .= do_shortcode($content); | |
| 408 | + $result .= '</div>'; | |
| 409 | + | |
| 410 | + return $result; | |
| 411 | +} | |
| 412 | + | |
| 413 | +add_shortcode('three_fourth_last', 'osc_theme_three_fourth_last'); | |
| 414 | + | |
| 415 | +function osc_theme_one_fourth_second($params, $content = null) { | |
| 416 | + extract(shortcode_atts(array( | |
| 417 | + 'md' => '', | |
| 418 | + 'sm' => '', | |
| 419 | + 'xs' => '', | |
| 420 | + 'off' => '' | |
| 421 | + ), $params)); | |
| 422 | + if ($md == 12) { | |
| 423 | + $mds = ''; | |
| 424 | + } else { | |
| 425 | + $mds = 'col-md-' . $md; | |
| 426 | + } | |
| 427 | + if ($sm == 12) { | |
| 428 | + $sms = ''; | |
| 429 | + } else { | |
| 430 | + $sms = 'col-sm-' . $sm; | |
| 431 | + } | |
| 432 | + if ($xs == 12) { | |
| 433 | + $xss = ''; | |
| 434 | + } else { | |
| 435 | + $xss = 'col-xs-' . $xs; | |
| 436 | + } | |
| 437 | + $result = '<div class="col-lg-3 ' . $mds . ' ' . $sms . ' ' . $xss . ' col-lg-offset-' . $off . ' one-fourth-second">'; | |
| 438 | + $result .= do_shortcode($content); | |
| 439 | + $result .= '</div>'; | |
| 440 | + | |
| 441 | + return $result; | |
| 442 | +} | |
| 443 | + | |
| 444 | +add_shortcode('one_fourth_second', 'osc_theme_one_fourth_second'); | |
| 445 | + | |
| 446 | +function osc_theme_one_fourth_third($params, $content = null) { | |
| 447 | + extract(shortcode_atts(array( | |
| 448 | + 'md' => '', | |
| 449 | + 'sm' => '', | |
| 450 | + 'xs' => '', | |
| 451 | + 'off' => '' | |
| 452 | + ), $params)); | |
| 453 | + if ($md == 12) { | |
| 454 | + $mds = ''; | |
| 455 | + } else { | |
| 456 | + $mds = 'col-md-' . $md; | |
| 457 | + } | |
| 458 | + if ($sm == 12) { | |
| 459 | + $sms = ''; | |
| 460 | + } else { | |
| 461 | + $sms = 'col-sm-' . $sm; | |
| 462 | + } | |
| 463 | + if ($xs == 12) { | |
| 464 | + $xss = ''; | |
| 465 | + } else { | |
| 466 | + $xss = 'col-xs-' . $xs; | |
| 467 | + } | |
| 468 | + | |
| 469 | + $result = '<div class="col-lg-3 ' . $mds . ' ' . $sms . ' ' . $xss . ' col-lg-offset-' . $off . ' one-fourth-third">'; | |
| 470 | + $result .= do_shortcode($content); | |
| 471 | + $result .= '</div>'; | |
| 472 | + | |
| 473 | + return $result; | |
| 474 | +} | |
| 475 | + | |
| 476 | +add_shortcode('one_fourth_third', 'osc_theme_one_fourth_third'); | |
| 477 | + | |
| 478 | +function osc_theme_one_half_second($params, $content = null) { | |
| 479 | + extract(shortcode_atts(array( | |
| 480 | + 'md' => '', | |
| 481 | + 'sm' => '', | |
| 482 | + 'xs' => '', | |
| 483 | + 'off' => '' | |
| 484 | + ), $params)); | |
| 485 | + if ($md == 12) { | |
| 486 | + $mds = ''; | |
| 487 | + } else { | |
| 488 | + $mds = 'col-md-' . $md; | |
| 489 | + } | |
| 490 | + if ($sm == 12) { | |
| 491 | + $sms = ''; | |
| 492 | + } else { | |
| 493 | + $sms = 'col-sm-' . $sm; | |
| 494 | + } | |
| 495 | + if ($xs == 12) { | |
| 496 | + $xss = ''; | |
| 497 | + } else { | |
| 498 | + $xss = 'col-xs-' . $xs; | |
| 499 | + } | |
| 500 | + $result = '<div class="col-lg-6 ' . $mds . ' ' . $sms . ' ' . $xss . ' col-lg-offset-' . $off . ' one-half-second">'; | |
| 501 | + $result .= do_shortcode($content); | |
| 502 | + $result .= '</div>'; | |
| 503 | + | |
| 504 | + return $result; | |
| 505 | +} | |
| 506 | + | |
| 507 | +add_shortcode('one_half_second', 'osc_theme_one_half_second'); | |
| 508 | + | |
| 509 | +function osc_theme_one_third_second($params, $content = null) { | |
| 510 | + extract(shortcode_atts(array( | |
| 511 | + 'md' => '', | |
| 512 | + 'sm' => '', | |
| 513 | + 'xs' => '', | |
| 514 | + 'off' => '' | |
| 515 | + ), $params)); | |
| 516 | + if ($md == 12) { | |
| 517 | + $mds = ''; | |
| 518 | + } else { | |
| 519 | + $mds = 'col-md-' . $md; | |
| 520 | + } | |
| 521 | + if ($sm == 12) { | |
| 522 | + $sms = ''; | |
| 523 | + } else { | |
| 524 | + $sms = 'col-sm-' . $sm; | |
| 525 | + } | |
| 526 | + if ($xs == 12) { | |
| 527 | + $xss = ''; | |
| 528 | + } else { | |
| 529 | + $xss = 'col-xs-' . $xs; | |
| 530 | + } | |
| 531 | + $result = '<div class="col-lg-4 ' . $mds . ' ' . $sms . ' ' . $xss . ' col-lg-offset-' . $off . ' one-third-second">'; | |
| 532 | + $result .= do_shortcode($content); | |
| 533 | + $result .= '</div>'; | |
| 534 | + | |
| 535 | + return $result; | |
| 536 | +} | |
| 537 | + | |
| 538 | +add_shortcode('one_third_second', 'osc_theme_one_third_second'); | |
| 539 | + | |
| 540 | +function osc_theme_one_column($params, $content = null) { | |
| 541 | + extract(shortcode_atts(array( | |
| 542 | + 'md' => '', | |
| 543 | + 'sm' => '', | |
| 544 | + 'xs' => '', | |
| 545 | + 'off' => '' | |
| 546 | + ), $params)); | |
| 547 | + if ($md == 12) { | |
| 548 | + $mds = ''; | |
| 549 | + } else { | |
| 550 | + $mds = 'col-md-' . $md; | |
| 551 | + } | |
| 552 | + if ($sm == 12) { | |
| 553 | + $sms = ''; | |
| 554 | + } else { | |
| 555 | + $sms = 'col-sm-' . $sm; | |
| 556 | + } | |
| 557 | + if ($xs == 12) { | |
| 558 | + $xss = ''; | |
| 559 | + } else { | |
| 560 | + $xss = 'col-xs-' . $xs; | |
| 561 | + } | |
| 562 | + $result = '<div class="col-lg-12 ' . $mds . ' ' . $sms . ' ' . $xss . ' col-lg-offset-' . $off . ' one-column">'; | |
| 563 | + $result .= do_shortcode($content); | |
| 564 | + $result .= '</div>'; | |
| 565 | + | |
| 566 | + return $result; | |
| 567 | +} | |
| 568 | + | |
| 569 | +add_shortcode('one_column', 'osc_theme_one_column'); | |