From: <ada...@us...> - 2003-07-17 18:07:27
|
Update of /cvsroot/phpwebsite-comm/modules/article/class In directory sc8-pr-cvs1:/tmp/cvs-serv22699/class Modified Files: Section.php Log Message: Got rid of some double-quotes. Index: Section.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/article/class/Section.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Section.php 16 Jul 2003 19:45:33 -0000 1.3 --- Section.php 17 Jul 2003 18:07:24 -0000 1.4 *************** *** 57,61 **** if ($data==null) { ! $result = $GLOBALS['core']->sqlSelect("mod_article_sections", 'id', $SECT_id); $data = &$result[0]; } --- 57,61 ---- if ($data==null) { ! $result = $GLOBALS['core']->sqlSelect('mod_article_sections', 'id', $SECT_id); $data = &$result[0]; } *************** *** 155,165 **** $template_array['UPDATED_USER'] = $updated_username; ! $section_content = $GLOBALS['core']->processTemplate($template_array, 'article', "section/".$this->template . ".tpl"); } if ($edit_mode) { ! $myform[0] = $GLOBALS["core"]->formHidden("module", "article") ! . $GLOBALS["core"]->formHidden("SECT_id", $this->id); $remove = $_SESSION['translate']->it('Remove'); if($_SESSION['OBJ_user']->js_on) --- 155,165 ---- $template_array['UPDATED_USER'] = $updated_username; ! $section_content = $GLOBALS['core']->processTemplate($template_array, 'article', 'section/'.$this->template . '.tpl'); } if ($edit_mode) { ! $myform[0] = $GLOBALS['core']->formHidden('module', 'article') ! . $GLOBALS['core']->formHidden('SECT_id', $this->id); $remove = $_SESSION['translate']->it('Remove'); if($_SESSION['OBJ_user']->js_on) *************** *** 170,174 **** $js_vars['value'] = 'section=remove:'.$this->id; $js_vars['location'] = 'index.php?module=article§ion=remove&SECT_id='.$this->id; ! $myform[0] .= $GLOBALS['core']->js_insert("confirm", 'SECT_options', $this->id, 0, $js_vars); } else $myform[0] .= $GLOBALS['core']->formSubmit($remove, 'ARTICLE_vars[section:remove]'); --- 170,174 ---- $js_vars['value'] = 'section=remove:'.$this->id; $js_vars['location'] = 'index.php?module=article§ion=remove&SECT_id='.$this->id; ! $myform[0] .= $GLOBALS['core']->js_insert('confirm', 'SECT_options', $this->id, 0, $js_vars); } else $myform[0] .= $GLOBALS['core']->formSubmit($remove, 'ARTICLE_vars[section:remove]'); *************** *** 183,189 **** .$_SESSION['OBJ_help']->show_link('article', 'section_move'); } ! $section_content .= "<div class=\"smalltext\" style=\"clear : both;\" align=\"right\">\n" ! . $GLOBALS["core"]->makeForm("SECT_options" . $this->id, 'index.php#' ! . $this->id, $myform, "post", 0, 0) . '</div><hr />'; } return $section_content; --- 183,189 ---- .$_SESSION['OBJ_help']->show_link('article', 'section_move'); } ! $section_content .= '<div class="smalltext" style="clear : both;" align="right">' ! . $GLOBALS['core']->makeForm('SECT_options' . $this->id, 'index.php#' ! . $this->id, $myform, 'post', 0, 0) . '</div><hr />'; } return $section_content; *************** *** 210,214 **** . $_SESSION['translate']->it('New Section') . '</div>'; ! $myelements[0] = $GLOBALS['core']->formCheckBox('SECT_new_page',1,$this->new_page,NULL, $_SESSION['translate']->it("Start on new page?")) . $_SESSION['OBJ_help']->show_link('article', 'section_new_page') . '<br />'; --- 210,214 ---- . $_SESSION['translate']->it('New Section') . '</div>'; ! $myelements[0] = $GLOBALS['core']->formCheckBox('SECT_new_page',1,$this->new_page,NULL, $_SESSION['translate']->it('Start on new page?')) . $_SESSION['OBJ_help']->show_link('article', 'section_new_page') . '<br />'; *************** *** 222,226 **** . $_SESSION['OBJ_help']->show_link('article', 'section_text') .'<br />' . $GLOBALS['core']->js_insert('wysiwyg', 'SECT_edit', 'SECT_text'); ! $myelements[0] .= $GLOBALS['core']->formTextArea("SECT_text", stripslashes($this->text), 20, 79) . '<br />'; /* If there is a current image, show it */ --- 222,226 ---- . $_SESSION['OBJ_help']->show_link('article', 'section_text') .'<br />' . $GLOBALS['core']->js_insert('wysiwyg', 'SECT_edit', 'SECT_text'); ! $myelements[0] .= $GLOBALS['core']->formTextArea('SECT_text', stripslashes($this->text), 20, 79) . '<br />'; /* If there is a current image, show it */ *************** *** 228,234 **** /* If this is a temporary image, look in the main directory */ if ($this->temp_image) ! $myelements[0] .= "<img src=\"" .$_SESSION['SES_ART_master']->image_directory . $this->image['name'] . "\" /><br />"; else ! $myelements[0] .= "<img src=\"" .$_SESSION['SES_ART_master']->image_directory . $this->image['directory'] . $this->image['name'] . "\" /><br />"; /* If user is allowed to play around with the images... */ if ($_SESSION['OBJ_user']->allow_access('article', 'images_in_articles') --- 228,234 ---- /* If this is a temporary image, look in the main directory */ if ($this->temp_image) ! $myelements[0] .= '<img src="' .$_SESSION['SES_ART_master']->image_directory . $this->image['name'] . '" /><br />'; else ! $myelements[0] .= '<img src="' .$_SESSION['SES_ART_master']->image_directory . $this->image['directory'] . $this->image['name'] . '" /><br />'; /* If user is allowed to play around with the images... */ if ($_SESSION['OBJ_user']->allow_access('article', 'images_in_articles') *************** *** 238,242 **** if($this->image['name']) $myelements[0] .= $_SESSION['translate']->it('Remove Image').'? ' ! . $GLOBALS['core']->formCheckBox('removeImage', 1, NULL, NULL) . "<br />"; /* If allowed, upload your image here */ --- 238,242 ---- if($this->image['name']) $myelements[0] .= $_SESSION['translate']->it('Remove Image').'? ' ! . $GLOBALS['core']->formCheckBox('removeImage', 1, NULL, NULL) . '<br />'; /* If allowed, upload your image here */ *************** *** 246,250 **** $myelements[0] .= $GLOBALS['core']->formHidden('MAX_FILE_SIZE', '26000'); $myelements[0] .= $_SESSION['SES_ART_master']->get_error('SECT_loaded_image') ! . $_SESSION['translate']->it("Upload a new image").': ' . $GLOBALS['core']->formFile('SECT_loaded_image', 33, 255) . $_SESSION['OBJ_help']->show_link('article', 'section_image') . '<br />'; --- 246,250 ---- $myelements[0] .= $GLOBALS['core']->formHidden('MAX_FILE_SIZE', '26000'); $myelements[0] .= $_SESSION['SES_ART_master']->get_error('SECT_loaded_image') ! . $_SESSION['translate']->it('Upload a new image').': ' . $GLOBALS['core']->formFile('SECT_loaded_image', 33, 255) . $_SESSION['OBJ_help']->show_link('article', 'section_image') . '<br />'; *************** *** 255,259 **** while($value = readdir($dir_handle)) { ! if ($value != "." && $value != ".." && $value != "CVS") $lib_array[$value] = $value; if ($value == $this->image['name']) $lib_selected = $value; --- 255,259 ---- while($value = readdir($dir_handle)) { ! if ($value != '.' && $value != '..' && $value != 'CVS') $lib_array[$value] = $value; if ($value == $this->image['name']) $lib_selected = $value; *************** *** 269,273 **** $myelements[0] .= $_SESSION['translate']->it('Or select one from the library').': ' . $GLOBALS['core']->formSelect('SECT_lib_image', $lib_array, $this->image['name'], NULL, NULL, NULL) ! . $_SESSION['OBJ_help']->show_link('article', "section_lib_image") . "<br /><br />"; /* Enter alt text, link, & image_caption */ --- 269,273 ---- $myelements[0] .= $_SESSION['translate']->it('Or select one from the library').': ' . $GLOBALS['core']->formSelect('SECT_lib_image', $lib_array, $this->image['name'], NULL, NULL, NULL) ! . $_SESSION['OBJ_help']->show_link('article', 'section_lib_image') . '<br /><br />'; /* Enter alt text, link, & image_caption */ *************** *** 308,322 **** asort($sect_tpl_array); $myelements[0] .= $_SESSION['translate']->it('Section Template').': ' ! . $GLOBALS['core']->formSelect("SECT_template", $sect_tpl_array, $this->template, true, NULL, NULL) . $_SESSION['OBJ_help']->show_link('article', 'section_template') ! . "<br /><br />"; } ! $myelements[0] .= $GLOBALS["core"]->formHidden("module", "article") . $GLOBALS['core']->formSubmit($_SESSION['translate']->it('Save Section'), 'ARTICLE_vars[section:save]') . $_SESSION['OBJ_help']->show_link('article', 'section_save'); return $section_title ! . $GLOBALS["core"]->makeForm('SECT_edit', 'index.php#'.$this->id, $myelements, 'post', 0, 1) . '<br />'; } --- 308,322 ---- asort($sect_tpl_array); $myelements[0] .= $_SESSION['translate']->it('Section Template').': ' ! . $GLOBALS['core']->formSelect('SECT_template', $sect_tpl_array, $this->template, true, NULL, NULL) . $_SESSION['OBJ_help']->show_link('article', 'section_template') ! . '<br /><br />'; } ! $myelements[0] .= $GLOBALS['core']->formHidden('module', 'article') . $GLOBALS['core']->formSubmit($_SESSION['translate']->it('Save Section'), 'ARTICLE_vars[section:save]') . $_SESSION['OBJ_help']->show_link('article', 'section_save'); return $section_title ! . $GLOBALS['core']->makeForm('SECT_edit', 'index.php#'.$this->id, $myelements, 'post', 0, 1) . '<br />'; } *************** *** 338,347 **** { $_SESSION['SES_ART_master']->error['SECT_title'][] ! = $_SESSION['translate']->it("You tried to save an empty section"); return; } /* Image Removal */ ! if(isset($_POST['removeImage']) && $this->image['name'] && $this->image['directory']!="library/") { /* If this is the original image, place its name into "old_image" */ --- 338,347 ---- { $_SESSION['SES_ART_master']->error['SECT_title'][] ! = $_SESSION['translate']->it('You tried to save an empty section'); return; } /* Image Removal */ ! if(isset($_POST['removeImage']) && $this->image['name'] && $this->image['directory']!='library/') { /* If this is the original image, place its name into "old_image" */ *************** *** 380,387 **** { /* Give it a unique name */ ! $ext = strrchr($_FILES['SECT_loaded_image']['name'], "."); ! $_FILES['SECT_loaded_image']['name'] = time() . "-" . $_SESSION['OBJ_user']->user_id . $ext; /* Place it into the temporary directory */ ! $image = EZform::saveImage("SECT_loaded_image" , $_SESSION['SES_ART_master']->image_path , $_SESSION['SES_ART_master']->val['max_image_width'] --- 380,387 ---- { /* Give it a unique name */ ! $ext = strrchr($_FILES['SECT_loaded_image']['name'], '.'); ! $_FILES['SECT_loaded_image']['name'] = time() . '-' . $_SESSION['OBJ_user']->user_id . $ext; /* Place it into the temporary directory */ ! $image = EZform::saveImage('SECT_loaded_image' , $_SESSION['SES_ART_master']->image_path , $_SESSION['SES_ART_master']->val['max_image_width'] *************** *** 400,404 **** $this->image = array_merge($this->image, $image); $this->temp_image = $this->image['name']; ! if (!$this->image['directory'] || $this->image['directory']=="library/") $this->image['directory'] = $this->AssignDir(); } --- 400,404 ---- $this->image = array_merge($this->image, $image); $this->temp_image = $this->image['name']; ! if (!$this->image['directory'] || $this->image['directory']=='library/') $this->image['directory'] = $this->AssignDir(); } *************** *** 407,419 **** } /* otherwise, if a file was selected from the library... */ ! elseif ($_POST['SECT_lib_image'] != "None") { /* Assign the file to the temp variables */ $this->image['name'] = $_POST['SECT_lib_image']; ! $this->image['directory'] = "library/"; /* If this is replacing a new(uncommitted) image, delete the obsolete one */ if ($this->temp_image) @unlink($_SESSION['SES_ART_master']->image_path.$this->temp_image); ! $this->temp_image = $this->image['height'] = $this->image['width'] = ""; } --- 407,419 ---- } /* otherwise, if a file was selected from the library... */ ! elseif ($_POST['SECT_lib_image'] != 'None') { /* Assign the file to the temp variables */ $this->image['name'] = $_POST['SECT_lib_image']; ! $this->image['directory'] = 'library/'; /* If this is replacing a new(uncommitted) image, delete the obsolete one */ if ($this->temp_image) @unlink($_SESSION['SES_ART_master']->image_path.$this->temp_image); ! $this->temp_image = $this->image['height'] = $this->image['width'] = ''; } *************** *** 421,425 **** if($this->image['name']) if (!$this->image['alt']) ! $_SESSION['SES_ART_master']->error['SECT_alt'][] = $_SESSION['translate']->it("You must provide a short description for your image"); /* If this is a new section, add it to the article */ --- 421,425 ---- if($this->image['name']) if (!$this->image['alt']) ! $_SESSION['SES_ART_master']->error['SECT_alt'][] = $_SESSION['translate']->it('You must provide a short description for your image'); /* If this is a new section, add it to the article */ *************** *** 455,459 **** if (isset($_SESSION['OBJ_WIKI'])) PHPWS_File::fileCopy($_SESSION['SES_ART_master']->image_path.$this->image['directory'].$this->old_image ! , $_SESSION['SES_ART_master']->image_path."old/" , $this->old_image, TRUE, FALSE); /* Get rid of it */ --- 455,459 ---- if (isset($_SESSION['OBJ_WIKI'])) PHPWS_File::fileCopy($_SESSION['SES_ART_master']->image_path.$this->image['directory'].$this->old_image ! , $_SESSION['SES_ART_master']->image_path.'old/' , $this->old_image, TRUE, FALSE); /* Get rid of it */ *************** *** 463,467 **** /* If none exists, Pre-allocate an ID for this section */ if(!is_numeric($this->id)) ! $newid = $GLOBALS['core']->db->nextId($GLOBALS['core']->tbl_prefix . "mod_article_sections"); else $newid = $this->id; --- 463,467 ---- /* If none exists, Pre-allocate an ID for this section */ if(!is_numeric($this->id)) ! $newid = $GLOBALS['core']->db->nextId($GLOBALS['core']->tbl_prefix . 'mod_article_sections'); else $newid = $this->id; *************** *** 482,494 **** && PHPWS_File::fileCopy($_SESSION['SES_ART_master']->image_path.$this->temp_image , $_SESSION['SES_ART_master']->image_path.$this->image['directory'] ! , $newid.strrchr($this->image['name'], "."), TRUE, FALSE)) { @unlink($_SESSION['SES_ART_master']->image_path.$this->image['name']); ! $query_data['image_name'] = $this->image['name'] = $newid.strrchr($this->image['name'], "."); } } else $query_data['image_height'] = $query_data['image_width'] = $query_data['image_alt'] = ! $query_data['image_link'] = $query_data['image_caption'] = ""; /* If this is a new section, save it to get an ID assigned */ --- 482,494 ---- && PHPWS_File::fileCopy($_SESSION['SES_ART_master']->image_path.$this->temp_image , $_SESSION['SES_ART_master']->image_path.$this->image['directory'] ! , $newid.strrchr($this->image['name'], '.'), TRUE, FALSE)) { @unlink($_SESSION['SES_ART_master']->image_path.$this->image['name']); ! $query_data['image_name'] = $this->image['name'] = $newid.strrchr($this->image['name'], '.'); } } else $query_data['image_height'] = $query_data['image_width'] = $query_data['image_alt'] = ! $query_data['image_link'] = $query_data['image_caption'] = ''; /* If this is a new section, save it to get an ID assigned */ *************** *** 501,505 **** else /* otherwise, save the data */ ! $GLOBALS['core']->sqlUpdate($query_data, "mod_article_sections", 'id', $this->id); /* Erase section flags */ --- 501,505 ---- else /* otherwise, save the data */ ! $GLOBALS['core']->sqlUpdate($query_data, 'mod_article_sections', 'id', $this->id); /* Erase section flags */ *************** *** 517,522 **** function delete_section () { ! $GLOBALS['core']->sqlDelete("mod_article_sections", 'id', $this->id); ! if ($this->image['name'] && $this->image['directory'] != "library/") @unlink($_SESSION['SES_ART_master']->image_path.$this->image['directory'].$this->image['name']); } --- 517,522 ---- function delete_section () { ! $GLOBALS['core']->sqlDelete('mod_article_sections', 'id', $this->id); ! if ($this->image['name'] && $this->image['directory'] != 'library/') @unlink($_SESSION['SES_ART_master']->image_path.$this->image['directory'].$this->image['name']); } *************** *** 553,557 **** /* Count how many files are in the last directory. Allow for "." & ".."*/ $count = -2; ! if ($dir_handle = opendir($_SESSION['SES_ART_master']->image_path . $last_dir . "/")) while($value = readdir($dir_handle)) $count++; --- 553,557 ---- /* Count how many files are in the last directory. Allow for "." & ".."*/ $count = -2; ! if ($dir_handle = opendir($_SESSION['SES_ART_master']->image_path . $last_dir . '/')) while($value = readdir($dir_handle)) $count++; *************** *** 565,569 **** umask($oldumask); } ! return $last_dir . "/"; } } --- 565,569 ---- umask($oldumask); } ! return $last_dir . '/'; } } |