You are here

function devel_create_content in Devel 5

Same name and namespace in other branches
  1. 6 devel_generate.inc \devel_create_content()
  2. 7 devel_generate/devel_generate.inc \devel_create_content()
1 call to devel_create_content()
devel_create_nodes in ./devel_generate.inc

File

./devel_generate.inc, line 281

Code

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

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

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

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