Changeset 1515844
- Timestamp:
- 10/16/2016 10:37:48 AM (9 years ago)
- Location:
- eve-shipinfo/trunk/classes/EVEShipInfo
- Files:
-
- 7 edited
-
Collection/Filter.php (modified) (4 diffs)
-
Collection/List.php (modified) (2 diffs)
-
Shortcode.php (modified) (4 diffs)
-
Shortcode/EFTFit.php (modified) (1 diff)
-
Shortcode/Gallery.php (modified) (2 diffs)
-
Shortcode/ShipInfo.php (modified) (1 diff)
-
Shortcode/ShipList.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
eve-shipinfo/trunk/classes/EVEShipInfo/Collection/Filter.php
r1515807 r1515844 77 77 public function orderByLauncherSlots($ascending=true) { return $this->setOrderBy('launchers', $ascending); } 78 78 public function orderByTechLevel($ascending=true) { return $this->setOrderBy('techlevel', $ascending); } 79 public function orderByMass($ascending=true) { return $this->setOrderBy('mass', $ascending); } 79 80 80 81 public function secondOrderByGroup() { return $this->setSecondOrderBy('group'); } … … 92 93 public function secondOrderByLauncherSlots() { return $this->setSecondOrderBy('launchers'); } 93 94 public function secondOrderByTechLevel() { return $this->setSecondOrderBy('techlevel'); } 95 public function secondOrderByMass() { return $this->setSecondOrderBy('mass'); } 94 96 95 97 public function setOrderBy($field, $ascending=true) … … 612 614 'turrets' => __('Turret slots', 'eve-shipinfo'), 613 615 'launchers' => __('Launcher slots', 'eve-shipinfo'), 614 'techlevel' => __('Tech level', 'eve-shipinfo') 616 'techlevel' => __('Tech level', 'eve-shipinfo'), 617 'mass' => __('Mass', 'eve-shipinfo') 615 618 ); 616 619 } … … 736 739 break; 737 740 741 case 'mass': 742 $aVal = $a->getMass(); 743 $bVal = $b->getMass(); 744 break; 745 738 746 case 'name': 739 747 default: -
eve-shipinfo/trunk/classes/EVEShipInfo/Collection/List.php
r1296717 r1515844 38 38 'launchers' => __('Launcher slots', 'eve-shipinfo'), 39 39 'velocity' => __('Max velocity', 'eve-shipinfo'), 40 'techlevel' => __('Tech level', 'eve-shipinfo') 40 'techlevel' => __('Tech level', 'eve-shipinfo'), 41 'mass' => __('Mass', 'eve-shipinfo') 41 42 ); 42 43 } … … 195 196 } 196 197 198 protected function renderColumn_mass(EVEShipInfo_Collection_Ship $ship) 199 { 200 return $ship->getMass($this->showUnits); 201 } 202 197 203 protected function renderColumn_warpspeed(EVEShipInfo_Collection_Ship $ship) 198 204 { -
eve-shipinfo/trunk/classes/EVEShipInfo/Shortcode.php
r1512895 r1515844 8 8 protected $plugin; 9 9 10 protected $attrib utes;10 protected $attribs; 11 11 12 12 protected $content; … … 42 42 } 43 43 44 $this->attrib utes = shortcode_atts($this->getDefaultAttributes(), $attributes);44 $this->attribs = shortcode_atts($this->getDefaultAttributes(), $attributes); 45 45 $this->content = $content; 46 46 47 47 try 48 48 { 49 $this-> process();49 $this->renderShortcode(); 50 50 } 51 51 catch(EVEShipInfo_Exception $e) … … 57 57 } 58 58 59 abstract protected function renderShortcode(); 60 61 59 62 protected function getAttribute($name, $default=null) 60 63 { 61 if(isset($this->attrib utes[$name])) {62 return $this->attrib utes[$name];64 if(isset($this->attribs[$name])) { 65 return $this->attribs[$name]; 63 66 } 64 67 … … 74 77 return admin_url('admin.php?page=eveshipinfo_shortcodes&shortcode='.$this->getID()); 75 78 } 76 77 abstract protected function process();78 79 79 80 abstract public function getName(); -
eve-shipinfo/trunk/classes/EVEShipInfo/Shortcode/EFTFit.php
r1296717 r1515844 25 25 } 26 26 27 p ublic function process()27 protected function renderShortcode() 28 28 { 29 29 $fitID = $this->getAttribute('id'); -
eve-shipinfo/trunk/classes/EVEShipInfo/Shortcode/Gallery.php
r1296717 r1515844 74 74 } 75 75 76 p ublicfunction process()76 protected function process() 77 77 { 78 78 $galleryFolder = $this->plugin->getGalleryPath(); … … 84 84 // we do not use this attribute, but we have to remove it to make 85 85 // sure it is not used by the shared list configuration method. 86 $this->attrib utes['show'] = '';86 $this->attribs['show'] = ''; 87 87 88 88 parent::process(); -
eve-shipinfo/trunk/classes/EVEShipInfo/Shortcode/ShipInfo.php
r1296717 r1515844 18 18 } 19 19 20 p ublic function process()20 protected function renderShortcode() 21 21 { 22 22 $name = $this->getAttribute('name'); -
eve-shipinfo/trunk/classes/EVEShipInfo/Shortcode/ShipList.php
r1515807 r1515844 23 23 protected $filter; 24 24 25 p ublic function process()25 protected function renderShortcode() 26 26 { 27 27 // is this list disabled? … … 73 73 'techlevel' => '', 74 74 'ships' => '', 75 'mass' => '' 75 'mass' => '', 76 76 ); 77 77 } … … 444 444 { 445 445 $this->filter->setOrderBy($this->getAttribute('order_by'), $this->isAscending()); 446 446 447 447 $show = $this->getAttribute('show'); 448 448 if(is_numeric($show)) {
Note: See TracChangeset
for help on using the changeset viewer.