WYSIJA_control_back

The MailPoet Newsletters WYSIJA control back class.

Defined (1)

The class is defined in the following location(s).

/controllers/back.php  
  1. class WYSIJA_control_back extends WYSIJA_control{ 
  2. var $redirectAfterSave=true; 
  3. var $searchable=array(); 
  4. var $data=array(); 
  5. var $jsTrans=array(); 
  6. var $msgOnSave=true; 
  7. var $pref=array(); 
  8. var $statuses=array(); 
  9. var $viewShow=null; 
  10. var $_affected_rows = 0; //affected rows by batch select 
  11.  
  12. function __construct($extension="wysija-newsletters") { 
  13. $this->extension=$extension; 
  14. parent::__construct(); 
  15. global $wysija_msg, $wysija_queries, $wysija_queries_errors; 
  16. $wysija_msgTemp=get_option('wysija_msg'); 
  17.  
  18. if(is_array($wysija_msgTemp) && count($wysija_msgTemp)>0) { 
  19. $wysija_msg=$wysija_msgTemp; 
  20.  
  21. $wysija_qryTemp=get_option('wysija_queries'); 
  22. $wysija_qryErrors=get_option('wysija_queries_errors'); 
  23. if(is_array($wysija_qryTemp) && count($wysija_qryTemp)>0) { 
  24. $wysija_queries=$wysija_qryTemp; 
  25.  
  26. if(is_array($wysija_qryErrors) && count($wysija_qryErrors)>0) { 
  27. $wysija_queries_errors=$wysija_qryErrors; 
  28.  
  29. WYSIJA::update_option('wysija_queries', ''); 
  30. WYSIJA::update_option('wysija_queries_errors', ''); 
  31. WYSIJA::update_option('wysija_msg', ''); 
  32. global $wysija_installing; 
  33. if($wysija_installing===true) return; 
  34. $this->pref=get_user_meta(WYSIJA::wp_get_userdata('ID'), 'wysija_pref', true); 
  35.  
  36. $prefupdate=false; 
  37. if($this->pref) { 
  38. $prefupdate=true; 
  39. $this->pref=unserialize(base64_decode($this->pref)); 
  40. }else{ 
  41. $this->pref=array(); 
  42.  
  43. if(!isset($_GET['action'])) $action='default'; 
  44. else $action=$_GET['action']; 
  45.  
  46. if(isset($_REQUEST['limit_pp'])) { 
  47. $this->pref[$_REQUEST['page']][$action]['limit_pp']=$_REQUEST['limit_pp']; 
  48.  
  49. if (!empty($_REQUEST['orderby'])) { 
  50. $_REQUEST['orderby'] = preg_replace('|[^a-z0-9#_.-]|i', '', $_REQUEST['orderby']); 
  51. if (!empty($_REQUEST['ordert']) && !in_array(strtoupper($_REQUEST['ordert']), array('DESC', 'ASC'))) { 
  52. $_REQUEST['ordert'] = 'DESC'; 
  53.  
  54. if(!empty($_REQUEST['id'])) { 
  55. $_REQUEST['id'] = (int) $_REQUEST['id']; 
  56.  
  57. if(!empty($_REQUEST['search'])) { 
  58. $_REQUEST['search'] = esc_attr($_REQUEST['search']); 
  59.  
  60. if($this->pref && isset($_REQUEST['page']) && $_REQUEST['page'] && isset($this->pref[$_REQUEST['page']][$action]['limit_pp'])) { 
  61. $this->viewObj->limit_pp=$this->pref[$_REQUEST['page']][$action]['limit_pp']; 
  62. $this->modelObj->limit_pp=$this->pref[$_REQUEST['page']][$action]['limit_pp']; 
  63.  
  64. if($prefupdate) { 
  65. update_user_meta(WYSIJA::wp_get_userdata('ID'), 'wysija_pref', base64_encode(serialize($this->pref))); 
  66. }else{ 
  67. add_user_meta(WYSIJA::wp_get_userdata('ID'), 'wysija_pref', base64_encode(serialize($this->pref))); 
  68. add_action('wysija_various_check', array($this, 'variousCheck')); 
  69. do_action('wysija_various_check'); 
  70.  
  71.  
  72. function variousCheck() { 
  73. $model_config = WYSIJA::get('config', 'model'); 
  74.  
  75. if(get_option('wysicheck')) { 
  76. $helper_licence = WYSIJA::get('licence', 'helper'); 
  77. $result = $helper_licence->check(true); 
  78. if($result['nocontact']) { 
  79. // redirect instantly to a page with a javascript file where we check the domain is ok 
  80. $data = get_option('wysijey'); 
  81. // remotely connect to host 
  82. wp_enqueue_script('wysija-verif-licence', 'http://www.mailpoet.com/?wysijap=checkout&wysijashop-page=1&controller=customer&action=checkDomain&js=1&data='.$data, array( 'jquery' ), time()); 
  83.  
  84.  
  85.  
  86. function errorInstall() { 
  87. $this->viewObj->renderErrorInstall(); 
  88.  
  89. function _resetGlobMsg() { 
  90. global $wysija_msg, $wysija_queries, $wysija_queries_errors; 
  91.  
  92. $wysija_msg=$wysija_queries=$wysija_queries_errors=array(); 
  93. function defaultDisplay() { 
  94. $this->viewShow=$this->action='main'; 
  95.  
  96. // if it has not been enqueud in the head we print it here(can happens based on the action after a save or so) 
  97. $this->js[]='wysija-admin-list'; 
  98.  
  99. // get the filters 
  100. if(isset($_REQUEST['search']) && $_REQUEST['search']) { 
  101. $this->filters['like']=array(); 
  102. foreach($this->searchable as $searchable) { 
  103. $this->filters['like'][$searchable]=$_REQUEST['search']; 
  104.  
  105.  
  106. if($this->filters) { 
  107. $this->modelObj->setConditions($this->filters); 
  108.  
  109. if($this->joins) { 
  110. $this->modelObj->setJoin($this->joins); 
  111.  
  112. if($this->statuses) { 
  113. //we count by statuses 
  114. $query='SELECT count('.$this->modelObj->pk.') as count, status FROM `[wysija]'.$this->modelObj->table_name.'` GROUP BY status'; 
  115. $countss=$this->modelObj->query('get_res', $query, ARRAY_A); 
  116. $counts=array(); 
  117. $this->modelObj->countRows=0; 
  118.  
  119. foreach($countss as $count) { 
  120. $mystat=(int)$count['status']; 
  121.  
  122. $this->statuses[$mystat]['count']=$count['count']; 
  123. $this->statuses[$mystat]['uri']=$this->getDefaultUrl(false).'&link_filter='.$this->statuses[$mystat]['key']; 
  124.  
  125. $this->modelObj->countRows=$this->modelObj->countRows+$count['count']; 
  126. $this->viewObj->statuses=$this->statuses; 
  127.  
  128. }else{ 
  129. $this->modelObj->countRows=$this->modelObj->count(); 
  130.  
  131.  
  132.  
  133.  
  134. if(isset($_REQUEST['orderby'])) { 
  135. $this->modelObj->orderBy($_REQUEST['orderby'], strtoupper($_REQUEST['ordert'])); 
  136. }else{ 
  137. $this->modelObj->orderBy($this->modelObj->getPk(), 'DESC'); 
  138. $this->modelObj->limitON=true; 
  139.  
  140. $data=$this->modelObj->getRows($this->list_columns); 
  141.  
  142. $methodDefaultData='defaultData'; 
  143. if(method_exists($this, $methodDefaultData )) { 
  144. $this->$methodDefaultData($data); 
  145.  
  146.  
  147. function defaultData($data) { 
  148. $this->data=$data; 
  149.  
  150.  
  151. function render() { 
  152.  
  153. $this->viewObj->render($this->viewShow, $this->data); 
  154.  
  155. /** 
  156. * by default this is the first method called from a controller this is from where we route to other methods 
  157. */ 
  158. function main() { 
  159. $this->__construct(); 
  160. if($this->model) { 
  161. if(isset($_REQUEST['action'])) $action=$_REQUEST['action']; 
  162. else $action='defaultDisplay'; 
  163. if(!$action) $action='defaultDisplay'; 
  164.  
  165. if($action) { 
  166. $this->_tryAction($action); 
  167. }else{ 
  168. $this->error('No Model is linked to this controller : '. get_class($this)); 
  169. return false; 
  170.  
  171. return true; 
  172.  
  173. function __setMetaTitle() { 
  174. global $title; 
  175.  
  176. if(isset($this->title))$title=$this->title; 
  177. else $title=$this->viewObj->title; 
  178.  
  179. function _tryAction($action) { 
  180. $action=strip_tags($action); 
  181. $_REQUEST = stripslashes_deep($_REQUEST); 
  182. $_POST = stripslashes_deep($_POST); 
  183.  
  184. $is_batch_select = $this->_batchSelect(); 
  185. $this->_affected_rows = $is_batch_select ? $this->_batch_select['count'] : (!empty($_REQUEST['wysija']['user']['user_id']) ? count($_REQUEST['wysija']['user']['user_id']) : 0); 
  186. if(method_exists($this, $action)) { 
  187. /** in some bulk actions we need to specify the action name and one or few variables*/ 
  188. $this->action=$action; 
  189. $this->viewShow=$this->action; 
  190. if(!$this->viewShow) $this->viewShow='defaultDisplay'; 
  191.  
  192. if(strpos($action, 'bulk_')===false)$this->$action(); 
  193. else { 
  194. $this->$action($_REQUEST['wysija'][$this->model][$this->modelObj->pk]); 
  195.  
  196. $this->__setMetaTitle(); 
  197. }else{ 
  198. /** in some bulk actions we need to specify the action name and one or few variables*/ 
  199. if(strpos($action, 'actionvar_')!== false) { 
  200. $data=explode('-', $action); 
  201. $datas=array(); 
  202.  
  203. foreach($data as $dt) { 
  204. $res=explode('_', $dt); 
  205. $datas[$res[0]]=$res[1]; 
  206.  
  207. $action =$datas['actionvar']; 
  208. unset($datas['actionvar']); 
  209. $this->action=$action; 
  210.  
  211. if(method_exists($this, $this->action)) { 
  212. $this->viewShow=$this->action; 
  213. $this->$action($datas); 
  214. $this->__setMetaTitle(); 
  215.  
  216. }else{ 
  217. $this->error("Action '".$action."' does not exist in controller : ". get_class($this)); 
  218. $this->redirect(); 
  219. }else{ 
  220. $this->error("Action '".$action."' does not exist in controller : ". get_class($this)); 
  221. $this->redirect(); 
  222. //$this->defaultDisplay(); 
  223.  
  224.  
  225. if(defined('WYSIJA_REDIRECT')) $this->redirectProcess(); 
  226.  
  227. if( !empty( $_REQUEST['page'] ) && $_REQUEST['page'] !== 'wysija_premium') { 
  228. $this->checkTotalSubscribers(); 
  229.  
  230.  
  231. function checkTotalSubscribers() { 
  232. add_action('wysija_check_total_subscribers', array($this, '_checkTotalSubscribers')); 
  233. do_action('wysija_remove_action_check_total_subscribers'); 
  234. do_action('wysija_check_total_subscribers'); 
  235.  
  236. /** 
  237. * Batch select process 
  238. * - Currently, is for subscribers only 
  239. * - Get all matched subscribers and override to $_REQUEST['wysija']['user']['user_id'] 
  240. */ 
  241. function _batchSelect() { 
  242. if(empty($_REQUEST['wysija']['user']['force_select_all'])) 
  243. return FALSE; 
  244. if (!(bool)$_REQUEST['wysija']['user']['force_select_all']) 
  245. return FALSE; 
  246. if(empty($_REQUEST['wysija']['user']['timestamp'])) 
  247. return FALSE; 
  248. //$_POST['wysija']['filter'] = array( 
  249. // link_filter => '', //[subscribed, unsubscribed, unsubscribed, all] 
  250. // filter_list => int 
  251. //); 
  252. // 
  253. //$_POST['wysija']['user']['timestamp'] = int 
  254. // 
  255. //select all users which match to $_POST['wysija']['filter'] and create_at <= $_POST['wysija']['user']['timestamp'] 
  256. // - build query 
  257.  
  258. $select = array( '[wysija]user.user_id'); 
  259.  
  260. // filters for unsubscribed 
  261. $filters = $this->modelObj->detect_filters(); 
  262.  
  263.  
  264. $this->_batch_select = array(); 
  265.  
  266.  
  267. $this->_batch_select['query'] = $this->modelObj->get_subscribers( $select, $filters, '', true ); 
  268. $this->_batch_select['query_count'] = $this->modelObj->get_subscribers( array( 'COUNT(DISTINCT([wysija]user.user_id))'), $filters, '', true ); 
  269.  
  270.  
  271. //Create a temporary table 
  272. $temp_table_name = '[wysija]user'. time(); 
  273. $temp_table_create = 'CREATE TEMPORARY TABLE IF NOT EXISTS '.$temp_table_name . ' (user_id int (10) NOT NULL, PRIMARY KEY (user_id))'; 
  274. $temp_table_insert = 'INSERT IGNORE INTO '.$temp_table_name.' ' . $this->_batch_select['query']; 
  275. $model_user = WYSIJA::get('user', 'model'); 
  276.  
  277. $model_user->query($temp_table_create); 
  278. $model_user->query($temp_table_insert); 
  279.  
  280. //Override the queres with temporary table 
  281. unset($this->_batch_select['where']); 
  282. $row_count = $model_user->query('get_row', 'SELECT COUNT(*) as row_count FROM '.$temp_table_name); 
  283. $this->_batch_select['original_query'] = $this->_batch_select['query']; // useful for export feature; in this case, we don't use temporary table 
  284. $this->_batch_select['select'] = 'SELECT DISTINCT user_id'; 
  285. $this->_batch_select['from'] = 'FROM '.$temp_table_name . ' A'; 
  286. $this->_batch_select['query'] = 'SELECT user_id FROM '.$temp_table_name; 
  287. $this->_batch_select['count'] = $row_count['row_count']; 
  288. return true; 
  289.  
  290.  
  291.  
  292. function _checkTotalSubscribers() { 
  293.  
  294. $config=WYSIJA::get('config', 'model'); 
  295. $totalSubscribers=$config->getValue('total_subscribers'); 
  296. $helper_licence = WYSIJA::get('licence', 'helper'); 
  297.  
  298. if((int)$totalSubscribers>1900) { 
  299. if((int)$totalSubscribers>2000) { 
  300.  
  301. $url_checkout = $helper_licence->get_url_checkout('over200'); 
  302. $this->error(str_replace(array('[link]', '[/link]'),  
  303. array('<a title="'.__('Get Premium now', WYSIJA).'" target="_blank" href="'.$url_checkout.'">', '</a>'),  
  304. sprintf(__('Yikes. You\'re over the limit of 2000 subscribers for the free version of MailPoet (%1$s in total). Sending is disabled now. Please upgrade your version to [link]premium[/link] to send without limits.', WYSIJA) 
  305. , $totalSubscribers)), true); 
  306.  
  307. }else{ 
  308. $url_checkout = $helper_licence->get_url_checkout('near200'); 
  309. $this->notice(str_replace(array('[link]', '[/link]'),  
  310. array('<a title="'.__('Get Premium now', WYSIJA).'" target="_blank" href="'.$url_checkout.'">', '</a>'),  
  311. sprintf(__('Yikes! You\'re near the limit of %1$s subscribers for MailPoet\'s free version. Upgrade to [link]Premium[/link] to send without limits, and more.', WYSIJA) 
  312. , "2000"))); 
  313.  
  314. function edit($id=false) { 
  315.  
  316. if(isset($_REQUEST['id']) || $id) { 
  317. if(!$id) $id=$_REQUEST['id']; 
  318. $this->data[$this->modelObj->table_name]=$this->modelObj->getOne($this->form_columns, array($this->modelObj->pk=>$id)); 
  319. }else{ 
  320. $this->error('Cannot edit element primary key is missing : '. get_class($this)); 
  321.  
  322.  
  323. function view($id=false) { 
  324.  
  325. if(isset($_REQUEST['id']) || $id) { 
  326. if(!$id) $id=$_REQUEST['id']; 
  327. $this->data[$this->modelObj->table_name]=$this->modelObj->getOne($this->form_columns, array($this->modelObj->pk=>$id)); 
  328.  
  329. }else{ 
  330. $this->error('Cannot view element primary key is missing : '. get_class($this)); 
  331.  
  332.  
  333. function add($dataPost=false) { 
  334.  
  335. if(!$dataPost) { 
  336. $data=array(); 
  337. foreach($this->form_columns as $key) { 
  338. $data[$key]=''; 
  339. }else{ 
  340.  
  341. $data=array(); 
  342. foreach($this->form_columns as $key) { 
  343. if($key != $this->viewObj->model->pk) $data[$key]=$dataPost[$key]; 
  344. $data[$this->viewObj->model->pk]=''; 
  345.  
  346.  
  347. function save() { 
  348. $this->requireSecurity(); 
  349. //see if it's an update or an insert 
  350. //get the pk and its value as a conditions where pk = pkval 
  351. $conditions=$this->getPKVal($this->modelObj); 
  352.  
  353. if($conditions) { 
  354. //this an update 
  355.  
  356. $result=$this->modelObj->update($_POST['wysija'][$this->model], $conditions); 
  357.  
  358. if($this->msgOnSave) { 
  359.  
  360. // Create the update success message and add edit again link. 
  361. $update_success = str_replace(array('[link]', '[/link]'), array('<a href="admin.php?page=wysija_subscribers&action=edit&id='.$result.'" >', "</a>"), $this->messages['update'][true]); 
  362.  
  363. if ($result) { 
  364. $this->notice($update_success); 
  365. } else { 
  366. if($result==0) { 
  367.  
  368. }else{ 
  369. $this->error($this->messages['update'][false], true); 
  370.  
  371.  
  372.  
  373. if($this->redirectAfterSave) { 
  374. if(isset($this->modelObj->stay)) { 
  375. $this->action='edit'; 
  376. $this->redirect(); 
  377. }else{ 
  378. $this->action='edit'; 
  379. $this->redirect(); 
  380.  
  381. }else{ 
  382. //this is an insert 
  383. unset($_POST['wysija'][$this->model][$this->modelObj->pk]); 
  384. $result=$this->modelObj->insert($_POST['wysija'][$this->model]); 
  385.  
  386. if($this->msgOnSave) { 
  387. if($result) $this->notice($this->messages['insert'][true]); 
  388. else{ 
  389. $this->error($this->messages['insert'][false], true); 
  390.  
  391.  
  392. if($this->redirectAfterSave) { 
  393. if(isset($this->modelObj->stay)) { 
  394. $this->action='add'; 
  395. $this->add($_POST['wysija'][$this->model]); 
  396. }else{ 
  397. $this->action='main'; 
  398. $this->redirect(); 
  399.  
  400.  
  401. //now we redirect to the edit page with the data in it 
  402. return $result; 
  403.  
  404. function bulk_delete($ids) { 
  405. $this->requireSecurity(); 
  406. foreach($ids as $id) { 
  407.  
  408. $conditions=$this->getPKVal($this->modelObj); 
  409. if(!$conditions) $this->error('Cannot obtain PKVal from GET or POST.'); 
  410.  
  411. $result=$this->modelObj->delete($conditions); 
  412. $this->modelObj->reset(); 
  413. $this->notice(__('Elements deleted', WYSIJA)); 
  414. $this->redirect(); 
  415.  
  416. function delete() { 
  417. // see if it's an update or an insert 
  418. $this->requireSecurity(); 
  419. $conditions=$this->getPKVal($this->modelObj); 
  420. if(!$conditions) $this->error('Cannot obtain PKVal from GET or POST.'); 
  421.  
  422. $result=$this->modelObj->delete($conditions); 
  423. if($result) { 
  424. $this->notice(__('Element has been deleted.', WYSIJA)); 
  425.  
  426.  
  427. $this->modelObj->reset(); 
  428. //now we redirect to the edit page with the data in it 
  429. $this->action='main'; 
  430. $this->redirect(); 
  431.  
  432. function redirect($location=false) { 
  433. global $wysi_location; 
  434. define('WYSIJA_REDIRECT', true); 
  435. if($location) 
  436. $url = parse_url($location); 
  437. if(!empty($url['query'])) { 
  438. $location .= '&'; 
  439. } else { 
  440. $location .= '?'; 
  441.  
  442. $location .= 'redirect=1'; 
  443. $wysi_location=$location; 
  444.  
  445. function redirectProcess() { 
  446. global $wysi_location; 
  447.  
  448. if(!$wysi_location) { 
  449. $wysi_location=$this->getDefaultUrl(); 
  450. WYSIJA::redirect($wysi_location); 
  451.  
  452.  
  453. function popupReturn($viewFunc) { 
  454. return wp_iframe( array($this->viewObj, 'popup_'.$viewFunc), $this->data); 
  455.  
  456. function _addTab($defaulttab) { 
  457. return $this->iframeTabs; 
  458.  
  459. function popupContent() { 
  460. // remove auth check 
  461. remove_action('admin_enqueue_scripts', 'wp_auth_check_load'); 
  462.  
  463. // add popup css 
  464. wp_enqueue_style('custom_popup_css', WYSIJA_URL.'css/adminPopup.css', array(), WYSIJA::get_version(), 'screen'); 
  465.  
  466. global $viewMedia; 
  467. $viewMedia=$this->viewObj; 
  468. $_GET['type']=$_REQUEST['type']='image'; 
  469.  
  470. $config=WYSIJA::get('config', 'model'); 
  471. $_GET['post_id']=$_REQUEST['post_id']=$config->getValue('confirm_email_link'); 
  472. $post_id = isset($_GET['post_id'])? (int) $_GET['post_id'] : 0; 
  473. if(file_exists(ABSPATH.'wp-admin'.DS.'admin.php')) require_once(ABSPATH.'wp-admin'.DS.'admin.php'); 
  474.  
  475. @header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); 
  476.  
  477. add_filter('media_upload_tabs', array($this, '_addTab')); 
  478.  
  479. if(!isset($this->iframeTabs)) { 
  480.  
  481.  
  482. //if wp version includes plupload then let's use it 
  483. if(version_compare(get_bloginfo('version'), '3.3.0')>= 0) { 
  484. $this->iframeTabs=array( 
  485. 'special_new_wordp_upload'=>__('Upload', WYSIJA)); 
  486. }else{ 
  487. $this->iframeTabs=array( 
  488. 'special_wordp_upload'=>__('Upload', WYSIJA)); 
  489.  
  490. $this->iframeTabs['special_wysija_browse']=__('Newsletter Images', WYSIJA); 
  491. $this->iframeTabs['special_wordp_browse']=__('WordPress Posts\' Images', WYSIJA); 
  492.  
  493. foreach($this->iframeTabs as $actionKey =>$actionTitle) 
  494. add_action('media_upload_'.$actionKey, array($this, $actionKey)); 
  495. }else add_action('media_upload_standard', array($this, 'popupReturn')); 
  496.  
  497. // upload type: image, video, file, ..? 
  498. if ( isset($_GET['type']) ) 
  499. $type = strval($_GET['type']); 
  500. else 
  501. $type = apply_filters('media_upload_default_type', 'file'); 
  502.  
  503. // tab: gallery, library, or type-specific 
  504. if ( isset($_GET['tab']) ) 
  505. $tab = strval($_GET['tab']); 
  506. else 
  507. $tab ='special_wysija_browse'; 
  508.  
  509. $body_id = 'media-upload'; 
  510. // let the action code decide how to handle the request 
  511. if ( $tab == 'type' || $tab == 'type_url' ) 
  512. //i'm not so sure we need that line 
  513. do_action("media_upload_$type"); 
  514. else{ 
  515. if(strpos($tab, 'special_')!==false) { 
  516. do_action("media_upload_$tab"); 
  517. }else{ 
  518. do_action('media_upload_standard', $tab); 
  519.  
  520. exit; 
  521.  
  522.  
  523. function getDefaultUrl($filter=true) { 
  524. $location="admin.php?page=".$_REQUEST['page']; 
  525.  
  526. if($filter) { 
  527. if(isset($_REQUEST['search']) && $_REQUEST['search']) { 
  528. $location.='&search='.$_REQUEST['search']; 
  529.  
  530. if(isset($_REQUEST['filter-list']) && $_REQUEST['filter-list']) { 
  531. $location.='&filter-list='.$_REQUEST['filter-list']; 
  532.  
  533. if(isset($_REQUEST['link_filter']) && $_REQUEST['link_filter']) { 
  534. $location.='&link_filter='.$_REQUEST['link_filter']; 
  535.  
  536. if(isset($_REQUEST['orderby']) && $_REQUEST['orderby']) { 
  537. $location.='&orderby='.$_REQUEST['orderby']; 
  538.  
  539. if(isset($_REQUEST['ordert']) && $_REQUEST['ordert']) { 
  540. $location.='&ordert='.$_REQUEST['ordert']; 
  541.  
  542. return $location; 
  543.  
  544. /** 
  545. * to remove the conflicts in wysija's interfaces 
  546. * @param boolean $themes 
  547. */ 
  548. function get_conflictive_plugins($themes=false) { 
  549.  
  550. /** 
  551. * List of all the conflictive extensions which invite themselves on our interfaces and break some of our js: 
  552. * tribulant newsletter 
  553. */ 
  554. $conflictivePlugins = array( 
  555. 'tribulant-wp-mailinglist' => array( 
  556. 'file' => 'wp-mailinglist/wp-mailinglist.php',  
  557. 'version' => '3.8.7',  
  558. 'clean' => array( 
  559. 'admin_head' => array( 
  560. '10' => array( 
  561. 'objects' => array('wpMail') 
  562. ),  
  563. 'wp-events' => array( 
  564. 'file' => 'wp-events/wp-events.php',  
  565. 'version' => '',  
  566. 'clean' => array( 
  567. 'admin_head' => array( 
  568. '10' => array( 
  569. 'function' => 'events_editor_admin_head' 
  570. ),  
  571. 'email-users' => array( 
  572. 'file' => 'email-users/email-users.php',  
  573. 'version' => '',  
  574. 'clean' => array( 
  575. 'admin_head' => array( 
  576. '10' => array( 
  577. 'function' => 'editor_admin_head' 
  578. ),  
  579. 'acf' => array( 
  580. 'file' => 'advanced-custom-fields/acf.php',  
  581. 'version' => '3.1.7',  
  582. 'clean' => array( 
  583. 'init' => array( 
  584. '10' => array( 
  585. 'objects' => array('Acf') 
  586. ),  
  587. 'wptofacebook' => array( 
  588. 'file' => 'wptofacebook/index.php',  
  589. 'version' => '1.2.3',  
  590. 'clean' => array( 
  591. 'admin_head' => array( 
  592. '10' => array( 
  593. 'function' => 'WpToFb::wptofb_editor_admin_head' 
  594. ),  
  595. 'mindvalley-pagemash' => array( 
  596. 'file' => 'mindvalley-pagemash/pagemash.php',  
  597. 'version' => '1.1',  
  598. 'clean' => array( 
  599. 'admin_print_scripts' => array( 
  600. '10' => array( 
  601. 'function' => 'pageMash_head' 
  602. ),  
  603. 'wp-polls' => array( 
  604. 'file' => 'wp-polls/wp-polls.php',  
  605. 'version' => '2.63',  
  606. 'clean' => array( 
  607. 'wp_enqueue_scripts' => array( 
  608. '10' => array( 
  609. 'function' => 'poll_scripts' 
  610. ),  
  611. 'wp_rokajaxsearch' => array( 
  612. 'file' => 'wp_rokajaxsearch/rokajaxsearch.php',  
  613. 'version' => '',  
  614. 'clean' => array( 
  615. 'init' => array( 
  616. '-50' => array( 
  617. 'function' => 'rokajaxsearch_mootools_init' 
  618. ),  
  619. 'wp_rokstories' => array( 
  620. 'file' => 'wp_rokstories/rokstories.php',  
  621. 'version' => '',  
  622. 'clean' => array( 
  623. 'init' => array( 
  624. '-50' => array( 
  625. 'function' => 'rokstories_mootools_init' 
  626. ),  
  627. 'simple-links' => array( 
  628. 'file' => 'simple-links/simple-links.php',  
  629. 'version' => '1.5',  
  630. 'clean' => array( 
  631. 'admin_print_scripts' => array( 
  632. '10' => array( 
  633. 'objects' => array('simple_links_admin') 
  634. ); 
  635.  
  636. $conflictiveThemes = array( 
  637. 'smallbiz' => array( 
  638. 'clean' => array( 
  639. 'admin_head' => array( 
  640. '10' => array( 
  641. 'function' => 'smallbiz_on_admin_head' 
  642. ),  
  643. 'balance' => array( 
  644. 'clean' => array( 
  645. 'admin_enqueue_scripts' => array( 
  646. '10' => array( 
  647. 'functions' => array('al_admin_scripts', 'al_adminpanel_scripts', 'al_pricing_tables_scripts') 
  648. ),  
  649. 'admin_head' => array( 
  650. '10' => array( 
  651. 'function' => 'al_admin_head' 
  652. ); 
  653.  
  654. if($themes) return $conflictiveThemes; 
  655. return $conflictivePlugins;