original_string: protected function define_settings() {
          global $CFG;
          require_once($CFG->libdir.'/questionlib.php');
  
          // All the settings related to this activity will include this prefix
          $settingprefix = $this->modulename . '_' . $this->moduleid . '_';
  
          // All these are common settings to be shared by all activities
  
          // Define activity_include (to decide if the whole task must be really executed)
          // Dependent of:
          // - activities root setting
          // - section_included setting (if exists)
          $settingname = $settingprefix . 'included';
          $activity_included = new backup_activity_generic_setting($settingname, base_setting::IS_BOOLEAN, true);
          $activity_included->get_ui()->set_icon(new image_icon('icon', get_string('pluginname', $this->modulename),
              $this->modulename, array('class' => 'iconlarge icon-post')));
          $this->add_setting($activity_included);
          // Look for "activities" root setting
          $activities = $this->plan->get_setting('activities');
          $activities->add_dependency($activity_included);
  
          if (question_module_uses_questions($this->modulename)) {
              $questionbank = $this->plan->get_setting('questionbank');
              $questionbank->add_dependency($activity_included);
          }
  
          // Look for "section_included" section setting (if exists)
          $settingname = 'section_' . $this->sectionid . '_included';
          if ($this->plan->setting_exists($settingname)) {
              $section_included = $this->plan->get_setting($settingname);
              $section_included->add_dependency($activity_included);
          }
  
          // Define activity_userinfo. Dependent of:
          // - users root setting
          // - section_userinfo setting (if exists)
          // - activity_included setting
          $settingname = $settingprefix . 'userinfo';
          $activity_userinfo = new backup_activity_userinfo_setting($settingname, base_setting::IS_BOOLEAN, true);
          //$activity_userinfo->get_ui()->set_label(get_string('includeuserinfo','backup'));
          $activity_userinfo->get_ui()->set_label('-');
          $this->add_setting($activity_userinfo);
          // Look for "users" root setting
          $users = $this->plan->get_setting('users');
          $users->add_dependency($activity_userinfo);
          // Look for "section_userinfo" section setting (if exists)
          $settingname = 'section_' . $this->sectionid . '_userinfo';
          if ($this->plan->setting_exists($settingname)) {
              $section_userinfo = $this->plan->get_setting($settingname);
              $section_userinfo->add_dependency($activity_userinfo);
          }
          // Look for "activity_included" setting
          $activity_included->add_dependency($activity_userinfo);
  
          // End of common activity settings, let's add the particular ones
          $this->define_my_settings();
      }
code: protected function define_settings() {
          global $CFG;
          require_once($CFG->libdir.'/questionlib.php');
  
          // All the settings related to this activity will include this prefix
          $settingprefix = $this->modulename . '_' . $this->moduleid . '_';
  
          // All these are common settings to be shared by all activities
  
          // Define activity_include (to decide if the whole task must be really executed)
          // Dependent of:
          // - activities root setting
          // - section_included setting (if exists)
          $settingname = $settingprefix . 'included';
          $activity_included = new backup_activity_generic_setting($settingname, base_setting::IS_BOOLEAN, true);
          $activity_included->get_ui()->set_icon(new image_icon('icon', get_string('pluginname', $this->modulename),
              $this->modulename, array('class' => 'iconlarge icon-post')));
          $this->add_setting($activity_included);
          // Look for "activities" root setting
          $activities = $this->plan->get_setting('activities');
          $activities->add_dependency($activity_included);
  
          if (question_module_uses_questions($this->modulename)) {
              $questionbank = $this->plan->get_setting('questionbank');
              $questionbank->add_dependency($activity_included);
          }
  
          // Look for "section_included" section setting (if exists)
          $settingname = 'section_' . $this->sectionid . '_included';
          if ($this->plan->setting_exists($settingname)) {
              $section_included = $this->plan->get_setting($settingname);
              $section_included->add_dependency($activity_included);
          }
  
          // Define activity_userinfo. Dependent of:
          // - users root setting
          // - section_userinfo setting (if exists)
          // - activity_included setting
          $settingname = $settingprefix . 'userinfo';
          $activity_userinfo = new backup_activity_userinfo_setting($settingname, base_setting::IS_BOOLEAN, true);
          //$activity_userinfo->get_ui()->set_label(get_string('includeuserinfo','backup'));
          $activity_userinfo->get_ui()->set_label('-');
          $this->add_setting($activity_userinfo);
          // Look for "users" root setting
          $users = $this->plan->get_setting('users');
          $users->add_dependency($activity_userinfo);
          // Look for "section_userinfo" section setting (if exists)
          $settingname = 'section_' . $this->sectionid . '_userinfo';
          if ($this->plan->setting_exists($settingname)) {
              $section_userinfo = $this->plan->get_setting($settingname);
              $section_userinfo->add_dependency($activity_userinfo);
          }
          // Look for "activity_included" setting
          $activity_included->add_dependency($activity_userinfo);
  
          // End of common activity settings, let's add the particular ones
          $this->define_my_settings();
      }
