Example #1
0
 /**
  * The profile importer tries to import raw profile fields using the
  * strategy mechanism, but most of the useful profile information is stored
  * in the person entry corresponding to the author.
  *
  * The persondata entry is not actually imported using a strategy, because
  * we need to be able to import basic data from the <author> element if
  * it's not present too. So all the person importing is handled in import_author_data()
  */
 public static function get_import_strategies_for_entry(SimpleXMLElement $entry, PluginImportLeap $importer)
 {
     if (self::$personcontentblank === null) {
         self::$personcontentblank = true;
         if ($persondataid = $importer->get('persondataid')) {
             self::$personcontentblank = !(string) $importer->get_entry_by_id($persondataid)->content;
         }
     }
     $isentry = PluginImportLeap::is_rdf_type($entry, $importer, 'entry');
     if ($isentry && self::$personcontentblank && PluginImportLeap::is_correct_category_scheme($entry, $importer, 'common_item', 'Personalstatement')) {
         return array(array('strategy' => self::STRATEGY_IMPORT_AS_INTRODUCTION, 'score' => 100, 'other_required_entries' => array()));
     }
     // If it's a raw entry with the right mahara:plugin and mahara:type
     // we should be able to import it
     $correctplugintype = count($entry->xpath('mahara:artefactplugin[@mahara:plugin="internal"]')) == 1;
     if ($isentry && $correctplugintype) {
         return array(array('strategy' => self::STRATEGY_IMPORT_AS_PROFILE_FIELD, 'score' => 100, 'other_required_entries' => array()));
     }
     return array();
 }