Changeset 2318159
- Timestamp:
- 06/04/2020 01:33:10 PM (6 years ago)
- Location:
- do-that-task
- Files:
-
- 4 edited
-
tags/1.4.9/includes/class-dothattask.php (modified) (2 diffs)
-
tags/1.4.9/template/plugin_details.php (modified) (5 diffs)
-
trunk/includes/class-dothattask.php (modified) (2 diffs)
-
trunk/template/plugin_details.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
do-that-task/tags/1.4.9/includes/class-dothattask.php
r2311635 r2318159 272 272 public function dtt_task_manager_footer($aParams) 273 273 { 274 $this->set_template('footer_logo',$aParams,"nohtml");274 echo $this->set_template('footer_logo',$aParams,"nohtml"); 275 275 } 276 276 public function dtt_task_manager_admin_footer($aParams) 277 277 { 278 $this->set_template('footer_admin',$aParams ,"nohtml");278 $this->set_template('footer_admin',$aParams); 279 279 } 280 280 public function dtt_task_manager_board($aParams) … … 443 443 ob_start(); 444 444 include DTT_PATH."template/template.php"; 445 return ob_get_contents(); 446 ob_get_clean(); 445 if($view=='nohtml'){ 446 return ob_get_clean(); 447 }else{ 448 return ob_get_contents(); 449 ob_get_clean(); 450 } 447 451 } 448 452 /** -
do-that-task/tags/1.4.9/template/plugin_details.php
r2311635 r2318159 85 85 } 86 86 87 //get admin email 88 $aEmail = ['option_email'=>$wpsValue['admin_email'],'user_email'=>$wpsValue['user_email']]; 89 $currentDomain = preg_replace( '/^(?:www.)?(.*)/', "$1",preg_replace( '/^(?:http:\/\/)|(?:https:\/\/)?(.*)/', "$1", rtrim(home_url(),'/'))); 90 87 91 $previousSelected = []; 88 92 //Parse Error Data … … 91 95 $pluginActivation = get_option(DTT_ACTIVATION_ERROR_DATA); 92 96 if(!empty($pluginActivation)){ 93 $ pluginActivation['email'] = explode(',', $pluginActivation['email']);97 $aEmail['exist_email'] = $pluginActivation['email'] = explode(',', $pluginActivation['email']); 94 98 $pluginActivation['domain'] = explode(',', $pluginActivation['domain']); 95 99 $pluginActivation['none'] = explode(',', $pluginActivation['none']); 96 100 $pluginActivation['data'] = array_combine($pluginActivation['email'],array_map(function($v){return preg_replace('/^(?:www.)?(.*)/',"$1", preg_replace( '/^(?:http:\/\/)|(?:https:\/\/)?(.*)/', "$1", rtrim($v,'/')));},$pluginActivation['domain'])); 97 } 98 //print_r($pluginActivation); 99 } 100 101 $currentDomain = preg_replace( '/^(?:www.)?(.*)/', "$1",preg_replace( '/^(?:http:\/\/)|(?:https:\/\/)?(.*)/', "$1", rtrim(home_url(),'/'))); 102 103 //get admin email 104 $aEmail = ['option_email'=>$wpsValue['admin_email'],'user_email'=>$wpsValue['user_email']]; 101 $aEmail['exist_email'] = array_search($currentDomain,$pluginActivation['data']); 102 } 103 } 105 104 106 105 //Verify Code form submit then code will execute … … 170 169 break; 171 170 } 171 $previousSelected['option'] = $emailType; 172 $previousSelected['email'] = $email; 172 173 if($error==1){ 173 174 $dttTaskFunObj->setMsgs('error',__('Please Enter valid email-address.',DTT_TEXT_DOMAIN)); 174 175 175 }else{ 176 $previousSelected['option'] = $emailType; 177 $previousSelected['email'] = $email; 178 179 176 }else{ 180 177 $curlUrl = $dttTaskFunObj->webServiceUrl("users/plugin_activate"); 181 178 … … 260 257 <?php if(!get_option(DTT_PLUGIN_EMAIL_VERIFY_CODE,false)):?> 261 258 <h4><?= __("We couldn't figure out the right account for this site, please choose from the following:",DTT_TEXT_DOMAIN);?></h4> 262 <?php /*if(!empty($pluginActivation)){263 $k=0;264 foreach ($pluginActivation['data'] as $key => $value) {265 266 if(count($pluginActivation['data'])==1){267 if($key!==$pluginActivation['none']){268 if($value==''){269 echo '<h4 style="color: #898989"><b>"'.$key.'"</b> email is not associate yet.'."</h4><br/>";270 }elseif(in_array($key,[$aEmail['option_email'],$aEmail['user_email']])){271 echo '<h4 style="color: #898989"><b>"'.$key.'"</b> email is associate with <b>"'.$pluginActivation['domain'][$k].'"</b> domain.'."</h4><br/>";272 }else{273 echo '<h4 style="color: #898989"><b>"'.$pluginActivation['domain'][$k].'"</b> domain is associate with <b>"'.$key.'"</b> email.'."</h4><br/>";274 }275 }276 }else{277 if($value!==''){278 echo '<h4 style="color: #898989"><b>"'.$pluginActivation['domain'][$k].'"</b> domain is associate with <b>"'.$key.'"</b> email.'."</h4><br/>";279 }elseif($value=='' && $pluginActivation['none']!=$key){280 echo '<h4 style="color: #898989"><b>"'.$key.'"</b> email is not associate yet.'."</h4><br/>";281 }282 }283 $k++;284 }?>285 <?php }*/?>286 259 <form action="" method="post" enctype="multipart/form-data" autocomplete="off" class="dtt_plugin_activate"> 287 260 <?php wp_nonce_field( 'dtt_nonce_action', 'dtt_nonce_field' ); ?> … … 296 269 <?php echo !empty($previousSelected) && $previousSelected['option']=='option_email'?'checked="checked"':(!empty($pluginActivation) && $pluginActivation['none']!=$aEmail['option_email'] && $aEmail['option_email']==array_search($currentDomain,$pluginActivation['data'])?'checked="checked"':'');?> 297 270 <?php echo (!empty($pluginActivation['none']) && in_array($aEmail['option_email'],$pluginActivation['none'])?'disabled="disabled"':'')?> > 298 <label for="option_email" class=""> <?php echo $aEmail['option_email'];?> </label> <span style="color: #999;font-size: 12px;"> <?php //echo $pluginActivation['none']==$aEmail['option_email']?'('.__('This email is already use in APP as none-client so we can not select').')':(in_array($aEmail['option_email'],$pluginActivation['email'])?'('.__('This email is registered on APP.').')':''); ?>271 <label for="option_email" class=""> <?php echo $aEmail['option_email'];?> </label> <span style="color: #999;font-size: 12px;"> 299 272 <?php echo (!empty($pluginActivation['none']) && in_array($aEmail['option_email'],$pluginActivation['none'])?'('.__('This email is registered on APP.').')':''); ?> 300 273 </span><br/><br/> 301 274 <?php if($aEmail['user_email']!=$aEmail['option_email']):?> 302 275 <input type="radio" name="user_email" id="user_email" value="user_email" class="mr-1 disableText" 303 <?php echo !empty($previousSelected) && $previousSelected['option']=='user_email'?'checked="checked"':(!empty($pluginActivation) && $pluginActivation['none']!=$aEmail['user_email'] && $aEmail['user_email']==array_search($currentDomain,$pluginActivation['data'])?'checked="checked"':'');?> 304 <?php //echo $pluginActivation['none']==$aEmail['user_email']?'disabled="disabled"':''?> <?php echo !empty($pluginActivation['none']) && in_array($aEmail['user_email'],$pluginActivation['none'])?'disabled="disabled"':''?>> 305 <label for="user_email"><?php echo $aEmail['user_email'];?></label> <span style="color: #999;font-size: 12px;"><?php //echo $pluginActivation['none']==$aEmail['user_email']?'('.__('This email is registered on APP').')':(in_array($aEmail['user_email'],$pluginActivation['email'])?'('.__('This email is registered on APP.').')':'');?><?php echo (!empty($pluginActivation['none']) && in_array($aEmail['user_email'],$pluginActivation['none'])?'('.__('This email is registered on APP').')':'');?></span><br/><br/> 276 <?php echo !empty($previousSelected) && $previousSelected['option']=='user_email'?'checked="checked"':(!empty($pluginActivation) && $pluginActivation['none']!=$aEmail['user_email'] && $aEmail['user_email']==array_search($currentDomain,$pluginActivation['data'])?'checked="checked"':'');?> <?php echo !empty($pluginActivation['none']) && in_array($aEmail['user_email'],$pluginActivation['none'])?'disabled="disabled"':''?>> 277 <label for="user_email"><?php echo $aEmail['user_email'];?></label> <span style="color: #999;font-size: 12px;"><?php echo (!empty($pluginActivation['none']) && in_array($aEmail['user_email'],$pluginActivation['none'])?'('.__('This email is registered on APP').')':'');?></span><br/><br/> 278 <?php endif;?> 279 <?php if(isset($aEmail['exist_email'])):?> 280 <input type="radio" name="user_email" id="exist_email" value="exist_email" class="mr-1 disableText" 281 <?php echo !empty($previousSelected) && $previousSelected['option']=='exist_email'?'checked="checked"':(!empty($pluginActivation) && $pluginActivation['none']!=$aEmail['exist_email'] && $aEmail['exist_email']==array_search($currentDomain,$pluginActivation['data'])?'checked="checked"':'');?>> 282 <label for="exist_email"><?php echo substr($aEmail['exist_email'], 0,1).'******'.substr(strstr($aEmail['exist_email'],'@',true),-1).strstr($aEmail['exist_email'],'@');?></label> <span style="color: #999;font-size: 12px;"><?php echo '('.__('This email is associated with the domain').')';?></span><br/><br/> 306 283 <?php endif;?> 307 284 <div class="r-input" > 308 285 <input type="radio" name="user_email" id="external_email" class="mr-1 enableText" value="external" 309 <?php echo !empty($previousSelected) && $previousSelected['option']=='external'?'checked="checked"': (!empty($pluginActivation) && in_array($currentDomain,$pluginActivation['data']) && !in_array(array_search($currentDomain,$pluginActivation['data']),[$aEmail['option_email'],$aEmail['user_email']])?'checked="checked"':'');?> >286 <?php echo !empty($previousSelected) && $previousSelected['option']=='external'?'checked="checked"':'';?> > 310 287 <label for="external_email" class=""><?= __("Or choose other.",DTT_TEXT_DOMAIN); ?></label> 311 288 <br><br> 312 289 <input type="email" name="email_txt" class="form-control wpsInputText" id="plugin_client_email" 313 <?php echo !empty($previousSelected) && $previousSelected['option']=='external'?'value="'.$previousSelected['email'].'"':(!empty($pluginActivation) && in_array($currentDomain,$pluginActivation['data']) && !in_array(array_search($currentDomain,$pluginActivation['data']),[$aEmail['option_email'],$aEmail['user_email']])?'value="'.substr(array_search($currentDomain,$pluginActivation['data']), 0,1).'******'.substr(strstr(array_search($currentDomain,$pluginActivation['data']),'@',true),-1).strstr(array_search($currentDomain,$pluginActivation['data']),'@').'"':' disabled="disabled" readonly="readonly" ')?>>290 <?php echo (!empty($previousSelected) && $previousSelected['option']=='external'?'value="'.$previousSelected['email'].'"':' disabled="disabled" readonly="readonly" ')?>> 314 291 </div> 315 292 -
do-that-task/trunk/includes/class-dothattask.php
r2311635 r2318159 272 272 public function dtt_task_manager_footer($aParams) 273 273 { 274 $this->set_template('footer_logo',$aParams,"nohtml");274 echo $this->set_template('footer_logo',$aParams,"nohtml"); 275 275 } 276 276 public function dtt_task_manager_admin_footer($aParams) 277 277 { 278 $this->set_template('footer_admin',$aParams ,"nohtml");278 $this->set_template('footer_admin',$aParams); 279 279 } 280 280 public function dtt_task_manager_board($aParams) … … 443 443 ob_start(); 444 444 include DTT_PATH."template/template.php"; 445 return ob_get_contents(); 446 ob_get_clean(); 445 if($view=='nohtml'){ 446 return ob_get_clean(); 447 }else{ 448 return ob_get_contents(); 449 ob_get_clean(); 450 } 447 451 } 448 452 /** -
do-that-task/trunk/template/plugin_details.php
r2311635 r2318159 85 85 } 86 86 87 //get admin email 88 $aEmail = ['option_email'=>$wpsValue['admin_email'],'user_email'=>$wpsValue['user_email']]; 89 $currentDomain = preg_replace( '/^(?:www.)?(.*)/', "$1",preg_replace( '/^(?:http:\/\/)|(?:https:\/\/)?(.*)/', "$1", rtrim(home_url(),'/'))); 90 87 91 $previousSelected = []; 88 92 //Parse Error Data … … 91 95 $pluginActivation = get_option(DTT_ACTIVATION_ERROR_DATA); 92 96 if(!empty($pluginActivation)){ 93 $ pluginActivation['email'] = explode(',', $pluginActivation['email']);97 $aEmail['exist_email'] = $pluginActivation['email'] = explode(',', $pluginActivation['email']); 94 98 $pluginActivation['domain'] = explode(',', $pluginActivation['domain']); 95 99 $pluginActivation['none'] = explode(',', $pluginActivation['none']); 96 100 $pluginActivation['data'] = array_combine($pluginActivation['email'],array_map(function($v){return preg_replace('/^(?:www.)?(.*)/',"$1", preg_replace( '/^(?:http:\/\/)|(?:https:\/\/)?(.*)/', "$1", rtrim($v,'/')));},$pluginActivation['domain'])); 97 } 98 //print_r($pluginActivation); 99 } 100 101 $currentDomain = preg_replace( '/^(?:www.)?(.*)/', "$1",preg_replace( '/^(?:http:\/\/)|(?:https:\/\/)?(.*)/', "$1", rtrim(home_url(),'/'))); 102 103 //get admin email 104 $aEmail = ['option_email'=>$wpsValue['admin_email'],'user_email'=>$wpsValue['user_email']]; 101 $aEmail['exist_email'] = array_search($currentDomain,$pluginActivation['data']); 102 } 103 } 105 104 106 105 //Verify Code form submit then code will execute … … 170 169 break; 171 170 } 171 $previousSelected['option'] = $emailType; 172 $previousSelected['email'] = $email; 172 173 if($error==1){ 173 174 $dttTaskFunObj->setMsgs('error',__('Please Enter valid email-address.',DTT_TEXT_DOMAIN)); 174 175 175 }else{ 176 $previousSelected['option'] = $emailType; 177 $previousSelected['email'] = $email; 178 179 176 }else{ 180 177 $curlUrl = $dttTaskFunObj->webServiceUrl("users/plugin_activate"); 181 178 … … 260 257 <?php if(!get_option(DTT_PLUGIN_EMAIL_VERIFY_CODE,false)):?> 261 258 <h4><?= __("We couldn't figure out the right account for this site, please choose from the following:",DTT_TEXT_DOMAIN);?></h4> 262 <?php /*if(!empty($pluginActivation)){263 $k=0;264 foreach ($pluginActivation['data'] as $key => $value) {265 266 if(count($pluginActivation['data'])==1){267 if($key!==$pluginActivation['none']){268 if($value==''){269 echo '<h4 style="color: #898989"><b>"'.$key.'"</b> email is not associate yet.'."</h4><br/>";270 }elseif(in_array($key,[$aEmail['option_email'],$aEmail['user_email']])){271 echo '<h4 style="color: #898989"><b>"'.$key.'"</b> email is associate with <b>"'.$pluginActivation['domain'][$k].'"</b> domain.'."</h4><br/>";272 }else{273 echo '<h4 style="color: #898989"><b>"'.$pluginActivation['domain'][$k].'"</b> domain is associate with <b>"'.$key.'"</b> email.'."</h4><br/>";274 }275 }276 }else{277 if($value!==''){278 echo '<h4 style="color: #898989"><b>"'.$pluginActivation['domain'][$k].'"</b> domain is associate with <b>"'.$key.'"</b> email.'."</h4><br/>";279 }elseif($value=='' && $pluginActivation['none']!=$key){280 echo '<h4 style="color: #898989"><b>"'.$key.'"</b> email is not associate yet.'."</h4><br/>";281 }282 }283 $k++;284 }?>285 <?php }*/?>286 259 <form action="" method="post" enctype="multipart/form-data" autocomplete="off" class="dtt_plugin_activate"> 287 260 <?php wp_nonce_field( 'dtt_nonce_action', 'dtt_nonce_field' ); ?> … … 296 269 <?php echo !empty($previousSelected) && $previousSelected['option']=='option_email'?'checked="checked"':(!empty($pluginActivation) && $pluginActivation['none']!=$aEmail['option_email'] && $aEmail['option_email']==array_search($currentDomain,$pluginActivation['data'])?'checked="checked"':'');?> 297 270 <?php echo (!empty($pluginActivation['none']) && in_array($aEmail['option_email'],$pluginActivation['none'])?'disabled="disabled"':'')?> > 298 <label for="option_email" class=""> <?php echo $aEmail['option_email'];?> </label> <span style="color: #999;font-size: 12px;"> <?php //echo $pluginActivation['none']==$aEmail['option_email']?'('.__('This email is already use in APP as none-client so we can not select').')':(in_array($aEmail['option_email'],$pluginActivation['email'])?'('.__('This email is registered on APP.').')':''); ?>271 <label for="option_email" class=""> <?php echo $aEmail['option_email'];?> </label> <span style="color: #999;font-size: 12px;"> 299 272 <?php echo (!empty($pluginActivation['none']) && in_array($aEmail['option_email'],$pluginActivation['none'])?'('.__('This email is registered on APP.').')':''); ?> 300 273 </span><br/><br/> 301 274 <?php if($aEmail['user_email']!=$aEmail['option_email']):?> 302 275 <input type="radio" name="user_email" id="user_email" value="user_email" class="mr-1 disableText" 303 <?php echo !empty($previousSelected) && $previousSelected['option']=='user_email'?'checked="checked"':(!empty($pluginActivation) && $pluginActivation['none']!=$aEmail['user_email'] && $aEmail['user_email']==array_search($currentDomain,$pluginActivation['data'])?'checked="checked"':'');?> 304 <?php //echo $pluginActivation['none']==$aEmail['user_email']?'disabled="disabled"':''?> <?php echo !empty($pluginActivation['none']) && in_array($aEmail['user_email'],$pluginActivation['none'])?'disabled="disabled"':''?>> 305 <label for="user_email"><?php echo $aEmail['user_email'];?></label> <span style="color: #999;font-size: 12px;"><?php //echo $pluginActivation['none']==$aEmail['user_email']?'('.__('This email is registered on APP').')':(in_array($aEmail['user_email'],$pluginActivation['email'])?'('.__('This email is registered on APP.').')':'');?><?php echo (!empty($pluginActivation['none']) && in_array($aEmail['user_email'],$pluginActivation['none'])?'('.__('This email is registered on APP').')':'');?></span><br/><br/> 276 <?php echo !empty($previousSelected) && $previousSelected['option']=='user_email'?'checked="checked"':(!empty($pluginActivation) && $pluginActivation['none']!=$aEmail['user_email'] && $aEmail['user_email']==array_search($currentDomain,$pluginActivation['data'])?'checked="checked"':'');?> <?php echo !empty($pluginActivation['none']) && in_array($aEmail['user_email'],$pluginActivation['none'])?'disabled="disabled"':''?>> 277 <label for="user_email"><?php echo $aEmail['user_email'];?></label> <span style="color: #999;font-size: 12px;"><?php echo (!empty($pluginActivation['none']) && in_array($aEmail['user_email'],$pluginActivation['none'])?'('.__('This email is registered on APP').')':'');?></span><br/><br/> 278 <?php endif;?> 279 <?php if(isset($aEmail['exist_email'])):?> 280 <input type="radio" name="user_email" id="exist_email" value="exist_email" class="mr-1 disableText" 281 <?php echo !empty($previousSelected) && $previousSelected['option']=='exist_email'?'checked="checked"':(!empty($pluginActivation) && $pluginActivation['none']!=$aEmail['exist_email'] && $aEmail['exist_email']==array_search($currentDomain,$pluginActivation['data'])?'checked="checked"':'');?>> 282 <label for="exist_email"><?php echo substr($aEmail['exist_email'], 0,1).'******'.substr(strstr($aEmail['exist_email'],'@',true),-1).strstr($aEmail['exist_email'],'@');?></label> <span style="color: #999;font-size: 12px;"><?php echo '('.__('This email is associated with the domain').')';?></span><br/><br/> 306 283 <?php endif;?> 307 284 <div class="r-input" > 308 285 <input type="radio" name="user_email" id="external_email" class="mr-1 enableText" value="external" 309 <?php echo !empty($previousSelected) && $previousSelected['option']=='external'?'checked="checked"': (!empty($pluginActivation) && in_array($currentDomain,$pluginActivation['data']) && !in_array(array_search($currentDomain,$pluginActivation['data']),[$aEmail['option_email'],$aEmail['user_email']])?'checked="checked"':'');?> >286 <?php echo !empty($previousSelected) && $previousSelected['option']=='external'?'checked="checked"':'';?> > 310 287 <label for="external_email" class=""><?= __("Or choose other.",DTT_TEXT_DOMAIN); ?></label> 311 288 <br><br> 312 289 <input type="email" name="email_txt" class="form-control wpsInputText" id="plugin_client_email" 313 <?php echo !empty($previousSelected) && $previousSelected['option']=='external'?'value="'.$previousSelected['email'].'"':(!empty($pluginActivation) && in_array($currentDomain,$pluginActivation['data']) && !in_array(array_search($currentDomain,$pluginActivation['data']),[$aEmail['option_email'],$aEmail['user_email']])?'value="'.substr(array_search($currentDomain,$pluginActivation['data']), 0,1).'******'.substr(strstr(array_search($currentDomain,$pluginActivation['data']),'@',true),-1).strstr(array_search($currentDomain,$pluginActivation['data']),'@').'"':' disabled="disabled" readonly="readonly" ')?>>290 <?php echo (!empty($previousSelected) && $previousSelected['option']=='external'?'value="'.$previousSelected['email'].'"':' disabled="disabled" readonly="readonly" ')?>> 314 291 </div> 315 292
Note: See TracChangeset
for help on using the changeset viewer.