public static function manager() { if (!self::$manager) { self::$manager = new Projects_Maker_Manager(); } return self::$manager; }
public function __construct($parent, $file, $read_only) { parent::__construct($parent, 'Recipe'); $editor = Projects_Editor_Manager::manager()->editor('', $file->code(), $file->highlight()); $editor->read_only = $read_only; $maker = $this->newElement('div', array(), 'Maker: '); $this->root->appendChild($maker); if (auth_quickaclcheck($file->id()) >= DOKU_EDIT) { $makers = Projects_Maker_Manager::manager()->maker($file); if (count($makers) > 1) { $select = $this->newElement('select', array('id' => 'PROJECTS_maker', 'name' => 'maker')); $maker->appendChild($select); foreach ($makers as $m) { $prop = array('value' => $m->name()); if ($m->name() == $file->maker()) { $prop['selected'] = 1; } $opt = $this->newElement('option', $prop, $m->name()); $select->appendChild($opt); } $controls = $this->newElement('span', array('id' => 'maker_controls', 'maker' => $file->maker())); $maker->appendChild($controls); $form = new Doku_Form(array('id' => 'maker_select_form')); $form->addElement(form_makeButton('submit', 'set_maker', 'update', array('id' => 'set_maker'))); $controls->appendChild($this->loadElement($form->getForm())); $controls->appendChild($this->loadElement(cancel_button())); } else { $m = $makers ? $makers[0]->name() : 'none'; $maker->appendChild($this->newText($m)); } } else { $maker->appendChild($this->newText('Maker: ' . $file->maker())); } $content = $editor->xhtml('recipe', 'savecontent'); $this->root->appendChild($this->loadElement("<div>{$content}</div>")); }
public function analyze() { $maker = NULL; if ($this->maker) { $maker = Projects_Maker_Manager::manager()->maker($this->maker); if (!$maker->can_handle($this)) { $maker = NULL; } } if (!$maker) { $makers = Projects_Maker_Manager::manager()->maker($this); if ($makers) { $maker = $makers[0]; } } if ($maker) { $this->maker = $maker->name(); $deps = $maker->auto_dependency($this); foreach ($deps as $dep) { $this->dependency[$dep] = TRUE; } } else { $this->maker = ''; } }