Changeset 2347816
- Timestamp:
- 07/28/2020 12:42:40 PM (6 years ago)
- Location:
- do-that-task
- Files:
-
- 4 edited
-
tags/1.5.0/includes/class-dothattask.php (modified) (1 diff)
-
tags/1.5.0/template/popup_content.php (modified) (3 diffs)
-
trunk/includes/class-dothattask.php (modified) (1 diff)
-
trunk/template/popup_content.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
do-that-task/tags/1.5.0/includes/class-dothattask.php
r2343421 r2347816 345 345 346 346 if(get_option(DTT_PLUGIN_ACTIVATE,false)){ 347 wp_enqueue_style('dtt-task-admin-popup',DTT_API_URL.'wp/css/popup.css',array(),true); 347 348 if(!empty($page) && in_array($page,$this->_page)){ 348 wp_enqueue_style('dtt-task-admin-popup',DTT_API_URL.'wp/css/popup.css',array(),true);349 349 wp_enqueue_script('dtt-task-moment-js',DTT_API_URL . 'js/moment/moment.min.js' , array(), true,true); 350 350 if(!empty($page) && $page=='dtt_task_manager_transactions'){ -
do-that-task/tags/1.5.0/template/popup_content.php
r2347161 r2347816 4 4 if (!get_option(DTT_DO_INSTALLATION, false) && !get_option(DTT_PLUGIN_UPGRADE, false)): 5 5 $wpsTaskAdminLble_url = admin_url( 'admin.php?page=dtt_task_manager_settings' ); 6 if( $_REQUEST['page']!="dtt_task_manager_settings"){6 if(!isset($_REQUEST['page']) || (isset($_REQUEST['page']) && $_REQUEST['page']!="dtt_task_manager_settings")){ 7 7 $wpVals = $dttTaskFunObj->wpDefaultValues(); 8 8 $wpVals['admin_email'] = (get_option(DTT_PLUGIN_PRIMARY_EMAIL)?get_option(DTT_PLUGIN_PRIMARY_EMAIL):$wpVals['admin_email']); … … 15 15 } 16 16 if(isset($aJson['wp_settings'])){ 17 $aDttSetting = $aJson['wp_settings']; 18 update_option(DTT_SETTING,$aDttSetting); 17 update_option(DTT_SETTING,$aJson['wp_settings']); 18 } 19 if(isset($aJson['token'])){ 20 update_option(DTT_TOKEN,$aJson['token']); 19 21 } 20 22 } 21 $ restrictType = get_option(DTT_SETTING)['auditor_see_website'];23 $aSetting = get_option(DTT_SETTING); 22 24 23 25 if(strpos($current_url,'wp-admin') === false && $visible_to_you){?> … … 26 28 </a> 27 29 <?php } 28 $token = get_option(DTT_TOKEN); 29 $settings = get_option(DTT_SETTING); 30 $aToken = ['token'=>'','isAdmin'=>0,'team'=>$settings['default_team']]; 31 if( current_user_can('administrator') ) { 32 $aToken['token'] = $token['admin']; 33 $aToken['isAdmin'] = 1; 34 }else{ 35 $aToken['token'] = $token['guest']; 36 } 37 ?> 38 <script type="text/javascript"> 39 <?php if(!empty($aToken['token'])):?> 40 var dttPluginData = {"token":'<?php echo $aToken['token'];?>',"isType":<?php echo $aToken['isAdmin'];?>,'team':'<?php echo $aToken['team'];?>'}; 41 <?php if(strtolower(DTT_API_MODE)!='live'):?> 42 dttPluginData["local"] = 1; 43 <?php endif;?> 44 <?php if($restrictType == 0):?> 45 dttPluginData["restrictType"] = 2; 46 <?php endif;?> 47 (function(w,d,s,j,r,a,m){w['DttObjects']=r;w[r]=w[r]||function(){(w[r].q=w[r].q||[])[(arguments[0]||'')]=(arguments[1]||'')},w[r].l=1*new Date();if(d.getElementById(r)){return;}a=d.createElement(s),m=d.getElementsByTagName(s)[0];a.id=r;a.async=1;a.src=j;m.parentNode.insertBefore(a,m) 48 })(window,document,'script','<?php echo DTT_SNIPPET_URL;?>snippet/main.js','dtto'); 49 dtto('config', dttPluginData); 50 <?php else:?> 51 Task.showMessage({message:"There is Token issue.",msgClass:'red'}); 52 <?php endif;?> 53 </script> 30 $token = get_option(DTT_TOKEN); 31 $settings = get_option(DTT_SETTING); 32 $aToken = ['token'=>'','isAdmin'=>0,'team'=>$settings['default_team']]; 33 if( current_user_can('administrator') ) { 34 $aToken['token'] = $token['admin']; 35 $aToken['isAdmin'] = 1; 36 }else{ 37 $aToken['token'] = $token['guest']; 38 } 39 ?> 40 <script type="text/javascript"> 41 <?php if(!empty($aToken['token'])):?> 42 var dttPluginData = {"token":'<?php echo $aToken['token'];?>',"isType":<?php echo $aToken['isAdmin'];?>,'team':'<?php echo $aToken['team'];?>'}; 43 <?php if(strtolower(DTT_API_MODE)!='live'):?> 44 dttPluginData["local"] = 1; 45 <?php endif;?> 46 <?php if(isset($aSetting['auditor_see_website']) && $aSetting['auditor_see_website'] == 0):?> 47 dttPluginData["restrictType"] = 2; 48 <?php endif;?> 49 (function(w,d,s,j,r,a,m){w['DttObjects']=r;w[r]=w[r]||function(){(w[r].q=w[r].q||[])[(arguments[0]||'')]=(arguments[1]||'')},w[r].l=1*new Date();if(d.getElementById(r)){return;}a=d.createElement(s),m=d.getElementsByTagName(s)[0];a.id=r;a.async=1;a.src=j;m.parentNode.insertBefore(a,m) 50 })(window,document,'script','<?php echo DTT_SNIPPET_URL;?>snippet/main.js','dtto'); 51 dtto('config', dttPluginData); 52 <?php else:?> 53 window.onload = function(e){ 54 Task.showMessage({message:"You are not able to create task, Please reinstall plugin.",msgClass:'red'}); 55 } 56 <?php endif;?> 57 </script> 54 58 <?php 55 59 endif;?> -
do-that-task/trunk/includes/class-dothattask.php
r2318159 r2347816 345 345 346 346 if(get_option(DTT_PLUGIN_ACTIVATE,false)){ 347 wp_enqueue_style('dtt-task-admin-popup',DTT_API_URL.'wp/css/popup.css',array(),true); 347 348 if(!empty($page) && in_array($page,$this->_page)){ 348 wp_enqueue_style('dtt-task-admin-popup',DTT_API_URL.'wp/css/popup.css',array(),true);349 349 wp_enqueue_script('dtt-task-moment-js',DTT_API_URL . 'js/moment/moment.min.js' , array(), true,true); 350 350 if(!empty($page) && $page=='dtt_task_manager_transactions'){ -
do-that-task/trunk/template/popup_content.php
r2347161 r2347816 4 4 if (!get_option(DTT_DO_INSTALLATION, false) && !get_option(DTT_PLUGIN_UPGRADE, false)): 5 5 $wpsTaskAdminLble_url = admin_url( 'admin.php?page=dtt_task_manager_settings' ); 6 if( $_REQUEST['page']!="dtt_task_manager_settings"){6 if(!isset($_REQUEST['page']) || (isset($_REQUEST['page']) && $_REQUEST['page']!="dtt_task_manager_settings")){ 7 7 $wpVals = $dttTaskFunObj->wpDefaultValues(); 8 8 $wpVals['admin_email'] = (get_option(DTT_PLUGIN_PRIMARY_EMAIL)?get_option(DTT_PLUGIN_PRIMARY_EMAIL):$wpVals['admin_email']); … … 15 15 } 16 16 if(isset($aJson['wp_settings'])){ 17 $aDttSetting = $aJson['wp_settings']; 18 update_option(DTT_SETTING,$aDttSetting); 17 update_option(DTT_SETTING,$aJson['wp_settings']); 18 } 19 if(isset($aJson['token'])){ 20 update_option(DTT_TOKEN,$aJson['token']); 19 21 } 20 22 } 21 $ restrictType = get_option(DTT_SETTING)['auditor_see_website'];23 $aSetting = get_option(DTT_SETTING); 22 24 23 25 if(strpos($current_url,'wp-admin') === false && $visible_to_you){?> … … 26 28 </a> 27 29 <?php } 28 $token = get_option(DTT_TOKEN); 29 $settings = get_option(DTT_SETTING); 30 $aToken = ['token'=>'','isAdmin'=>0,'team'=>$settings['default_team']]; 31 if( current_user_can('administrator') ) { 32 $aToken['token'] = $token['admin']; 33 $aToken['isAdmin'] = 1; 34 }else{ 35 $aToken['token'] = $token['guest']; 36 } 37 ?> 38 <script type="text/javascript"> 39 <?php if(!empty($aToken['token'])):?> 40 var dttPluginData = {"token":'<?php echo $aToken['token'];?>',"isType":<?php echo $aToken['isAdmin'];?>,'team':'<?php echo $aToken['team'];?>'}; 41 <?php if(strtolower(DTT_API_MODE)!='live'):?> 42 dttPluginData["local"] = 1; 43 <?php endif;?> 44 <?php if($restrictType == 0):?> 45 dttPluginData["restrictType"] = 2; 46 <?php endif;?> 47 (function(w,d,s,j,r,a,m){w['DttObjects']=r;w[r]=w[r]||function(){(w[r].q=w[r].q||[])[(arguments[0]||'')]=(arguments[1]||'')},w[r].l=1*new Date();if(d.getElementById(r)){return;}a=d.createElement(s),m=d.getElementsByTagName(s)[0];a.id=r;a.async=1;a.src=j;m.parentNode.insertBefore(a,m) 48 })(window,document,'script','<?php echo DTT_SNIPPET_URL;?>snippet/main.js','dtto'); 49 dtto('config', dttPluginData); 50 <?php else:?> 51 Task.showMessage({message:"There is Token issue.",msgClass:'red'}); 52 <?php endif;?> 53 </script> 30 $token = get_option(DTT_TOKEN); 31 $settings = get_option(DTT_SETTING); 32 $aToken = ['token'=>'','isAdmin'=>0,'team'=>$settings['default_team']]; 33 if( current_user_can('administrator') ) { 34 $aToken['token'] = $token['admin']; 35 $aToken['isAdmin'] = 1; 36 }else{ 37 $aToken['token'] = $token['guest']; 38 } 39 ?> 40 <script type="text/javascript"> 41 <?php if(!empty($aToken['token'])):?> 42 var dttPluginData = {"token":'<?php echo $aToken['token'];?>',"isType":<?php echo $aToken['isAdmin'];?>,'team':'<?php echo $aToken['team'];?>'}; 43 <?php if(strtolower(DTT_API_MODE)!='live'):?> 44 dttPluginData["local"] = 1; 45 <?php endif;?> 46 <?php if(isset($aSetting['auditor_see_website']) && $aSetting['auditor_see_website'] == 0):?> 47 dttPluginData["restrictType"] = 2; 48 <?php endif;?> 49 (function(w,d,s,j,r,a,m){w['DttObjects']=r;w[r]=w[r]||function(){(w[r].q=w[r].q||[])[(arguments[0]||'')]=(arguments[1]||'')},w[r].l=1*new Date();if(d.getElementById(r)){return;}a=d.createElement(s),m=d.getElementsByTagName(s)[0];a.id=r;a.async=1;a.src=j;m.parentNode.insertBefore(a,m) 50 })(window,document,'script','<?php echo DTT_SNIPPET_URL;?>snippet/main.js','dtto'); 51 dtto('config', dttPluginData); 52 <?php else:?> 53 window.onload = function(e){ 54 Task.showMessage({message:"You are not able to create task, Please reinstall plugin.",msgClass:'red'}); 55 } 56 <?php endif;?> 57 </script> 54 58 <?php 55 59 endif;?>
Note: See TracChangeset
for help on using the changeset viewer.