/** Create amember record based on the current plugin record * automatically fills fields from the @see getFieldsMapping() * @return User returns not-inserted user */ function createAmember(User $user, Am_Record $record) { foreach ($this->getFieldsMapping() as $a) { list($k, $v) = $a; if (is_callable($k) || $k[0] == ':' || $k[0] == '!' || $k[0] == '_' || $k == self::FIELD_NAME) { continue; } if (($vv = $record->get($v)) && !$user->get($k)) { $user->set($k, $vv); } } $user->data()->set("created-by-plugin", $this->_plugin->getId()); }
/** Create amember record based on the current plugin record * automatically fills fields from the @see getFieldsMapping() * @return User returns not-inserted user */ function createAmember(User $user, Am_Record $record) { foreach ($this->getFieldsMapping() as $a) { list($k, $v) = $a; if ($k[0] == '_') { continue; } if (($vv = $record->get($v)) && !$user->get($k)) { $user->set($k, $vv); } } $user->data()->set("created-by-plugin", $this->_plugin->getId()); }
public function __construct(Am_Protect_Databased $plugin) { parent::__construct($plugin->getId()); $this->setTitle($plugin->getTitle()); $this->plugin = $plugin; $url = Am_Controller::escape(REL_ROOT_URL) . '/default/admin-content/p/integrations/index'; $text = ___("Once the plugin configuration is finished on this page, do not forget to add\n" . "a record on %saMember CP -> Protect Content -> Integrations%s page", '<a href="' . $url . '" target="_blank" class="link">', '</a>'); $this->addProlog(<<<CUT <div class="warning_box"> {$text} </div> CUT ); }