You are here

function devel_create_content in Devel 6

Same name and namespace in other branches
  1. 5 devel_generate.inc \devel_create_content()
  2. 7 devel_generate/devel_generate.inc \devel_create_content()
2 calls to devel_create_content()
devel_generate_add_comments in ./devel_generate.inc
devel_generate_content_add_node in ./devel_generate.inc
Create one node. This is used by both the batch and non-batch branches of the code.

File

./devel_generate.inc, line 226

Code

function devel_create_content($type = NULL) {
  $nparas = mt_rand(1, 12);
  $type = empty($type) ? mt_rand(0, 3) : $type;
  $output = "";
  switch ($type % 3) {
    case 1:

      // html
      for ($i = 1; $i <= $nparas; $i++) {
        $output .= devel_create_para(mt_rand(10, 60), 1);
      }
      break;
    case 2:

      // brs only
      for ($i = 1; $i <= $nparas; $i++) {
        $output .= devel_create_para(mt_rand(10, 60), 2);
      }
      break;
    default:

      // plain text
      for ($i = 1; $i <= $nparas; $i++) {
        $output .= devel_create_para(mt_rand(10, 60)) . "\n\n";
      }
  }
  return $output;
}