/app/view/class-ms-view-adminbar.php

  1. <?php 
  2. /** 
  3. * Renders Admin Bar's simulation. 
  4. * 
  5. * Extends MS_View for rendering methods and magic methods. 
  6. * 
  7. * @since 1.0.0 
  8. */ 
  9. class MS_View_Adminbar extends MS_View { 
  10.  
  11. /** 
  12. * Overrides parent's to_html() method. 
  13. * 
  14. * @since 1.0.0 
  15. * 
  16. * @return string 
  17. */ 
  18. public function to_html() { 
  19. $fields = $this->prepare_fields(); 
  20. $sim = $this->data['subscription']; 
  21. $mem = $sim->get_membership(); 
  22. $pay_types = $mem->get_payment_types(); 
  23.  
  24. if ( is_admin() ) { 
  25. $toggle_icon = 'dashicons-arrow-down'; 
  26. $toggle_state = 'collapsed'; 
  27. } else { 
  28. $toggle_icon = 'dashicons-arrow-up'; 
  29. $toggle_state = ''; 
  30.  
  31. $details = lib3()->session->get( 'ms-access' ); 
  32. $denied_url = false; 
  33. $deciding_membership = false; 
  34. $deciding_rule = false; 
  35.  
  36. if ( isset( $details[1] ) && ! $details[1]['has_access'] ) { 
  37. if ( ! empty( $details[1]['url'] ) ) { 
  38. $denied_url = $details[1]['url']; 
  39. if ( ! empty( $details[1]['deciding_membership'] ) ) { 
  40. $deciding_membership = $details[1]['deciding_membership']; 
  41. if ( ! empty( $details[1]['deciding_rule'] ) ) { 
  42. $deciding_rule = $details[1]['deciding_rule']; 
  43. } elseif ( isset( $details[0] ) && $details[0]['has_access'] ) { 
  44. if ( ! empty( $details[0]['deciding_membership'] ) ) { 
  45. $deciding_membership = $details[0]['deciding_membership']; 
  46. if ( ! empty( $details[0]['deciding_rule'] ) ) { 
  47. $deciding_rule = $details[0]['deciding_rule']; 
  48.  
  49. ob_start(); 
  50. $this->output_scripts(); 
  51. ?> 
  52. <div class="ms-sim-info <?php echo esc_attr( $toggle_state ); ?>"> 
  53. <div class="ms-sim-block"> 
  54. <h4 class="toggle-wrap"> 
  55. <?php _e( 'Simulation Overview', 'membership2' ); ?> 
  56. <span class="toggle"><i class="dashicons <?php echo esc_attr( $toggle_icon ); ?>"></i></span> 
  57. </h4> 
  58. <div class="ms-sim-body"> 
  59. <form id="view-site-as" method="POST" class="inside"> 
  60. <table cellspacing="0" cellpadding="0" width="100%" border="0"> 
  61. <tr> 
  62. <th><?php _e( 'View as', 'membership2' ); ?></th> 
  63. <td><?php MS_Helper_Html::html_element( $fields['membership_id'] ) ?></td> 
  64. </tr> 
  65. <?php if ( $this->data['datepicker'] ) : ?> 
  66. <tr> 
  67. <th><?php _e( 'View on', 'membership2' ); ?></th> 
  68. <td><?php MS_Helper_Html::html_element( $fields['simulate_date'] ) ?></td> 
  69. </tr> 
  70. <?php endif; ?> 
  71. <tr> 
  72. <th> </th> 
  73. <td><button class="button"><?php _e( 'Update', 'membership2' ); ?></button></td> 
  74. </tr> 
  75. </table> 
  76. <?php 
  77. MS_Helper_Html::html_element( $fields['action_field'] ); 
  78. MS_Helper_Html::html_element( $fields['nonce_field'] ); 
  79. ?> 
  80. </form> 
  81.  
  82. <h4 class="inside"> 
  83. <?php _e( 'Simulated Membership', 'membership2' ); ?> 
  84. </h4> 
  85. <table cellspacing="0" cellpadding="0" width="100%" border="0" class="inside"> 
  86. <tr> 
  87. <th><?php _e( 'Membership', 'membership2' ); ?></th> 
  88. <td style="white-space: nowrap"><?php echo esc_html( $mem->name ); ?></td> 
  89. </tr> 
  90. <tr> 
  91. <th><?php _e( 'Type', 'membership2' ); ?></th> 
  92. <td><?php echo esc_html( $mem->get_type_description() ); ?></td> 
  93. </tr> 
  94. <tr> 
  95. <th><?php _e( 'Start Date', 'membership2' ); ?></th> 
  96. <td><?php echo esc_html( $sim->start_date ); ?></td> 
  97. </tr> 
  98. <tr> 
  99. <th><?php _e( 'Expire Date', 'membership2' ); ?></th> 
  100. <td><?php echo esc_html( $sim->expire_date ); ?></td> 
  101. </tr> 
  102. <?php if ( $this->data['datepicker'] ) : ?> 
  103. <tr> 
  104. <th><?php _e( 'Simulated Date', 'membership2' ); ?></th> 
  105. <td><?php echo esc_html( MS_Helper_Period::current_date() ); ?></td> 
  106. </tr> 
  107. <?php endif; ?> 
  108. <tr> 
  109. <th><?php _e( 'Status', 'membership2' ); ?></th> 
  110. <td><?php 
  111. if ( MS_Model_Relationship::STATUS_ACTIVE == $sim->status ) { 
  112. $status_class = 'ms-sim-active'; 
  113. } else { 
  114. $status_class = 'ms-sim-inactive'; 
  115. printf( 
  116. '<span class="%1$s">%2$s</span>',  
  117. $status_class,  
  118. $sim->status 
  119. ); 
  120. ?></td> 
  121. </tr> 
  122. <tr> 
  123. <th><?php _e( 'Payment model', 'membership2' ); ?></th> 
  124. <td><?php echo esc_html( $pay_types[ $mem->payment_type ] ); ?></td> 
  125. </tr> 
  126. <tr> 
  127. <th><?php _e( 'Payment details', 'membership2' ); ?></th> 
  128. <td><?php echo esc_html( strip_tags( $sim->get_payment_description( null, true ) ) ); ?></td> 
  129. </tr> 
  130. </table> 
  131. </div> 
  132. <div class="ms-sim-footer"> 
  133. <div class="inside"> 
  134. <?php $this->output_deciding_info( $denied_url, $deciding_membership, $deciding_rule ); ?> 
  135. </div> 
  136. <?php MS_Helper_Html::html_element( $fields['exit_button'] ); ?> 
  137. </div> 
  138. </div> 
  139. </div> 
  140. <?php 
  141. $html = ob_get_clean(); 
  142.  
  143. return apply_filters( 
  144. 'ms_view_admin_bar_to_html',  
  145. $html,  
  146. $this 
  147. ); 
  148.  
  149. /** 
  150. * Prepare html fields. 
  151. * 
  152. * @since 1.0.0 
  153. * 
  154. * @return array 
  155. */ 
  156. public function prepare_fields() { 
  157. // The ID of the main system membership. 
  158. $base_id = MS_Model_Membership::get_base()->id; 
  159. $sorted_memberships = array(); 
  160. $memberships = MS_Model_Membership::get_memberships( 
  161. array( 'include_base' => 1 ) 
  162. ); 
  163.  
  164. foreach ( $memberships as $membership ) { 
  165. if ( $base_id == $membership->id ) { 
  166. $label = __( '- No membership / Visitor -', 'membership2' ); 
  167. } else { 
  168. $label = $membership->name; 
  169. if ( ! $membership->active ) { 
  170. $label .= ' ' . __( '(Inactive)', 'membership2' ); 
  171.  
  172. $sorted_memberships[ $membership->id ] = $label; 
  173. asort( $sorted_memberships ); 
  174.  
  175. $fields = array( 
  176. 'exit_button' => array( 
  177. 'type' => MS_Helper_Html::TYPE_HTML_LINK,  
  178. 'value' => __( 'Exit Test Mode', 'membership2' ),  
  179. 'url' => MS_Controller_Adminbar::get_simulation_exit_url(),  
  180. 'class' => 'button',  
  181. ),  
  182.  
  183. 'action_field' => array( 
  184. 'name' => 'action',  
  185. 'value' => 'ms_simulate',  
  186. 'type' => MS_Helper_Html::INPUT_TYPE_HIDDEN,  
  187. ),  
  188.  
  189. 'membership_id' => array( 
  190. 'id' => 'ab-membership-id',  
  191. 'name' => 'membership_id',  
  192. 'value' => $this->data['membership_id'],  
  193. 'type' => MS_Helper_Html::INPUT_TYPE_SELECT,  
  194. 'field_options' => $sorted_memberships,  
  195. ),  
  196.  
  197. 'nonce_field' => array( 
  198. 'id' => '_wpnonce',  
  199. 'value' => wp_create_nonce( 'ms_simulate' ),  
  200. 'type' => MS_Helper_Html::INPUT_TYPE_HIDDEN,  
  201. ),  
  202.  
  203. 'simulate_date' => array( 
  204. 'id' => 'simulate_date',  
  205. 'type' => MS_Helper_Html::INPUT_TYPE_DATEPICKER,  
  206. 'value' => $this->data['simulate_date'],  
  207. 'class' => 'ms-admin-bar-date ms-date',  
  208. ),  
  209.  
  210. 'simulate_submit' => array( 
  211. 'id' => 'simulate_submit',  
  212. 'type' => MS_Helper_Html::INPUT_TYPE_SUBMIT,  
  213. 'value' => __( 'Go', 'membership2' ),  
  214. 'class' => 'ms-admin-bar-submit',  
  215. ),  
  216. ); 
  217.  
  218. return apply_filters( 
  219. 'ms_view_admin_bar_prepare_fields',  
  220. $fields,  
  221. $this 
  222. ); 
  223.  
  224. /** 
  225. * Output details on which membership denied or allowed access to the 
  226. * current page 
  227. * 
  228. * @since 1.0.0 
  229. * @param string $denied_url URL of the denied page (empty if not denied) 
  230. * @param int $membership_id Membership_id 
  231. * @param array $rules List of Rule_types 
  232. */ 
  233. protected function output_deciding_info( $denied_url, $membership_id, $rules ) { 
  234. $membership = MS_Factory::load( 'MS_Model_Membership', $membership_id ); 
  235. $rule_title = MS_Model_Rule::get_rule_type_titles(); 
  236.  
  237. if ( ! empty( $denied_url ) ) { ?> 
  238. <div class="ms-sim-denied"> 
  239. <?php 
  240. printf( 
  241. __( 'Access denied by %s', 'membership2' ),  
  242. '<b>' . esc_html( $membership->name ) . '</b>' 
  243. ); 
  244. ?> 
  245. </div> 
  246. <ul class="ms-sim-rules"> 
  247. <?php 
  248. printf( 
  249. '<li><a href="%1$s">%1$s</a></li>',  
  250. $denied_url 
  251. ); 
  252. foreach ( $rules as $rule_type ) { 
  253. printf( 
  254. '<li><a href="%1$s" target="_blank">%3$s %2$s</a></li>',  
  255. MS_Controller_Plugin::get_admin_url( 
  256. 'protection',  
  257. array( 
  258. 'tab' => $rule_type,  
  259. 'membership_id' => $membership->id,  
  260. ),  
  261. $rule_title[$rule_type],  
  262. __( 'Denied by Rule:', 'membership2' ) 
  263. ); 
  264. ?> 
  265. <?php } elseif ( $membership->is_valid() ) { ?> 
  266. <div class="ms-sim-allowed"> 
  267. <?php 
  268. printf( 
  269. __( 'Access granted by %s', 'membership2' ),  
  270. '<b>' . esc_html( $membership->name ) . '</b>' 
  271. ); 
  272. ?> 
  273. </div> 
  274. <ul class="ms-sim-rules"> 
  275. <?php 
  276. foreach ( $rules as $rule_type ) { 
  277. printf( 
  278. '<li><a href="%1$s" target="_blank">%3$s %2$s</a></li>',  
  279. MS_Controller_Plugin::get_admin_url( 
  280. 'protection',  
  281. array( 
  282. 'tab' => $rule_type,  
  283. 'membership_id' => $membership->id,  
  284. ),  
  285. $rule_title[$rule_type],  
  286. __( 'Allowed by Rule:', 'membership2' ) 
  287. ); 
  288. ?> 
  289. </ul> 
  290. <?php } else { ?> 
  291. <div class="ms-sim-public"> 
  292. <?php _e( 'Unprotected', 'membership2' ); ?> 
  293. </div> 
  294. <?php 
  295.  
  296. /** 
  297. * Output the JS and CSS needed for simulation infos 
  298. * 
  299. * @since 1.0.0 
  300. */ 
  301. protected function output_scripts() { 
  302. ?> 
  303. <style> 
  304. .ms-sim-info { 
  305. position: fixed; 
  306. top: 40px; 
  307. right: 10px; 
  308. border: 1px solid rgba( 224, 102, 102, 0.5 ); 
  309. box-shadow: 0 1px 2px rgba(128, 0, 0, 0.15); 
  310. padding: 0; 
  311. font: 13px sans-serif; 
  312. width: 360px; 
  313. z-index: 999999; 
  314. overflow: auto; 
  315. bottom: 20px; 
  316. opacity: 0.8; 
  317. .ms-sim-info:hover { 
  318. border-color: #E06666; 
  319. opacity: 1; 
  320. .ms-sim-info:hover .ms-sim-block { 
  321. opacity: 1; 
  322. background: #FCE0E0; 
  323. .ms-sim-info .ms-sim-block { 
  324. background: #FFF; 
  325. opacity: 0.4; 
  326. min-height: 100%; 
  327. padding: 45px 10px 10px; 
  328. box-sizing: border-box; 
  329. .ms-sim-info select,  
  330. .ms-sim-info input { 
  331. font-size: 13px; 
  332. margin: 0; 
  333. line-height: 20px; 
  334. padding: 2px 10px; 
  335. height: 26px; 
  336. border: 1px solid #CCC; 
  337. background: #FFF; 
  338. color: #444; 
  339. border-radius: 0; 
  340. font-family: sans-serif; 
  341. box-sizing: border-box; 
  342. vertical-align: middle; 
  343. .ms-sim-info h4 { 
  344. padding: 0; 
  345. margin: -10px -10px 10px -10px; 
  346. border-bottom: 1px solid rgba(0, 0, 0, 0.2); 
  347. background: #FFF; 
  348. color: #C00; 
  349. text-align: center; 
  350. font-weight: bold; 
  351. height: 34px; 
  352. line-height: 34px; 
  353. position: relative; 
  354. .ms-sim-info h4.toggle-wrap { 
  355. cursor: pointer; 
  356. position: fixed; 
  357. top: 40px; 
  358. right: 10px; 
  359. width: 360px; 
  360. margin: 0; 
  361. z-index: 10; 
  362. .ms-sim-info h4 .toggle { 
  363. position: absolute; 
  364. right: 0; 
  365. top: 0; 
  366. bottom: 0; 
  367. width: 34px; 
  368. color: #AAA; 
  369. .ms-sim-info h4 .toggle .dashicons { 
  370. margin: 7px; 
  371. .ms-sim-info h4.inside { 
  372. border-top: 1px solid #E06666; 
  373. margin-top: 0; 
  374. background: rgba(255, 255, 255, 0.75); 
  375. .ms-sim-info.collapsed { 
  376. bottom: auto; 
  377. .ms-sim-info.collapsed .inside { 
  378. display: none; 
  379. .ms-sim-info table { 
  380. margin: 0 0 20px 0; 
  381. padding: 0; 
  382. border: 0; 
  383. .ms-sim-info td,  
  384. .ms-sim-info th { 
  385. padding: 5px; 
  386. border: 0; 
  387. background: transparent; 
  388. text-align: left; 
  389. .ms-sim-info th { 
  390. width: 40%; 
  391. .ms-sim-info td { 
  392. width: 60%; 
  393. .ms-sim-info table tr:nth-child(odd) td,  
  394. .ms-sim-info table tr:nth-child(odd) th { 
  395. background: rgba(0, 0, 0, 0.05); 
  396. .ms-sim-info .button { 
  397. display: inline-block; 
  398. text-decoration: none; 
  399. font-size: 13px; 
  400. line-height: 28px; 
  401. height: 28px; 
  402. margin: 0; 
  403. padding: 0 10px 1px; 
  404. cursor: pointer; 
  405. border-width: 1px; 
  406. border-style: solid; 
  407. -webkit-appearance: none; 
  408. -webkit-border-radius: 3px; 
  409. border-radius: 3px; 
  410. white-space: nowrap; 
  411. -webkit-box-sizing: border-box; 
  412. -moz-box-sizing: border-box; 
  413. box-sizing: border-box; 
  414. box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba( 0, 0, 0, 0.08 ); 
  415. vertical-align: top; 
  416. background: #fafafa; 
  417. border-color: #999; 
  418. color: #222; 
  419. .ms-sim-info .ms-sim-public,  
  420. .ms-sim-info .ms-sim-denied,  
  421. .ms-sim-info .ms-sim-allowed { 
  422. padding: 5px; 
  423. color: #FFF; 
  424. text-align: center; 
  425. background: rgba(0, 128, 0, 0.4); 
  426. margin-bottom: 5px; 
  427. .ms-sim-info .ms-sim-denied { 
  428. background: #C33; 
  429. .ms-sim-info .ms-sim-active { 
  430. color: #060; 
  431. .ms-sim-info .ms-sim-inactive { 
  432. color: #F00; 
  433. font-weight: bold; 
  434. .ms-sim-info .ms-sim-rules { 
  435. margin: 0 0 20px 0; 
  436. padding: 0; 
  437. list-style: none; 
  438. .ms-sim-info .ms-sim-rules li { 
  439. padding: 3px 10px; 
  440. margin: 0; 
  441. display: block; 
  442.  
  443. .ui-datepicker { 
  444. width: 17em; 
  445. padding: .2em .2em 0; 
  446. display: none; 
  447. .ui-datepicker .ui-datepicker-header { 
  448. position: relative; 
  449. padding: .2em 0; 
  450. .ui-datepicker .ui-datepicker-prev,  
  451. .ui-datepicker .ui-datepicker-next { 
  452. position: absolute; 
  453. top: 2px; 
  454. width: 1.8em; 
  455. height: 1.8em; 
  456. .ui-datepicker .ui-datepicker-prev-hover,  
  457. .ui-datepicker .ui-datepicker-next-hover { 
  458. top: 1px; 
  459. .ui-datepicker .ui-datepicker-prev { 
  460. left: 2px; 
  461. .ui-datepicker .ui-datepicker-next { 
  462. right: 2px; 
  463. .ui-datepicker .ui-datepicker-prev-hover { 
  464. left: 1px; 
  465. .ui-datepicker .ui-datepicker-next-hover { 
  466. right: 1px; 
  467. .ui-datepicker .ui-datepicker-title { 
  468. margin: 0 2.3em; 
  469. line-height: 1.8em; 
  470. text-align: center; 
  471. .ui-datepicker .ui-datepicker-title select { 
  472. font-size: 1em; 
  473. margin: 1px 0; 
  474. .ui-datepicker select.ui-datepicker-month,  
  475. .ui-datepicker select.ui-datepicker-year { 
  476. width: 49%; 
  477. .ui-datepicker table { 
  478. width: 100%; 
  479. font-size: .9em; 
  480. border-collapse: collapse; 
  481. margin: 0 0 .4em; 
  482. .ui-datepicker th { 
  483. padding: .7em .3em; 
  484. text-align: center; 
  485. font-weight: bold; 
  486. border: 0; 
  487. .ui-datepicker td { 
  488. border: 0; 
  489. padding: 1px; 
  490. .ui-datepicker td span,  
  491. .ui-datepicker td a { 
  492. display: block; 
  493. padding: .2em; 
  494. text-align: right; 
  495. text-decoration: none; 
  496. .ui-datepicker .ui-datepicker-buttonpane { 
  497. background-image: none; 
  498. margin: .7em 0 0 0; 
  499. padding: 0 .2em; 
  500. border-left: 0; 
  501. border-right: 0; 
  502. border-bottom: 0; 
  503. .ui-datepicker .ui-datepicker-buttonpane button { 
  504. float: right; 
  505. margin: .5em .2em .4em; 
  506. cursor: pointer; 
  507. padding: .2em .6em .3em .6em; 
  508. width: auto; 
  509. overflow: visible; 
  510. .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { 
  511. float: left; 
  512. .wpmui-datepicker-wrapper { 
  513. display: inline-block; 
  514. position: relative; 
  515. .wpmui-datepicker-wrapper .wpmui-icon { 
  516. position: absolute; 
  517. right: 0; 
  518. top: 0; 
  519. height: 28px; 
  520. width: 21px; 
  521. line-height: 28px; 
  522. text-align: left; 
  523. opacity: .5; 
  524. cursor: pointer; 
  525. color: #444; 
  526. .ui-datepicker.wpmui-datepicker { 
  527. padding: 0; 
  528. border: none; 
  529. background: transparent; 
  530. z-index: 20; 
  531. width: 250px; 
  532. .ui-datepicker.wpmui-datepicker .ui-datepicker-header,  
  533. .ui-datepicker.wpmui-datepicker.ui-corner-all { 
  534. border-radius: 0; 
  535. .ui-datepicker.wpmui-datepicker .ui-datepicker-prev,  
  536. .ui-datepicker.wpmui-datepicker .ui-datepicker-prev.ui-state-hover,  
  537. .ui-datepicker.wpmui-datepicker .ui-datepicker-next,  
  538. .ui-datepicker.wpmui-datepicker .ui-datepicker-next.ui-state-hover,  
  539. .ui-datepicker.wpmui-datepicker .ui-datepicker-title { 
  540. line-height: 2.5em; 
  541. height: 2.5em; 
  542. padding: 0; 
  543. border: 0; 
  544. background: transparent; 
  545. .ui-datepicker.wpmui-datepicker .ui-datepicker-prev.ui-datepicker-prev-hover { 
  546. top: 2px; 
  547. left: 2px; 
  548. .ui-datepicker.wpmui-datepicker .ui-datepicker-next.ui-datepicker-next-hover { 
  549. top: 2px; 
  550. right: 2px; 
  551. .ui-datepicker .ui-datepicker-prev span,  
  552. .ui-datepicker .ui-datepicker-next span { 
  553. display: block; 
  554. position: absolute; 
  555. left: 50%; 
  556. margin-left: -8px; 
  557. top: 50%; 
  558. margin-top: -8px; 
  559. .ui-icon-circle-triangle-e { 
  560. background-position: -48px -192px; 
  561. .ui-icon-circle-triangle-w { 
  562. background-position: -80px -192px; 
  563. .ui-datepicker.wpmui-datepicker .ui-icon { 
  564. width: 16px; 
  565. height: 16px; 
  566. text-indent: -99999px; 
  567. overflow: hidden; 
  568. background-repeat: no-repeat; 
  569. background-image: url(<?php echo MS_Plugin::instance()->url; ?>/app/assets/images/ui-icons-white.png); 
  570. cursor: pointer; 
  571. .ui-datepicker.wpmui-datepicker .ui-datepicker-header { 
  572. border: none; 
  573. background: #4F83AA; 
  574. color: #FFFFFF; 
  575. font-size: 0.9em; 
  576. font-weight: normal; 
  577. .ui-datepicker.wpmui-datepicker .ui-datepicker-calendar tbody td a,  
  578. .ui-datepicker.wpmui-datepicker td span,  
  579. .ui-datepicker.wpmui-datepicker td a { 
  580. padding: 8px; 
  581. text-align: center; 
  582. text-decoration: none; 
  583. .ui-datepicker.wpmui-datepicker .ui-datepicker-calendar { 
  584. padding: 0; 
  585. background: #375D7A; 
  586. width: 250px; 
  587. .ui-datepicker.wpmui-datepicker .ui-datepicker-calendar thead th { 
  588. padding: 3px 5px; 
  589. font-size: 0.75em; 
  590. font-weight: normal; 
  591. color: #FFFFFF; 
  592. .ui-datepicker.wpmui-datepicker .ui-datepicker-calendar tbody .ui-state-default,  
  593. .ui-datepicker.wpmui-datepicker .ui-datepicker-calendar tbody .ui-widget-content .ui-state-default,  
  594. .ui-datepicker.wpmui-datepicker .ui-datepicker-calendar tbody .ui-widget-header .ui-state-default { 
  595. border: 0; 
  596. background: #223D52; 
  597. color: #FFFFFF; 
  598. .ui-datepicker.wpmui-datepicker .ui-datepicker-calendar tbody .ui-state-active,  
  599. .ui-datepicker.wpmui-datepicker .ui-datepicker-calendar tbody .ui-widget-content .ui-state-active,  
  600. .ui-datepicker.wpmui-datepicker .ui-datepicker-calendar tbody .ui-widget-header .ui-state-active,  
  601. .ui-datepicker.wpmui-datepicker .ui-datepicker-calendar tbody .ui-state-hover,  
  602. .ui-datepicker.wpmui-datepicker .ui-datepicker-calendar tbody .ui-widget-content .ui-state-hover,  
  603. .ui-datepicker.wpmui-datepicker .ui-datepicker-calendar tbody .ui-widget-header .ui-state-hover { 
  604. background: #4F83AA; 
  605. .wpmui-datepicker { 
  606. z-index: 1000000 !important; 
  607. </style> 
  608. <script> 
  609. jQuery(function() { 
  610. jQuery( '.ms-sim-info .toggle-wrap' ).click(function() { 
  611. var el = jQuery( this ); 
  612. el.find( '.dashicons' ).toggleClass( 'dashicons-arrow-up dashicons-arrow-down' ); 
  613. el.closest( '.ms-sim-info' ).toggleClass( 'collapsed' ); 
  614. }); 
  615. }); 
  616. </script> 
  617. <?php 
.