code_tokens: protected function define_settings ( ) { global $ CFG ; require_once ( $ CFG -> libdir . '/questionlib.php' ) ; // All the settings related to this activity will include this prefix $ settingprefix = $ this -> modulename . '_' . $ this -> moduleid . '_' ; // All these are common settings to be shared by all activities // Define activity_include (to decide if the whole task must be really executed) // Dependent of: // - activities root setting // - section_included setting (if exists) $ settingname = $ settingprefix . 'included' ; $ activity_included = new backup_activity_generic_setting ( $ settingname , base_setting :: IS_BOOLEAN , true ) ; $ activity_included -> get_ui ( ) -> set_icon ( new image_icon ( 'icon' , get_string ( 'pluginname' , $ this -> modulename ) , $ this -> modulename , array ( 'class' => 'iconlarge icon-post' ) ) ) ; $ this -> add_setting ( $ activity_included ) ; // Look for "activities" root setting $ activities = $ this -> plan -> get_setting ( 'activities' ) ; $ activities -> add_dependency ( $ activity_included ) ; if ( question_module_uses_questions ( $ this -> modulename ) ) { $ questionbank = $ this -> plan -> get_setting ( 'questionbank' ) ; $ questionbank -> add_dependency ( $ activity_included ) ; } // Look for "section_included" section setting (if exists) $ settingname = 'section_' . $ this -> sectionid . '_included' ; if ( $ this -> plan -> setting_exists ( $ settingname ) ) { $ section_included = $ this -> plan -> get_setting ( $ settingname ) ; $ section_included -> add_dependency ( $ activity_included ) ; } // Define activity_userinfo. Dependent of: // - users root setting // - section_userinfo setting (if exists) // - activity_included setting $ settingname = $ settingprefix . 'userinfo' ; $ activity_userinfo = new backup_activity_userinfo_setting ( $ settingname , base_setting :: IS_BOOLEAN , true ) ; //$activity_userinfo->get_ui()->set_label(get_string('includeuserinfo','backup')); $ activity_userinfo -> get_ui ( ) -> set_label ( '-' ) ; $ this -> add_setting ( $ activity_userinfo ) ; // Look for "users" root setting $ users = $ this -> plan -> get_setting ( 'users' ) ; $ users -> add_dependency ( $ activity_userinfo ) ; // Look for "section_userinfo" section setting (if exists) $ settingname = 'section_' . $ this -> sectionid . '_userinfo' ; if ( $ this -> plan -> setting_exists ( $ settingname ) ) { $ section_userinfo = $ this -> plan -> get_setting ( $ settingname ) ; $ section_userinfo -> add_dependency ( $ activity_userinfo ) ; } // Look for "activity_included" setting $ activity_included -> add_dependency ( $ activity_userinfo ) ; // End of common activity settings, let's add the particular ones $ this -> define_my_settings ( ) ; }
docstring: Defines the common setting that any backup activity will have
docstring_tokens: Defines the common setting that any backup activity will have