예제 #1
0
 public function testSetProperty()
 {
     $this->assertNull($this->object->fill);
     $this->object->fillcolor = '#FFFFFF';
     $this->assertTrue($this->object->fill);
     $this->object->fill = false;
     $this->assertNull($this->object->fillcolor);
     $this->object->fillopacity = '1';
     $this->assertTrue($this->object->fill);
     $this->object->fill = 'no';
     $this->assertNull($this->object->fillopacity);
     $illegalfillvalue = 'ha-ha-ha';
     $this->assertFalse($this->object->setProperty('fill', $illegalfillvalue));
     $this->assertEquals($this->object->getErrorMessages(), array(\wfMessage('multimaps-element-illegal-value', 'fill', $illegalfillvalue, '"' . implode('", "', $this->object->getPropertyValidValues('fill')) . '"')->escaped()));
 }
예제 #2
0
 /**
  * Add polygon to map
  * @param string $value
  * @return boolean
  */
 public function addElementPolygon($value)
 {
     $return = true;
     $stringspolygon = explode($GLOBALS['egMultiMaps_SeparatorItems'], $value);
     foreach ($stringspolygon as $polygonvalue) {
         if (trim($polygonvalue) == '') {
             continue;
         }
         $polygon = new Polygon();
         if (!$polygon->parse($polygonvalue, $this->classname)) {
             $return = false;
             $this->errormessages = array_merge($this->errormessages, $polygon->getErrorMessages());
         }
         if (!$polygon->isValid()) {
             continue;
         }
         $this->polygons[] = $polygon;
         $this->elementsBounds->extend($polygon->pos);
     }
     return $return;
 }