This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getColourNice(){ | |
$obj= HTMLText::create(); | |
$obj->setValue('<div style="background-color: '.$this->Colour.'; width: 100px; height: 100px;"> </div>'); | |
return $obj; | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Spider Websites with Wget – 20 Practical Examples | |
Wget is extremely powerful, but like with most other command line programs, the plethora of options it supports can be intimidating to new users. Thus what we have here are a collection of wget commands that you can use to accomplish common tasks from downloading single files to mirroring entire websites. It will help if you can read through the wget manual but for the busy souls, these commands are ready to execute. | |
1. Download a single file from the Internet | |
wget http://example.com/file.iso | |
2. Download a file but save it locally under a different name | |
wget ‐‐output-document=filename.html example.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Make it fullscreen / hide the browser URL bar --> | |
<meta name="apple-mobile-web-app-capable" content="yes" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ContentFutter1 = new HTMLEditorField('ContentFutter1', 'Spalte 1'); | |
$ContentFutter2 = new HTMLEditorField('ContentFutter2', 'Spalte 2'); | |
$ContentFutter3 = new HTMLEditorField('ContentFutter3', 'Spalte 3'); | |
// transform the fields if we're not in the default locale | |
if(Translatable::default_locale() != Translatable::get_current_locale()) { | |
$translation = $this->getTranslation(Translatable::default_locale()); | |
$transformation = new Translatable_Transformation($translation); | |
$ContentFutter1 = $transformation->transformFormField($ContentFutter1); | |
$ContentFutter2 = $transformation->transformFormField($ContentFutter2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$gridField->getConfig()->getComponentByType('GridFieldDataColumns')->setDisplayFields(array( | |
'Created' => 'Erstellt', | |
'Code' => 'Code', | |
'Value' => 'Wert', | |
'Origin' => 'Gutscheinart', | |
'Invoice.Buyer.FirstName' => 'Vorname', | |
'Invoice.Buyer.Surname' => 'Nachname', | |
'inUse' => 'Benutzt' | |
)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isEmptyObject($o) { | |
if ( $o->toMap()['ID'] > 0) { | |
return false; | |
} else { | |
return true; | |
} | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getCMSFields() { | |
$fields = parent::getCMSFields(); | |
$TabSet = $fields->findOrMakeTab('Root'); | |
$Main = $TabSet->fieldByName('Main'); | |
$TabSet->removeByName('Main'); | |
……………… | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @return SS_HTTPRequest | |
*/ | |
public function assetbackup() { | |
$name = $this->Title . '.zip'; | |
$tmpName = TEMP_FOLDER . '/' . $name; | |
$zip = new ZipArchive(); | |
if(!$zip->open($tmpName, ZipArchive::OVERWRITE)) { | |
user_error('Client Export Extension: Unable to read/write temporary zip archive', E_USER_ERROR); | |
return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class CurrencyEuro extends Currency { | |
protected static $currencySymbol = '€'; | |
public function Nice() { | |
$val = number_format(abs($this->value), 2, ',', '.') . ' ' . self::$currencySymbol; | |
if($this->value < 0) return "($val)"; | |
else return $val; |