Exemple #1
0
 function set_template($response, $data)
 {
     $run = $data['run'];
     if ($run == 'update') {
         $response['key'] = $this->handler->update($data['key'], $data['config']);
     } elseif ($run == 'delete') {
         $response['key'] = $this->handler->delete($data['key']);
     } elseif ($run == 'create') {
         $response['key'] = $this->handler->create($data['config']);
     } elseif ($run == 'template_mode') {
         $value = $data['value'];
         $pageID = $data['pageID'];
         $key = 'pl_template_mode';
         pl_meta_update($pageID, $key, $value);
         $response['result'] = pl_meta($pageID, $key);
     } elseif ($run == 'set_global') {
         $field = 'page-template';
         $value = $data['value'];
         $previous_val = pl_global($field);
         if ($previous_val == $value) {
             pl_global_update($field, false);
         } else {
             pl_global_update($field, $value);
         }
         $response['result'] = pl_global($field);
     }
     $response['hi'] = 'hello';
     return $response;
 }
 function set_template($response, $data)
 {
     $run = $data['run'];
     if ($run == 'update') {
         $response['key'] = $this->handler->update($data['key'], $data['config']);
     } elseif ($run == 'delete') {
         $response['key'] = $this->handler->delete($data['key']);
     } elseif ($run == 'create') {
         $response['key'] = $this->handler->create($data['config']);
     } elseif ($run == 'set_global') {
         $field = 'page-template';
         $value = $data['value'];
         $previous_val = pl_global($field);
         if ($previous_val == $value) {
             pl_global_update($field, false);
         } else {
             pl_global_update($field, $value);
         }
         $response['result'] = pl_global($field);
     }
     return $response;
 }