core = $core; $this->setup(); } /** Set name of this tool @param string Tool's name */ final protected function setName($name) { $this->name = (string) $name; } /** Get name of this tool @return string Tool's name */ final public function getName() { return $this->name; } /** Set description of this tool @param string Tool's description */ final protected function setDesc($desc) { $this->desc = (string) $desc; } /** Get description of this tool @return string Tool's description */ final public function getDesc() { return $this->desc; } /** Set tool as (un)active @param boolean $active True to set it as active */ final protected function setActive($active) { $this->active = (boolean) $active; } /** Check if this tool is active @return boolean True if it is active */ final public function isActive() { return $this->active; } /** Set tool's info - using setName(),setDesc(),setActive() */ abstract protected function setup(); /** Get configuration interface @return Form field */ abstract public function form(); /** Save configuration */ abstract public function save(); /** Translate a string from a language to another @param string $str Trimed UTF-8 string to translate @param string $from Source language code @param string to Destination language code @return Translated string */ abstract public function translate($str,$from,$to); }