插件目录

变更集1524886


忽略:
时间戳:
2016年10月30日下午04:48:01(8年(之前)
作者:
AeonOfTime公司
消息:
  • 修复了导入EFT XML文件时的错误
  • 双击图标,可在列表中切换EFT配件的可见性
  • 改进了Ajax调用对未来功能的内部处理
位置:
eve-shipinfo/trunk
文件夹:
添加了8个
11已编辑

图例:

未修改
补充
远离的
  • eve-shipinfo/trunk/classes/EVEShipInfo.php

    1515401兰特 1524886卢比  
    4242const ERROR_COULD_NOT_CREATE_SQL_STRUCTURE=1303;
    4343   
     44常量ERROR_CANNOT_FIND_CLASS_FILE=1304;
     45   
    4446   /**
    4547*用于
     
    9799         
    98100add_action('init',数组($this,'handle_init');
    99 add_action('wp_ajax_eveshipinfo_checkforupdate',数组($this,'ajax_checkforupdate');
     101
     102$this->handle_initAJAX方法();
     103       
    100104add_action('admin_init',数组($this,'handle_initPluginSettings');
    101105add_action('admin_menu',数组($this,'handle_initAdminMenu'));
     
    106110   
    107111   /**
    108 *用于从项目主页获取数据库版本的Ajax处理程序。
    109     */
    110 公共函数ajax_checkForUpdate()
    111     {
    112 $url=$this->getHomepageURL()。'/api/getDataVersion.php';
    113        
    114 $result=wp_remote_get($url);
    115        
    116 $state=“成功”;
    117 if(iswp_error($result)){
    118 $state=“错误”;
    119 $data=$result->get_error_message();
    120 }其他{
    121 $code=wp_remote_retrieve_response_code($result);
    122 if($code!=200){
    123 $state=“错误”;
    124 $数据=wp_remote_retrieve_response_message($result);
    125 }其他{
    126 $infoRemote=EVEShipInfo::parseVersion(trim($result['body']));
    127 $infoLocal=EVEShipInfo::parseVersion($this->getDataVersion());
    128 $update=false;
    129 if($infoRemote['date']>$infoLocal['date']){
    130 $update=true;
    131                 }
    132                
    133 $data=数组(
    134 “remoteVersion”=>$infoRemote[“版本”],
    135 “updateAvailable”=>$update,
    136                 );
    137             }
    138         }
    139 
    140 $response=数组(
    141 “url”=>$url,
    142 “state”=>$state,
    143 “data”=>$data
    144         );
    145        
    146 echo json_encode($response);
    147 wp_die();
     112*设置插件可用的所有AJAX方法,
     113*通过检查AjaxMethod中可用的选项
     114*classes文件夹。将每个添加为特定插件
     115*AJAX方法。
     116    */
     117受保护的函数handle_initAJAX方法()
     118    {
     119$this->loadClass(“EVEShipInfo_AjaxHandler”);
     120       
     121$names=$this->getClassNamesFromFolder($this->getClassesFolder)。”/EVEShipInfo/AjaxMethod);
     122       
     123foreach($names作为$name){
     124//为了避免在每个请求上为每个方法加载整个ajax类,
     125//我们使用轻量级处理程序,它根据需要加载类。
     126$handler=新的EVEShipInfo_AjaxHandler($this,$name);
     127add_action(“wp_ajax_eveshipinfo_”.strtolower($name),数组($handler,“execute”);
     128        }
    148129    }
    149130   
     
    582563$this->shortcodeIDs=array();
    583564       
    584 $folder=$this->get目录()。'//EVEShipInfo/短代码';
     565$folder=$this->getClassesFolder()。'/EVEShipInfo/短代码';
    585566if(!file_exists($folder)){
    586567return$this->shortcodeID;
    587568        }
    588569       
     570$this->shortcodeIDs=$this->获取ClassNamesFromFolder($folder);
     571
     572return$this->shortcodeID;
     573    }
     574   
     575   /**
     576*检索指定文件夹中的所有PHP文件名,
     577*无扩展。
     578    *
     579*@param string$文件夹
     580*@返回字符串[]
     581    */
     582公共函数getClassNamesFromFolder($folder)
     583    {
     584$names=数组();
    589585$d=新的DirectoryTerator($folder);
    590586foreach($d作为$item){
    591           $file=$item->getFilename();
    592           $ext=路径信息($文件,pathinfo_EXTENSION);
    593           if($ext!='php'){
    594               继续;
    595           }
    596           
    597        $此->短代码IDs[]=str_replace('.php','',$文件);
    598         }
    599 
    600 返回$这个->shortcodeIDs;
     587          $file=$item->getFilename();
     588          $ext=路径信息($文件,pathinfo_EXTENSION);
     589          if($ext!='php'){
     590              继续;
     591          }
     592          
     593       $名称s[]=str_replace('.php','',$文件);
     594        }
     595       
     596返回$名称s;
    601597    }
    602598   
     
    667663    {
    668664if(is_admin()){
    669 $this->addScript('admin/FittingsList.js',数组('jquery'));
     665$this->addScript('admin/admin.js',数组('jquery'));
     666$this->addScript('admin/FittingsList.js',数组('jquery'));
    670667$this->addScript('admin/Themes.js',数组('jquery'));
    671668$this->addStyle('admin.css');
     
    10151012        }
    10161013       
    1017 $file=$this->dir.'/classes/'.str_replace('_','/',$className)。'。php';
     1014$file=$this->getClassesFolder().'/'。str_replace('_','/',$className)。'。php';
     1015if(!file_exists($file)){
     1016抛出新的EVEShipInfo_Exception(
     1017'找不到类文件',
     1018冲刺(
     1019'尝试从文件[%s]加载类[%s]。',
     1020$className,
     1021$文件
     1022                ),
     1023自身::ERROR_CANNOT_FIND_CLASS_FILE
     1024            );
     1025        }
     1026       
    10181027require_onex$文件;
     1028    }
     1029   
     1030   /**
     1031*检索插件“classes”文件夹的完整路径。
     1032*@返回字符串
     1033    */
     1034公共函数getClassesFolder()
     1035    {
     1036return$this->dir.'/classes';
    10191037    }
    10201038   
  • eve-shipinfo/trunk/classes/EVEShipInfo/Admin/Page.php

    1296177卢比 1524886卢比  
    195195$内容。
    196196“</div>”。
    197 “</div>”;
    198        
     197'</div>'。
     198$this->ui->renderJS();
     199               
    199200返回$html;
    200201    }
  • eve-shipinfo/trunk/classes/EVEShipInfo/Admin/Page/Main/EFT安装.php

    1512895元 1524886卢比  
    139139“</tr>”;   
    140140}其他{
    141 foreach($fits as$fit){
    142 $public=$this->ui->icon()->visibilityPrivate()->makeDangerous().''__(“Private”,“eve-shipinfo”);
    143 if($fit->isPublic()){
    144 $public=$this->ui->icon()->visibilityPublic()->makeSuccess().''__(“Public”,“eve-shipinfo”);
    145                             }
     141foreach($fits as$fit)
     142                        {
     143$jsID=EVEShipInfo::nextJSID();
     144$displayPrivate=“无”;
     145$displayPublic='none';
     146                           
     147$this->ui->addJSOnload(sprintf(
     148“jQuery('#%s-private,#%s-public').dblclick(function(){FittingsList.ToggleVisibility('%s','%s');}).addClass('shipinfo-clickable')”,
     149$jsID,
     150$jsID,
     151$fit->getID(),
     152$jsID
     153                            ));
     154                           
     155if($fit->isPublic()){$displayPublic='block';}
     156if($fit->isPrivate()){$displayPrivate='block';}
     157                           
     158$公共=
     159'<div id=“'.$jsID.'-private”class=“适合可见性切换”style=“display:'.$displayPrivate.'”title=“'.__('双击切换.','eve shipinfo').'”>'。
     160$this->ui->icon()->visibilityPrivate()
     161->生成危险()。
     162                                ' '.
     163__(“私人”,“eve-shipinfo”)。
     164'</div>'。
     165'<div id=“'.$jsID.'-public”class=“fit-visibility-toggle”style=“display:'.$displayPublic.'”title=“'.__('双击切换','eve-shipinfo').'”>'。
     166$this->ui->icon()->可见性Public()
     167->makeSuccess()。
     168                                ' '.
     169__(“公共”,“eve-shipinfo”)。
     170'</div>'。
     171'<div id=“'.$jsID.'-loading”style=“display:none”>'。
     172$this->ui->icon()->微调器()
     173->addClass('spinner-datagrid')。
     174                                ' '.
     175__(“正在更新…”,“eve-shipinfo”)。
     176“</div>”;
    146177                           
    147178$invalid=“”;
  • eve-shipinfo/trunk/classes/EVEShipInfo/Admin/UI.php

    123586卢比 1524886卢比  
    9797return new EVEShipInfo_Admin_UI_Icon();
    9898    }
     99   
     100受保护的$jsOnload=array();
     101受保护的$jsHead=array();
     102   
     103   /**
     104*添加要在页面加载时执行的javascript语句。
     105    *
     106*@param string$语句
     107*@return EVEShipInfo_Admin_UI
     108    */
     109公共函数addJSOnload($语句)
     110    {
     111$this->jsOnload[]=rtrim(trim($statement),';');
     112返回$this;
     113    }
     114   
     115   /**
     116*添加要在页面加载之前执行的javascript语句。
     117    *
     118*@param string$语句
     119*@return EVEShipInfo_Admin_UI
     120    */
     121公共函数addJSHead($statement)
     122    {
     123$this->jsHead[]=rtrim(trim($statement),';');
     124返回$this;
     125    }
     126   
     127公共函数renderJS()
     128    {
     129if(空($this->jsOnload)&&empty($this->jsHead)){
     130返回“”;
     131        }
     132       
     133$head=$this->jsHead;
     134if(!空($this->jsOnload)){
     135$head[]=“jQuery(document).ready(function(){'.interbulde(';',$this->jsOnload).';})”;
     136        }
     137       
     138return“<script>”.implode(“;”,$head)。“</脚本>';
     139    }
    99140}
  • eve-shipinfo/trunk/classes/EVEShipInfo/Admin/UI/Icon.php

    1417468兰特 1524886卢比  
    2525'LIST_VIEW'=>'LIST-VIEW',
    2626“主题”=>“管理外观”,
    27 “UPDATE”=>“UPDATE”
     27'UPDATE'=>'UPDATE',
     28'SPINNER'=>'_SPINNER'
    2829    );
    2930
     
    5960公共函数visibilityPublic(){return$this->setType('VISIBILITY_public');}
    6061公共函数visibilityPrivate(){return$this->setType('VISIBILITY_PRIVATE');}
     62公共函数spinner(){return$this->setType('spinner');}
    6163   
    6264    /**
     
    138140公共函数render()
    139141    {
    140 $this->setAttribute('class','dashicons-dashicons-'.self::$types[$this->type].''.improde('',$this-->类));
     142if($this->type==“旋转器”){
     143$this->setAttribute('class','shipinfo-spinner');
     144}其他{
     145$this->setAttribute('class','dashicons-dashicons-'.self::$types[$this->type].''.improde('',$this-->类));
     146        }
    141147
    142148if(!空($this->styles)){
  • eve-shipinfo/trunk/classes/EVEShipInfo/EFTManager.php

    1411207元 1524886卢比  
    276276$label=修剪($result[2][0]);
    277277       
    278 $this->加载模块();
     278$this->加载();
    279279       
    280280$modules=数组();
  • eve-shipinfo/ttrunk/css/admin.css

    1417468兰特 1524886卢比  
    196196光标:缩小;
    197197}
     198
     199.shipinfo-旋转器{
     200显示:内联块;
     201背景:url(../images/spinner.gif)无重复中心;
     202最小宽度:20px;
     203最小高度:20px;
     204线高:1;
     205垂直对齐:顶部;
     206}
     207
     208.shipinfo-单击{
     209光标:指针;
     210}
     211
     212.fit-visibility-toggle.shipinfo-clickable:悬停{
     213颜色:#0073A;
     214}
  • eve-shipinfo/trunk/errorcodes.txt

    1417468兰特 1524886卢比  
    1 18001
     119001
  • eve-shipinfo/ttrunk/js/admin/Dashboard.js

    1515401兰特 1524886卢比  
    99jQuery('#updatecheck-available').hide();
    1010       
    11 jQuery.ajax({
    12 “url”:ajaxurl,
    13 “数据”:{
    14 “操作”:“veshipinfo_checkforupdate”
    15             },
    16 “成功”:函数(数据){
     11EVEShipInfo_管理。AJAX公司(
     12'检查更新',
     13空,
     14功能(数据){
    1715EVEShipInfo_Dashboard。Handle_UpdateCheckSuccess(数据);
    1816            },
    19 “error”:函数(jqXHR,textStatus,errorThrown){
    20 EVEShipInfo_Dashboard。Handle_UpdateCheckFailure(errorThrown);
    21             },
    22 “dataType”:“json”
    23         });
     17函数(errorMessage){
     18EVEShipInfo_Dashboard。Handle_UpdateCheckFailure(错误消息);
     19            }
     20        );
    2421    },
    2522   
  • eve-shipinfo/ttrunk/js/admin/FittingsList.js

    1112684兰特 1524886卢比  
    1515jQuery('.fit-checkbox').prop('checked',true);
    1616this.allSelected=true;
     17    },
     18   
     19切换可见性:函数(fitID,jsID)
     20    {
     21//避免双击后选择文本
     22var sel=window.getSelection();
     23if(sel){sel.removeAllRanges();}
     24       
     25var elPublic=jQuery('#'+jsID+'-public');
     26var elPrivate=jQuery('#'+jsID+'-private');
     27var elLoader=jQuery('#'+jsID+'-loading');
     28
     29var有效载荷={
     30“fitID”:fitID,
     31“changeTo”:“私人”
     32        };
     33       
     34if(elPrivate.is(':visible')){
     35payload.changeTo=“公共”;
     36        }
     37
     38elPublic.hide();
     39elPrivate.hide();
     40elLoader.show();
     41       
     42EVEShipInfo_管理。AJAX公司(
     43“FittingSetVisibility”,
     44有效载荷,
     45功能(数据){
     46配件列表。Handle_ToggleVisibilitySuccess(数据,jsID);
     47            },
     48函数(errorMessage){
     49配件列表。Handle_ToggleVisibilityFailure(错误消息,有效负载,jsID);
     50            }
     51        );
     52    },
     53   
     54Handle_ToggleVisibilityFailure:函数(errorMessage,有效负载,jsID)
     55    {
     56console.log('ERROR|无法更新可见性|'+errorMessage);
     57       
     58jQuery('#'+jsID+'-loading').hide();
     59       
     60if(payload.changeTo==“公共”){
     61jQuery('#'+jsID+'-private').show();
     62}其他{
     63jQuery('#'+jsID+'-public').show();
     64        }
     65    },
     66   
     67Handle_ToggleVisibilitySuccess:函数(响应,jsID)
     68    {
     69jQuery('#'+jsID+'-loading').hide();
     70       
     71if(response.visibility==“私有”){
     72jQuery('#'+jsID+'-private').show();
     73}其他{
     74jQuery('#'+jsID+'-public').show();
     75        }
    1776    }
    1877};
  • eve-shipinfo/trunk/readme.txt版本

    1515807兰特 1524886卢比  
    5454
    5555= 2.1 =
     56*将“质量”过滤器添加到列表短代码中,以按船舶质量限制列表
    5657*将“船舶”过滤器添加到列表快捷代码中,以按名称或id显示特定船舶
    57 *将“质量”过滤器添加到列表短代码中,以按船舶质量限制列表
     58*修复了导入EFT XML文件时的错误
     59*双击图标,可在列表中切换EFT配件的可见性
     60*改进了Ajax调用对未来功能的内部处理
    5861
    5962= 2.0 =
注:请参见TracChangeset(跟踪变更集)获取有关使用变更集查看器的帮助。