<commit_before><?php
/*
* @version 0.3 (auto-set)
*/

  global $parent_id;
  if ($this->owner->name=='panel') {
   $out['CONTROLPANEL']=1;
  }
  $table_name='commands';
  $rec=SQLSelectOne("SELECT * FROM $table_name WHERE ID='$id'");
  if ($parent_id) {
   $rec['PARENT_ID']=(int)$parent_id;
  }

  if ($rec['PARENT_ID']) {
   $out['HISTORY']=$this->getParents($rec['PARENT_ID']);
  }

 

  if ($this->mode=='update') {
   $ok=1;
  if ($this->tab=='') {
   $rec['PARENT_ID']=(int)$parent_id;
  }
  //updating 'TITLE' (varchar, required)
   global $title;
   $rec['TITLE']=$title;
   if ($rec['TITLE']=='') {
    $out['ERR_TITLE']=1;
    $ok=0;
   }

   global $priority;
   $rec['PRIORITY']=$priority;

   global $type;
   $rec['TYPE']=$type;

   global $ext_id;
   $rec['EXT_ID']=(int)$ext_id;

   global $inline;
   $rec['INLINE']=(int)$inline;

   global $visible_delay;
   $rec['VISIBLE_DELAY']=(int)$visible_delay;

   if ($rec['TYPE']=='plusminus' || $rec['TYPE']=='sliderbox') {
    global $min_value;
        $rec['MIN_VALUE']=$min_value;
        global $max_value;
        $rec['MAX_VALUE']=$max_value;
        global $step_value;
        $rec['STEP_VALUE']=$step_value;
   }

   global $delete_icon;
   if ($delete_icon) {
    if ($rec['ICON']!='') {
     @unlink(ROOT.'cms/icons/'.$rec['ICON']);
    }
    $rec['ICON']="";
   }

   global $icon;
   global $icon_name;
   if ($icon!='') {
    if ($rec['ICON']!='') {
     @unlink(ROOT.'cms/icons/'.$rec['ICON']);
    }
    $rec['ICON']=$rec['ID'].'_'.$icon_name;
    copy($icon, ROOT.'cms/icons/'.$rec['ICON']);
   }


  if ($rec['TYPE']=='selectbox' || $rec['TYPE']=='custom') {
   global $data;
   $rec['DATA']=$data;
  } 

if ($rec['TYPE']=='plusminus' 
    || $rec['TYPE']=='sliderbox' 
    || $rec['TYPE']=='selectbox' 
    || $rec['TYPE']=='button' 
    || $rec['TYPE']=='switch' 
    || $rec['TYPE']=='custom'
    || $rec['TYPE']=='timebox'
    || $rec['TYPE']=='textbox'
    ) {
    global $cur_value;
        if ($cur_value!='') {
         $rec['CUR_VALUE']=$cur_value;
        }

    global $linked_object;
    $rec['LINKED_OBJECT']=trim($linked_object);
    global $linked_property;
    $rec['LINKED_PROPERTY']=trim($linked_property);

    global $onchange_object;
    $rec['ONCHANGE_OBJECT']=trim($onchange_object);
    global $onchange_method;
    $rec['ONCHANGE_METHOD']=trim($onchange_method);

    global $script_id;
    $rec['SCRIPT_ID']=$script_id;

    global $code;
    $rec['CODE']=$code;
    if ($rec['CODE']!='') {
     //echo $content;
     $errors=php_syntax_error($rec['CODE']);
     if ($errors) {
      $out['ERR_CODE']=1;<commit_msg>Date field bug fixed<commit_after><?php
/*
* @version 0.3 (auto-set)
*/

  global $parent_id;
  if ($this->owner->name=='panel') {
   $out['CONTROLPANEL']=1;
  }
  $table_name='commands';
  $rec=SQLSelectOne("SELECT * FROM $table_name WHERE ID='$id'");
  if ($parent_id) {
   $rec['PARENT_ID']=(int)$parent_id;
  }

  if ($rec['PARENT_ID']) {
   $out['HISTORY']=$this->getParents($rec['PARENT_ID']);
  }

 

  if ($this->mode=='update') {
   $ok=1;
  if ($this->tab=='') {
   $rec['PARENT_ID']=(int)$parent_id;
  }
  //updating 'TITLE' (varchar, required)
   global $title;
   $rec['TITLE']=$title;
   if ($rec['TITLE']=='') {
    $out['ERR_TITLE']=1;
    $ok=0;
   }

   global $priority;
   $rec['PRIORITY']=$priority;

   global $type;
   $rec['TYPE']=$type;

   global $ext_id;
   $rec['EXT_ID']=(int)$ext_id;

   global $inline;
   $rec['INLINE']=(int)$inline;

   global $visible_delay;
   $rec['VISIBLE_DELAY']=(int)$visible_delay;

   if ($rec['TYPE']=='plusminus' || $rec['TYPE']=='sliderbox') {
    global $min_value;
        $rec['MIN_VALUE']=$min_value;
        global $max_value;
        $rec['MAX_VALUE']=$max_value;
        global $step_value;
        $rec['STEP_VALUE']=$step_value;
   }

   global $delete_icon;
   if ($delete_icon) {
    if ($rec['ICON']!='') {
     @unlink(ROOT.'cms/icons/'.$rec['ICON']);
    }
    $rec['ICON']="";
   }

   global $icon;
   global $icon_name;
   if ($icon!='') {
    if ($rec['ICON']!='') {
     @unlink(ROOT.'cms/icons/'.$rec['ICON']);
    }
    $rec['ICON']=$rec['ID'].'_'.$icon_name;
    copy($icon, ROOT.'cms/icons/'.$rec['ICON']);
   }


  if ($rec['TYPE']=='selectbox' || $rec['TYPE']=='custom') {
   global $data;
   $rec['DATA']=$data;
  } 

if ($rec['TYPE']=='plusminus' 
    || $rec['TYPE']=='sliderbox' 
    || $rec['TYPE']=='selectbox' 
    || $rec['TYPE']=='button' 
    || $rec['TYPE']=='switch' 
    || $rec['TYPE']=='custom'
    || $rec['TYPE']=='timebox'
    || $rec['TYPE']=='datebox'
    || $rec['TYPE']=='textbox'
    ) {
    global $cur_value;
        if ($cur_value!='') {
         $rec['CUR_VALUE']=$cur_value;
        }

    global $linked_object;
    $rec['LINKED_OBJECT']=trim($linked_object);
    global $linked_property;
    $rec['LINKED_PROPERTY']=trim($linked_property);

    global $onchange_object;
    $rec['ONCHANGE_OBJECT']=trim($onchange_object);
    global $onchange_method;
    $rec['ONCHANGE_METHOD']=trim($onchange_method);

    global $script_id;
    $rec['SCRIPT_ID']=$script_id;

    global $code;
    $rec['CODE']=$code;
    if ($rec['CODE']!='') {
     //echo $content;
     $errors=php_syntax_error($rec['CODE']);
     if ($errors) {
      $out['ERR_CODE']=1;
{'fraction_non_alphanumeric': 0.24630821658462704, 'fraction_numerical': 0.0026505111700113595, 'mean_word_length': 3.5939130434782607, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4213785', 'n_tokens_mistral': 2143, 'n_tokens_neox': 2040, 'n_words': 265}